I have several CMake projects, each of which creates a debian package. I am trying to create a top-level project that calls add_subdirectory () for each child project. All child projects are under construction, but the "make project" creates a project with the latest specifications for child projects and includes files from all other projects.
In principle, each set (CPACK _...) is overwritten by the next project until the last one and calls to 'install ()' are accumulated. How can I separate package creation when using a top-level project?
Edit : fragment added. All "children's" projects are similar.
# build a CPack driven installer package
if(CMAKE_BUILD_TYPE STREQUAL "release")
set(CPACK_STRIP_FILES TRUE)
endif()
set(CPACK_GENERATOR DEB)
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_VENDOR Acme)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "acme <support@acme.com>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Acme daemon")
message(STATUS "CPACK_PACKAGE_DESCRIPTION_SUMMARY: " ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(SYSTEM_PROCESSOR amd64)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm")
set(SYSTEM_PROCESSOR armhf)
else()
message(FATAL_ERROR "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR})
endif()
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${SYSTEM_PROCESSOR})
message(STATUS "CPACK_DEBIAN_PACKAGE_ARCHITECTURE: " ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VERSION_MAJOR ${${PROJECT_NAME}_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${${PROJECT_NAME}_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${${PROJECT_NAME}_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${SYSTEM_PROCESSOR})
message(STATUS "CPACK_PACKAGE_FILE_NAME: " ${CPACK_PACKAGE_FILE_NAME})
set(CPACK_DEBIAN_PACKAGE_PRIORITY optional)
include(CPack)