From a89f9680ec33e872ebb26504fed9126bc9c131b2 Mon Sep 17 00:00:00 2001 From: Zbigniew Mandziejewicz Date: Mon, 6 Apr 2015 21:32:38 +0800 Subject: [PATCH] Fix CMake exports in build directory --- CMakeLists.txt | 4 ++++ src/CMakeLists.txt | 4 +++- src/glfw3Config.cmake.in | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc45be03e..5bd1d3124 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -534,6 +534,10 @@ if (GLFW_INSTALL) "${GLFW_BINARY_DIR}/src/glfw3ConfigVersion.cmake" DESTINATION ${GLFW_INSTALL_CONFIG_DIR}) + export( + EXPORT glfwTargets + FILE ${CMAKE_CURRENT_BINARY_DIR}/src/glfw3Targets.cmake) + install(EXPORT glfwTargets FILE glfw3Targets.cmake DESTINATION ${GLFW_INSTALL_CONFIG_DIR}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 86229b464..f2061a5c4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -64,7 +64,9 @@ if (NOT CMAKE_VERSION VERSION_LESS "2.8.11") # include and/or export public, private, and interface include # directories. TODO If/when cmake_minimum_required increases to # >=2.8.11, call this command unconditionally. - target_include_directories(glfw PUBLIC $) + target_include_directories(glfw PUBLIC + $ + $) endif() set_target_properties(glfw PROPERTIES diff --git a/src/glfw3Config.cmake.in b/src/glfw3Config.cmake.in index 36a8c14e4..420a3feae 100644 --- a/src/glfw3Config.cmake.in +++ b/src/glfw3Config.cmake.in @@ -11,5 +11,5 @@ set(GLFW3_VERSION "@GLFW_VERSION_FULL@") set_and_check(GLFW3_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/@GLFW_INSTALL_INCLUDE_DIR@") set_and_check(GLFW3_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/@GLFW_INSTALL_INCLUDE_DIR@") -include("@PACKAGE_CMAKE_INSTALL_PREFIX@/@GLFW_INSTALL_CONFIG_DIR@/glfw3Targets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake") set(GLFW3_LIBRARY glfw)