vcpkg/ports/immer/fix-ExportConfigVersion.patch
Lily Wang 608e7ff107
[immer] Add export CMake ConfigVersion file (#28873)
* [immer] Add export CMake ConfigVersion file

* update version

* add comment for patch

* x-add-version

* add quote

* update version
2023-01-17 11:41:49 -08:00

20 lines
788 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a8cfbd3..84c89a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -96,6 +96,14 @@ target_include_directories(immer INTERFACE
$<BUILD_INTERFACE:${immer_SOURCE_DIR}/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
install(TARGETS immer EXPORT ImmerConfig)
+
+include(CMakePackageConfigHelpers)
+write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/ImmerConfigVersion.cmake"
+ VERSION ${PROJECT_VERSION}
+ COMPATIBILITY SameMajorVersion )
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ImmerConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Immer" )
install(EXPORT ImmerConfig DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Immer")
install(DIRECTORY immer DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")