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)