diff --git a/CMakeLists.txt b/CMakeLists.txt index b6315c2..519db44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") target_link_libraries(platform_folders PRIVATE "${_CoreServices_FRAMEWORK}") endif() +# Cmake's find_package search path is different based on the system +# See https://cmake.org/cmake/help/latest/command/find_package.html for the list if(CMAKE_SYSTEM_NAME STREQUAL "Windows") # You can pass these when calling Cmake, so don't override if the user does if(NOT _WIN32_WINNT AND NOT WINVER) @@ -66,12 +68,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") WINVER=0x0601 ) endif() -endif() - - -# Cmake's find_package search path is different based on the system -# See https://cmake.org/cmake/help/latest/command/find_package.html for the list -if(CMAKE_SYSTEM_NAME STREQUAL "Windows") # Controls where the exports, config, and configversion files install to set(_PROJECT_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_PREFIX}/cmake") else() @@ -83,7 +79,7 @@ endif() # Gives "Make install" esque operations a location to install to... # and creates a .cmake file to be exported install(TARGETS platform_folders - EXPORT "platform_folders-targets" + EXPORT "platform_foldersConfig" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" # Tells it where to put the header files @@ -92,7 +88,7 @@ install(TARGETS platform_folders # "The install(TARGETS) and install(EXPORT) commands work together to install a target and a file to help import it" # Installs a cmake file which external projects can import. -install(EXPORT "platform_folders-targets" +install(EXPORT "platform_foldersConfig" NAMESPACE sago:: DESTINATION "${_PROJECT_INSTALL_CMAKE_DIR}" ) @@ -107,12 +103,6 @@ export(TARGETS platform_folders # For the config and configversion macros include(CMakePackageConfigHelpers) -configure_package_config_file("platform_foldersConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/platform_foldersConfig.cmake" - # Tells the config file where it will be installed, so it can be correctly imported - INSTALL_DESTINATION "${_PROJECT_INSTALL_CMAKE_DIR}" -) - # Creates the project's ConfigVersion.cmake file # This allows for find_package() to use a version in the call write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/platform_foldersConfigVersion.cmake" @@ -124,7 +114,6 @@ write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/platform_foldersCo # Install the ConfigVersion file, which is located in the build dir install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/platform_foldersConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/platform_foldersConfigVersion.cmake" DESTINATION "${_PROJECT_INSTALL_CMAKE_DIR}" ) diff --git a/platform_foldersConfig.cmake.in b/platform_foldersConfig.cmake.in deleted file mode 100644 index f4a7964..0000000 --- a/platform_foldersConfig.cmake.in +++ /dev/null @@ -1,3 +0,0 @@ -@PACKAGE_INIT@ - -include("${CMAKE_CURRENT_LIST_DIR}/platform_folders-targets.cmake")