diff --git a/CMakeLists.txt b/CMakeLists.txt index 2da00e0e1e..46c4306d54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,16 +49,18 @@ os_target_config() global_target_config() option(BUILD_CV_KINFU_EXAMPLE "Build OpenCV KinectFusion example" OFF) +include(CMake/install_config.cmake) + add_subdirectory(wrappers) if (BUILD_EXAMPLES AND BUILD_GLSL_EXTENSIONS) find_package(glfw3 3.3 QUIET) if(NOT TARGET glfw) message(STATUS "GLFW 3.3 not found; using internal version") - set(GLFW_INSTALL ON) + set(GLFW_INSTALL ON CACHE BOOL "" FORCE) add_subdirectory(third-party/glfw) endif() - #add_subdirectory(src/gl) + add_subdirectory(src/gl) endif() if(BUILD_EXAMPLES) @@ -73,10 +75,3 @@ endif() if (BUILD_WITH_TM2) add_tm2() endif() - -include(CMake/install_config.cmake) - -if (BUILD_EXAMPLES AND BUILD_GLSL_EXTENSIONS) - add_subdirectory(src/gl) -endif() - diff --git a/third-party/glfw/CMakeLists.txt b/third-party/glfw/CMakeLists.txt index 8df1ca0224..4e6167e26d 100644 --- a/third-party/glfw/CMakeLists.txt +++ b/third-party/glfw/CMakeLists.txt @@ -358,8 +358,7 @@ endif() # Install files other than the library # The library is installed by src/CMakeLists.txt #-------------------------------------------------------------------- -# Enforce GLFW when selecting GLSL -if (GLFW_INSTALL OR BUILD_GLSL_EXTENSIONS) +if (GLFW_INSTALL) install(DIRECTORY include/GLFW DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h) diff --git a/third-party/glfw/src/CMakeLists.txt b/third-party/glfw/src/CMakeLists.txt index 439c6b57c8..6bf4ff0d79 100644 --- a/third-party/glfw/src/CMakeLists.txt +++ b/third-party/glfw/src/CMakeLists.txt @@ -151,8 +151,7 @@ if (MSVC) target_compile_definitions(glfw PRIVATE _CRT_SECURE_NO_WARNINGS) endif() -# Enforce GLFW when selecting GLSL -if (GLFW_INSTALL OR BUILD_GLSL_EXTENSIONS) +if (GLFW_INSTALL) install(TARGETS glfw EXPORT glfwTargets RUNTIME DESTINATION "bin"