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