Build only one of static or shared libraries

As discussed on the forums, to simplify the CMake code and avoid having to
manually specify dependencies this removes the hack to allow both static
and shared libraries to be built at the same time.

It introduces the new variable LIBRARY_TYPE which can be either STATIC or
DYNAMIC.

See: http://www.volumesoffun.com/phpBB3/viewtopic.php?p=3203#p3203
This commit is contained in:
Matt Williams
2012-07-19 17:33:34 +01:00
parent 5d93eef5ac
commit f11b4e17c1
6 changed files with 48 additions and 150 deletions

View File

@ -19,13 +19,6 @@ 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)