cmake: fix exported include dir path

target_include_directories used GLFW_INSTALL_INCLUDE_DIR
which was undefined.
The correct variable is CMAKE_INSTALL_INCLUDEDIR which
is what the installer sections use.
This commit is contained in:
Tamas Kenez 2015-06-18 01:04:04 +02:00 committed by Zbigniew Mandziejewicz
parent 566108d35a
commit 6ed81bb33c
2 changed files with 3 additions and 2 deletions

View File

@ -477,6 +477,8 @@ endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Add subdirectories # Add subdirectories
#-------------------------------------------------------------------- #--------------------------------------------------------------------
include(GNUInstallDirs)
add_subdirectory(src) add_subdirectory(src)
if (GLFW_BUILD_EXAMPLES) if (GLFW_BUILD_EXAMPLES)
@ -495,7 +497,6 @@ endif()
# Create generated files # Create generated files
#-------------------------------------------------------------------- #--------------------------------------------------------------------
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
set(GLFW_INSTALL_CONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/glfw3") set(GLFW_INSTALL_CONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/glfw3")
set(GLFW_INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig") set(GLFW_INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig")

View File

@ -65,7 +65,7 @@ if (NOT CMAKE_VERSION VERSION_LESS "2.8.11")
# directories. TODO If/when cmake_minimum_required increases to # directories. TODO If/when cmake_minimum_required increases to
# >=2.8.11, call this command unconditionally. # >=2.8.11, call this command unconditionally.
target_include_directories(glfw PUBLIC target_include_directories(glfw PUBLIC
$<INSTALL_INTERFACE:${GLFW_INSTALL_INCLUDE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>) $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>)
endif() endif()