diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a74c93..c98217d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ add_library(sago::platform_folders ALIAS platform_folders) include(GNUInstallDirs) # Where to search for the header while building target_include_directories(platform_folders PUBLIC - $ + $ # Controls where #include starts to look from # So /usr/include/ # or C:\Program Files\platform_folders\include\ @@ -69,7 +69,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") ) endif() # Controls where the exports, config, and configversion files install to - set(_PROJECT_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_PREFIX}/cmake") + # Use a relative path so it works correctly with FetchContent and + # respects CMAKE_INSTALL_PREFIX at install time + set(_PROJECT_INSTALL_CMAKE_DIR "cmake") else() # When calling find_package() # it looks for /usr/lib/cmake//Config.cmake