fix BUILD_SHARED_LIBS and add it as an OPTION (cross fingers that CMake lets you expose existing vars as OPTION)

this should fix issue 176, thanks to Stephen Peters!
This commit is contained in:
Erwin Coumans
2014-05-19 20:50:10 -07:00
parent 3dd759c463
commit f213b00022
2 changed files with 7 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
OPTION(USE_DOUBLE_PRECISION "Use double precision" OFF) OPTION(USE_DOUBLE_PRECISION "Use double precision" OFF)
OPTION(USE_GRAPHICAL_BENCHMARK "Use Graphical Benchmark" ON) OPTION(USE_GRAPHICAL_BENCHMARK "Use Graphical Benchmark" ON)
OPTION(BUILD_SHARED_LIBS "Use shared libraries" OFF)
OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" OFF) OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" OFF)
OPTION(USE_MSVC_INCREMENTAL_LINKING "Use MSVC Incremental Linking" OFF) OPTION(USE_MSVC_INCREMENTAL_LINKING "Use MSVC Incremental Linking" OFF)
@@ -226,6 +226,10 @@ ENDIF(USE_GLUT)
ENDIF() ENDIF()
ENDIF(BUILD_BULLET2_DEMOS) ENDIF(BUILD_BULLET2_DEMOS)
IF (APPLE)
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
ENDIF()
OPTION(BUILD_BULLET3 "Set when you want to build Bullet 3" ON) OPTION(BUILD_BULLET3 "Set when you want to build Bullet 3" ON)
IF(BUILD_BULLET3) IF(BUILD_BULLET3)
OPTION(BUILD_BULLET3_DEMOS "Set when you want to build the Bullet 3 demos" ON) OPTION(BUILD_BULLET3_DEMOS "Set when you want to build the Bullet 3 demos" ON)

View File

@@ -40,6 +40,8 @@ ENDIF()
ADD_LIBRARY(OpenGLWindow ${OpenGLWindow_SRCS} ${OpenGLWindow_HDRS}) ADD_LIBRARY(OpenGLWindow ${OpenGLWindow_SRCS} ${OpenGLWindow_HDRS})
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE)
target_link_libraries(OpenGLWindow X11) target_link_libraries(OpenGLWindow X11)
elseif (APPLE)
target_link_libraries(OpenGLWindow ${COCOA_LIBRARY})
endif () endif ()
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)