-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: register a simple cpack deferred execution (#120)
Add a cpack module to be included when directory CMAKE_SOURCE_DIR ends. Signed-off-by: msclock <msclock@qq.com>
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#[[ | ||
Package generation using CPack | ||
|
||
References: | ||
- https://github.com/MangaD/cpp-project-template/blob/main/cmake/cpack_module.cmake | ||
- https://github.com/gabime/spdlog/blob/v1.x/cmake/spdlogCPack.cmake | ||
- https://github.com/retifrav/cmake-cpack-example/tree/master | ||
]] | ||
include_guard(GLOBAL) | ||
|
||
set(CPACK_RESOURCE_FILE_README | ||
"${CMAKE_CURRENT_SOURCE_DIR}/README.md" | ||
CACHE STRING "Readme") | ||
set(CPACK_RESOURCE_FILE_LICENSE | ||
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" | ||
CACHE STRING "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 | ||
|
||
include(CPack) |