diff --git a/cmake/InstallRules.cmake b/cmake/InstallRules.cmake index b245a22a5..b8c683c91 100644 --- a/cmake/InstallRules.cmake +++ b/cmake/InstallRules.cmake @@ -3,14 +3,14 @@ include(CMakePackageConfigHelpers) # copy header files to CMAKE_INSTALL_INCLUDEDIR install( DIRECTORY - "${PROJECT_SOURCE_DIR}/include" # our header files - "${PROJECT_BINARY_DIR}/include" # generated header files + "${PROJECT_SOURCE_DIR}/include/" # our header files + "${PROJECT_BINARY_DIR}/include/" # generated header files DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" COMPONENT ${package_name}-development ) # copy target build output artifacts to OS dependent locations -# (except includes) +# (except includes, that just sets a compiler flag with the path) install( TARGETS ${target_name} EXPORT ${package_name}-targets diff --git a/cmake/OptionVariables.cmake b/cmake/OptionVariables.cmake index 2e95642d1..a7480567a 100644 --- a/cmake/OptionVariables.cmake +++ b/cmake/OptionVariables.cmake @@ -1,4 +1,5 @@ -include(GNUInstallDirs) +# included further down to avoid interfering with our cache variables +# include(GNUInstallDirs) # ---- Options Summary ---- @@ -93,6 +94,11 @@ if(PROJECT_IS_TOP_LEVEL) endif() +# do not include earlier or we can't set CMAKE_INSTALL_INCLUDEDIR above +# required for CMAKE_INSTALL_LIBDIR below +include(GNUInstallDirs) + + # ---- Install CMake Directory ---- # This allows package maintainers to freely override the installation path for