September 2018
Intermediate to advanced
606 pages
14h 32m
English
We expect the configuration for each platform-native binary installer to be slightly different. These differences can be managed with CPack within a single CMakeCPack.cmake, as we have done in our example.
For GNU/Linux, the stanza configures both the DEB and RPM generators:
if(UNIX) if(CMAKE_SYSTEM_NAME MATCHES Linux) list(APPEND CPACK_GENERATOR "DEB") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "robertodr") set(CPACK_DEBIAN_PACKAGE_SECTION "devel") set(CPACK_DEBIAN_PACKAGE_DEPENDS "uuid-dev") list(APPEND CPACK_GENERATOR "RPM") set(CPACK_RPM_PACKAGE_RELEASE "1") set(CPACK_RPM_PACKAGE_LICENSE "MIT") set(CPACK_RPM_PACKAGE_REQUIRES "uuid-devel") endif()endif()
Our example depends on the UUID library, and the CPACK_DEBIAN_PACKAGE_DEPENDS ...
Read now
Unlock full access