From d071c27e520d6008d6ede768c76fe62b35dcd11f Mon Sep 17 00:00:00 2001 From: Jim Radford Date: Tue, 21 May 2019 21:36:49 -0700 Subject: [PATCH 1/2] Avoid modifying the glfw distribution just override a variable --- CMakeLists.txt | 2 +- third-party/glfw/CMakeLists.txt | 3 +-- third-party/glfw/src/CMakeLists.txt | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2da00e0e1e..18ba0bf567 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,7 @@ 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) 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" From a54832ab557ff49b24e5840af9e44206a3b655ef Mon Sep 17 00:00:00 2001 From: Jim Radford Date: Tue, 21 May 2019 21:45:36 -0700 Subject: [PATCH 2/2] Move install_config up so that src/gl can go in a more natural place --- CMakeLists.txt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18ba0bf567..46c4306d54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,8 @@ 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) @@ -58,7 +60,7 @@ if (BUILD_EXAMPLES AND BUILD_GLSL_EXTENSIONS) 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() -