0025713: CMake configuring procedure should allow to build OCCT as static libraries
authoribs <ibs@opencascade.com>
Fri, 16 Jan 2015 09:15:11 +0000 (12:15 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 6 May 2015 13:41:57 +0000 (16:41 +0300)
BUILD_LIBRARY_TYPE variable added

CMakeLists.txt

index cc7225e..0a9ecf1 100644 (file)
@@ -10,6 +10,18 @@ endif()
 
 set (CMAKE_CONFIGURATION_TYPES ${BUILD_CONFIGURATION} CACHE INTERNAL "" FORCE)
 
+# set type of OCCT libraries
+if (NOT BUILD_LIBRARY_TYPE)
+  set (BUILD_LIBRARY_TYPE "Shared" CACHE STRING "The type of OCCT libraries" FORCE)
+  SET_PROPERTY(CACHE BUILD_LIBRARY_TYPE PROPERTY STRINGS Shared Static)
+endif()
+
+if ("${BUILD_LIBRARY_TYPE}" STREQUAL "Shared")
+  set (BUILD_SHARED_LIBS ON)
+else()
+  unset (BUILD_SHARED_LIBS)
+endif()
+
 # the name of the project
 project (OCCT)