Fix CMake exports in build directory

This commit is contained in:
Zbigniew Mandziejewicz 2015-04-06 21:32:38 +08:00
parent f63d50977f
commit a89f9680ec
3 changed files with 8 additions and 2 deletions

View File

@ -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})

View File

@ -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 $<INSTALL_INTERFACE:${GLFW_INSTALL_INCLUDE_DIR}>)
target_include_directories(glfw PUBLIC
$<INSTALL_INTERFACE:${GLFW_INSTALL_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>)
endif()
set_target_properties(glfw PROPERTIES

View File

@ -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)