Update and fix CPack

This commit is contained in:
Aang23 2019-04-12 13:13:56 +02:00
parent 1146cebc55
commit afc8cea23c
3 changed files with 8 additions and 7 deletions

View File

@ -8,16 +8,12 @@ project(EventBusDev)
option(ENABLE_TEST "Enable test" ON) option(ENABLE_TEST "Enable test" ON)
option(ENABLE_PERFORMANCE "Enable performance subproject" OFF) option(ENABLE_PERFORMANCE "Enable performance subproject" OFF)
option(ENABLE_CPACK "Enable CPack packaging" ON) option(ENABLE_CPACK "Enable CPack packaging" ON)
set(CPACK_GENERATOR "" CACHE STRING "Set packages CPack should build")
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
add_subdirectory(lib/) add_subdirectory(lib/)
if(ENABLE_CPACK)
include("lib/cmake/EventBus_CPack.cmake")
enable_cpack("RPM;DEB;TGZ")
endif()
if(ENABLE_TEST) if(ENABLE_TEST)
enable_testing() enable_testing()
add_subdirectory(test/) add_subdirectory(test/)

View File

@ -109,3 +109,9 @@ install(EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${config_install_dir}" DESTINATION "${config_install_dir}"
NAMESPACE "${namespace}" NAMESPACE "${namespace}"
) )
# Cpack configuration
if(ENABLE_CPACK)
include("cmake/EventBus_CPack.cmake")
enable_cpack()
endif()

View File

@ -1,7 +1,6 @@
# CPack Configuration # CPack Configuration
function(enable_cpack generator) function(enable_cpack)
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_GENERATOR ${generator})
set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_RELEASE 1) set(CPACK_PACKAGE_RELEASE 1)
set(CPACK_PACKAGE_CONTACT "gelldur") set(CPACK_PACKAGE_CONTACT "gelldur")