Write ghc_filesystem-config-version.cmake file

CMakeLists.txt:
Write a ghc_filesystem-config-version.cmake file and install it, so that
other projects may rely on the exact version of ghc_filesystem.
The compatibility mode implies, that any version of ghc_filesystem with
the same major version is feature compatible.
This commit is contained in:
David Runge 2022-06-10 15:44:04 +02:00
parent 089ef64aa3
commit 4c33b91fe9
No known key found for this signature in database
GPG Key ID: BB992F9864FAD168

View File

@ -73,7 +73,16 @@ if(GHC_FILESYSTEM_WITH_INSTALL)
"${PROJECT_BINARY_DIR}/cmake/ghc_filesystem-config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ghc_filesystem"
PATH_VARS CMAKE_INSTALL_INCLUDEDIR)
install(FILES "${PROJECT_BINARY_DIR}/cmake/ghc_filesystem-config.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ghc_filesystem")
write_basic_package_version_file(
"${PROJECT_BINARY_DIR}/cmake/ghc_filesystem-config-version.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
install(
FILES
"${PROJECT_BINARY_DIR}/cmake/ghc_filesystem-config.cmake"
"${PROJECT_BINARY_DIR}/cmake/ghc_filesystem-config-version.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ghc_filesystem"
)
add_library(ghcFilesystem::ghc_filesystem ALIAS ghc_filesystem)
endif()