Split and update CPack configuration

This commit is contained in:
Aang23 2019-04-11 10:33:58 +02:00
parent d0bb961c2b
commit 1146cebc55
3 changed files with 24 additions and 17 deletions

View File

@ -7,11 +7,17 @@ project(EventBusDev)
option(ENABLE_TEST "Enable test" ON)
option(ENABLE_PERFORMANCE "Enable performance subproject" OFF)
option(ENABLE_CPACK "Enable CPack packaging" ON)
set(CMAKE_CXX_STANDARD 14)
add_subdirectory(lib/)
if(ENABLE_CPACK)
include("lib/cmake/EventBus_CPack.cmake")
enable_cpack("RPM;DEB;TGZ")
endif()
if(ENABLE_TEST)
enable_testing()
add_subdirectory(test/)

View File

@ -109,20 +109,3 @@ install(EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${config_install_dir}"
NAMESPACE "${namespace}"
)
# CPack Configuration
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_GENERATOR "RPM;DEB;TGZ")
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_RELEASE 1)
set(CPACK_PACKAGE_CONTACT "gelldur")
set(CPACK_PACKAGE_VENDOR "gelldur")
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
"${CMAKE_INSTALL_PREFIX}"
"${CMAKE_INSTALL_PREFIX}/include"
"${CMAKE_INSTALL_PREFIX}/lib64"
"${CMAKE_INSTALL_PREFIX}/lib"
)
include(CPack)

View File

@ -0,0 +1,18 @@
# CPack Configuration
function(enable_cpack generator)
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_GENERATOR ${generator})
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_RELEASE 1)
set(CPACK_PACKAGE_CONTACT "gelldur")
set(CPACK_PACKAGE_VENDOR "gelldur")
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
"${CMAKE_INSTALL_PREFIX}"
"${CMAKE_INSTALL_PREFIX}/include"
"${CMAKE_INSTALL_PREFIX}/lib64"
"${CMAKE_INSTALL_PREFIX}/lib"
)
include(CPack)
endfunction()