Skip to content

Commit

Permalink
feat: register a simple cpack deferred execution
Browse files Browse the repository at this point in the history
Signed-off-by: msclock <msclock@qq.com>
  • Loading branch information
msclock committed Sep 2, 2024
1 parent 3350cde commit 1016eb7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmake/ProjectDefault.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@ cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL show_project_version)
cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL
show_vcpkg_configuration)
cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL show_installation)

# Cpack
set(__cpack_cmake_module
${CMAKE_CURRENT_LIST_DIR}/install/Cpack.cmake
CACHE
INTERNAL
"Cpack module path to be included when directory CMAKE_SOURCE_DIR ends"
FORCE)
cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL include
${__cpack_cmake_module})
9 changes: 9 additions & 0 deletions cmake/install/Cpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@ set(CPACK_RESOURCE_FILE_LICENSE
set(CPACK_SOURCE_GENERATOR
"TGZ;ZIP"
CACHE STRING "Source generator")
set(CPACK_PACKAGE_VERSION
${CMAKE_PROJECT_VERSION_MAJOR}.${CMAKE_PROJECT_VERSION_MINOR}.${CMAKE_PROJECT_VERSION_PATCH}
)
if(CMAKE_PROJECT_VERSION_TWEAK)
set(CPACK_PACKAGE_VERSION
${CPACK_PACKAGE_VERSION}.${CMAKE_PROJECT_VERSION_TWEAK})
endif()
# cmake-format: off
set(CPACK_SOURCE_IGNORE_FILES
/.git
/dist
/.*build.*
/out
/\\\\.DS_Store
CACHE STRING "CPack source ignore files"
)
# cmake-format: on

Expand Down

0 comments on commit 1016eb7

Please sign in to comment.