Skip to content

Commit 30db50c

Browse files
committed
fix find_package(Format.cmake xy.z.w) version determination
1 parent 131f27e commit 30db50c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
build*
1+
build*
2+
Format.cmakeConfigVersion.cmake

packaging/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
3+
set(Format.cmake_VERSION 1.8.3)
4+
15
include(GNUInstallDirs)
26

37
set(CMAKEDIR
@@ -7,10 +11,19 @@ set(CMAKEDIR
711
"Path to a folder to which install the script Format.cmake . By default: ${CMAKE_INSTALL_DATADIR}/cmake/Format.cmake/"
812
)
913

14+
include(CMakePackageConfigHelpers)
15+
16+
include(GNUInstallDirs)
17+
18+
write_basic_package_version_file(${CMAKE_CURRENT_LIST_DIR}/../Format.cmakeConfigVersion.cmake VERSION ${Format.cmake_VERSION} COMPATIBILITY AnyNewerVersion ARCH_INDEPENDENT)
19+
1020
install(FILES "${CMAKE_CURRENT_LIST_DIR}/../CMakeLists.txt"
1121
DESTINATION "${CMAKEDIR}" RENAME "Format.cmakeConfig.cmake"
1222
)
1323

24+
install(FILES "${CMAKE_CURRENT_LIST_DIR}/../Format.cmakeConfigVersion.cmake"
25+
DESTINATION "${CMAKEDIR}"
26+
)
1427
install(FILES "${CMAKE_CURRENT_LIST_DIR}/../cmake-format.cmake"
1528
DESTINATION "${CMAKEDIR}"
1629
)

0 commit comments

Comments
 (0)