mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-21 21:35:06 +00:00
CMake: Add BUILD_SHARED_LIBS option
This commit is contained in:
parent
e34bb212f6
commit
2b16160853
@ -26,6 +26,7 @@ if (APPLE)
|
||||
endif ()
|
||||
option (GLEW_X11 "X11 mode" ON)
|
||||
option (GLEW_EGL "EGL mode" OFF)
|
||||
option (BUILD_SHARED_LIBS "install/link shared instead of static libs" ON)
|
||||
|
||||
set (GLEW_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..)
|
||||
|
||||
@ -162,11 +163,9 @@ else()
|
||||
endif()
|
||||
|
||||
set(targets_to_install "")
|
||||
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
list(APPEND targets_to_install glew)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED BUILD_SHARED_LIBS OR NOT BUILD_SHARED_LIBS)
|
||||
else ()
|
||||
list(APPEND targets_to_install glew_s)
|
||||
endif()
|
||||
|
||||
@ -184,7 +183,7 @@ if (BUILD_UTILS)
|
||||
list (APPEND GLEWINFO_SRC_FILES ${GLEW_DIR}/build/glewinfo.rc)
|
||||
endif ()
|
||||
add_executable (glewinfo ${GLEWINFO_SRC_FILES})
|
||||
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_link_libraries (glewinfo glew)
|
||||
else()
|
||||
target_link_libraries (glewinfo glew_s)
|
||||
@ -198,7 +197,7 @@ if (BUILD_UTILS)
|
||||
list (APPEND VISUALINFO_SRC_FILES ${GLEW_DIR}/build/visualinfo.rc)
|
||||
endif ()
|
||||
add_executable (visualinfo ${VISUALINFO_SRC_FILES})
|
||||
if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_link_libraries (visualinfo glew)
|
||||
else()
|
||||
target_link_libraries (visualinfo glew_s)
|
||||
|
Loading…
Reference in New Issue
Block a user