Skip to content

Commit

Permalink
packaging capability added.
Browse files Browse the repository at this point in the history
fix `find_package(Format.cmake xy.z.w)` version determination
  • Loading branch information
Arniiiii committed Jan 26, 2025
1 parent 969284a commit ea6d723
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build*
build*
Format.cmakeConfigVersion.cmake
35 changes: 35 additions & 0 deletions packaging/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cmake_minimum_required(VERSION 3.14)

set(Format.cmake_VERSION 1.8.3)

include(GNUInstallDirs)

set(CMAKEDIR
${CMAKE_INSTALL_DATADIR}/cmake/Format.cmake/
CACHE
PATH
"Path to a folder to which install the script Format.cmake . By default: ${CMAKE_INSTALL_DATADIR}/cmake/Format.cmake/"
)

include(CMakePackageConfigHelpers)

include(GNUInstallDirs)

write_basic_package_version_file(${CMAKE_CURRENT_LIST_DIR}/../Format.cmakeConfigVersion.cmake VERSION ${Format.cmake_VERSION} COMPATIBILITY AnyNewerVersion ARCH_INDEPENDENT)

install(FILES "${CMAKE_CURRENT_LIST_DIR}/../CMakeLists.txt"
DESTINATION "${CMAKEDIR}" RENAME "Format.cmakeConfig.cmake"
)

install(FILES "${CMAKE_CURRENT_LIST_DIR}/../Format.cmakeConfigVersion.cmake"
DESTINATION "${CMAKEDIR}"
)
install(FILES "${CMAKE_CURRENT_LIST_DIR}/../cmake-format.cmake"
DESTINATION "${CMAKEDIR}"
)

install(FILES "${CMAKE_CURRENT_LIST_DIR}/../git-clang-format.py"
DESTINATION "${CMAKEDIR}"
)

message(STATUS "Use `find_package(Format.cmake)` to use it")

0 comments on commit ea6d723

Please sign in to comment.