浏览代码

bugfix: fix cmake static linkage option.

Signed-off-by: Kim Kulling <[email protected]>
Kim Kulling 11 年之前
父节点
当前提交
e09d88fa59
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      CMakeLists.txt

+ 7 - 0
CMakeLists.txt

@@ -76,11 +76,18 @@ SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE PATH
 	"Path the header files are installed to." )
 SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE PATH
 	"Path the tool executables are installed to." )
+SET ( ASSIMP_BUILD_STATIC_LIB OFF CACHE BOOL
+    "Build a static (.a) version of the library" )
 
 SET(ASSIMP_DEBUG_POSTFIX "d" CACHE STRING "Debug Postfitx for lib, samples and tools")
 
 # Allow the user to build a static library
 option ( BUILD_SHARED_LIBS "Build a shared version of the library" ON )
+IF ( ASSIMP_BUILD_STATIC_LIB )
+    option ( BUILD_SHARED_LIBS "Build a shared version of the library" OFF )
+ELSE ( ASSIMP_BUILD_STATIC_LIB )
+    option ( BUILD_SHARED_LIBS "Build a shared version of the library" ON )
+ENDIF ( ASSIMP_BUILD_STATIC_LIB )
 
 # Generate a pkg-config .pc for the Assimp library.
 CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY )