diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index 2649bd0..9ff5c9f 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -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)