From 5d93eef5acecb89ba4400350ffcb046e8b8a5bb0 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Wed, 18 Jul 2012 20:36:55 +0100 Subject: [PATCH] Add dependencies to SWIG bindings Due to the hack in which we enable the building of both static and shared libraries CMake's automatic dependency sorting isn't working. Manually specifying the dependency seems to solve the problem of components building out of order. --- library/bindings/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/bindings/CMakeLists.txt b/library/bindings/CMakeLists.txt index b7d76df7..bb88157e 100644 --- a/library/bindings/CMakeLists.txt +++ b/library/bindings/CMakeLists.txt @@ -19,6 +19,13 @@ if(ENABLE_BINDINGS) swig_add_module(PolyVoxCore python PolyVoxCore.i) swig_link_libraries(PolyVoxCore ${PYTHON_LIBRARIES} PolyVoxCore) #set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd") + + if(ENABLE_STATIC_LIBRARIES) + ADD_DEPENDENCIES(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PolyVoxCoreStatic PolyVoxUtilStatic) + endif() + if(ENABLE_DYNAMIC_LIBRARIES) + ADD_DEPENDENCIES(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PolyVoxCoreDynamic PolyVoxUtilDynamic) + endif() endif() else() set(BUILD_BINDINGS OFF CACHE BOOL "Will the bindings be built" FORCE)