Commit 6c08fe2d authored by Dominik Charousset's avatar Dominik Charousset

Add scaffold for binary packaging via CPack

parent f06f38c6
...@@ -21,11 +21,12 @@ option(THREADS_PREFER_PTHREAD_FLAG "Prefer -pthread flag if available " ON) ...@@ -21,11 +21,12 @@ option(THREADS_PREFER_PTHREAD_FLAG "Prefer -pthread flag if available " ON)
# -- CAF options that are off by default --------------------------------------- # -- CAF options that are off by default ---------------------------------------
option(CAF_ENABLE_ACTOR_PROFILER "Enable experimental profiler API" OFF)
option(CAF_ENABLE_CPACK "Enable packaging via CPack" OFF)
option(CAF_ENABLE_CURL_EXAMPLES "Build examples with libcurl" OFF) option(CAF_ENABLE_CURL_EXAMPLES "Build examples with libcurl" OFF)
option(CAF_ENABLE_PROTOBUF_EXAMPLES "Build examples with Google Protobuf" OFF) option(CAF_ENABLE_PROTOBUF_EXAMPLES "Build examples with Google Protobuf" OFF)
option(CAF_ENABLE_QT6_EXAMPLES "Build examples with the Qt6 framework" OFF) option(CAF_ENABLE_QT6_EXAMPLES "Build examples with the Qt6 framework" OFF)
option(CAF_ENABLE_RUNTIME_CHECKS "Build CAF with extra runtime assertions" OFF) option(CAF_ENABLE_RUNTIME_CHECKS "Build CAF with extra runtime assertions" OFF)
option(CAF_ENABLE_ACTOR_PROFILER "Enable experimental profiler API" OFF)
# -- CAF options that are on by default ---------------------------------------- # -- CAF options that are on by default ----------------------------------------
...@@ -455,3 +456,25 @@ if(CAF_BUILD_INFO_FILE_PATH) ...@@ -455,3 +456,25 @@ if(CAF_BUILD_INFO_FILE_PATH)
"${CAF_BUILD_INFO_FILE_PATH}" "${CAF_BUILD_INFO_FILE_PATH}"
@ONLY) @ONLY)
endif() endif()
# -- CPack setup ---------------------------------------------------------------
if(CAF_ENABLE_CPACK)
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_NAME "CAF")
set(CPACK_PACKAGE_VENDOR "CAF Community")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_VERSION_MAJOR "${CAF_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${CAF_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${CAF_VERSION_PATCH}")
set(CPACK_PACKAGE_DESCRIPTION
"To learn more about CAF, please visit https://www.actor-framework.org.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"CAF offers high-level building blocks for concurrency & distribution.")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.actor-framework.org")
set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/doc/png/logo-1000x1000.png")
if(NOT CPACK_SOURCE_GENERATOR)
set(CPACK_SOURCE_GENERATOR "TGZ")
endif()
include(CPack)
endif()
...@@ -21,6 +21,7 @@ General CMake options: ...@@ -21,6 +21,7 @@ General CMake options:
--generator=STRING set CMake generator (see cmake --help) --generator=STRING set CMake generator (see cmake --help)
--cxx-flags=STRING set CMAKE_CXX_FLAGS when running CMake --cxx-flags=STRING set CMAKE_CXX_FLAGS when running CMake
--prefix=PATH set installation directory --prefix=PATH set installation directory
--debug-postfix set CMAKE_DEBUG_POSTFIX
Locating packages in non-standard locations: Locating packages in non-standard locations:
...@@ -50,6 +51,7 @@ Convenience options: ...@@ -50,6 +51,7 @@ Convenience options:
Flags (use --enable-<name> to activate and --disable-<name> to deactivate): Flags (use --enable-<name> to activate and --disable-<name> to deactivate):
cpack build with CPack package description [OFF]
shared-libs build shared library targets [ON] shared-libs build shared library targets [ON]
export-compile-commands write JSON compile commands database [ON] export-compile-commands write JSON compile commands database [ON]
prefer-pthread-flag prefer -pthread flag if available [ON] prefer-pthread-flag prefer -pthread flag if available [ON]
...@@ -96,6 +98,7 @@ append_cache_entry() { ...@@ -96,6 +98,7 @@ append_cache_entry() {
set_build_flag() { set_build_flag() {
FlagName='' FlagName=''
case "$1" in case "$1" in
cpack) FlagName='CAF_ENABLE_CPACK' ;;
shared-libs) FlagName='BUILD_SHARED_LIBS' ;; shared-libs) FlagName='BUILD_SHARED_LIBS' ;;
export-compile-commands) FlagName='CMAKE_EXPORT_COMPILE_COMMANDS' ;; export-compile-commands) FlagName='CMAKE_EXPORT_COMPILE_COMMANDS' ;;
prefer-pthread-flag) FlagName='THREADS_PREFER_PTHREAD_FLAG' ;; prefer-pthread-flag) FlagName='THREADS_PREFER_PTHREAD_FLAG' ;;
...@@ -181,6 +184,9 @@ while [ $# -ne 0 ]; do ...@@ -181,6 +184,9 @@ while [ $# -ne 0 ]; do
--openssl-root-dir=*) --openssl-root-dir=*)
append_cache_entry OPENSSL_ROOT_DIR PATH "$optarg" append_cache_entry OPENSSL_ROOT_DIR PATH "$optarg"
;; ;;
--debug-postfix=*)
append_cache_entry CMAKE_DEBUG_POSTFIX STRING "$optarg"
;;
*) *)
echo "Invalid option '$1'. Try $0 --help to see available options." echo "Invalid option '$1'. Try $0 --help to see available options."
exit 1 exit 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment