-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 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,50 @@ | ||
# Setup for packaging via cpack | ||
# Based on https://decovar.dev/blog/2021/09/23/cmake-cpack-package-deb-apt/ | ||
|
||
set(CPACK_VERBATIM_VARIABLES ON) | ||
|
||
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "") | ||
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/packages" CACHE STRING "") | ||
|
||
|
||
# metadata | ||
set(CPACK_PACKAGE_NAME "mtkahypar" CACHE STRING "") | ||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_DESCRIPTION} CACHE STRING "") | ||
# set(CPACK_PACKAGE_VENDOR "") | ||
|
||
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) | ||
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) | ||
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) | ||
|
||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") | ||
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") | ||
|
||
set(CPACK_PACKAGE_CONTACT "[email protected]") | ||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Nikolai Maas <${CPACK_PACKAGE_CONTACT}>") | ||
|
||
|
||
# installation options | ||
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) | ||
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE) | ||
set(CPACK_DEB_COMPONENT_INSTALL ON) | ||
set(CPACK_STRIP_FILES ON) | ||
set( | ||
CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS | ||
OWNER_READ OWNER_WRITE OWNER_EXECUTE | ||
GROUP_READ GROUP_EXECUTE | ||
WORLD_READ WORLD_EXECUTE | ||
) | ||
|
||
# determine debian dependencies automatically | ||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON) | ||
|
||
|
||
include(CPack) | ||
message(STATUS "Package components: ${CPACK_COMPONENTS_ALL}") | ||
|
||
# custom command for actually building the package | ||
find_program(CPACK_COMMAND cpack REQUIRED) | ||
add_custom_target(package-mtkahypar-deb | ||
${CPACK_COMMAND} -G=DEB | ||
DEPENDS MtKaHyPar-CLI mtkahypar) |