If change the include path destination when run cmake configure with DCMAKE_INSTALL_INCLUDEDIR, the .cmake generated still point to hardcoded path include. this fix it (#178)

This commit is contained in:
Gustavo Alvarez 2021-10-19 00:14:52 +02:00 committed by GitHub
parent 03162a6f8b
commit 1fc6fc181c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,13 +6,15 @@ project(OpenCLHeaders
# https://stackoverflow.com/questions/43379311/why-does-project-affect-cmakes-opinion-on-cmake-sizeof-void-p
)
include(GNUInstallDirs)
add_library(Headers INTERFACE)
target_include_directories(Headers
SYSTEM
BEFORE
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
install(
@ -20,8 +22,6 @@ install(
EXPORT OpenCLHeadersTargets
)
include(GNUInstallDirs)
install(
DIRECTORY CL
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}