CPack: how to specify different versions of packages for components?

I have a CMake project for creating several shared libraries and tools, most of which are in subdirectories:

add_directory(libFirst)
add_directory(libSecond)
add_directory(myTool)
# etc...

Rules install(TARGET "someTarget" COMPONENT "someTarget" ...)are in the corresponding files subdirectory/CMakeLists.txt.

I would like to generate Debian packages for everyone using the command make packagefrom the build directory. I have CPACK_DEB_COMPONENT_INSTALLa value set ON.

The problem I am facing is that not all goals have the same VERSIONand / or SOVERSION. For example, it libFirstis in version 1.0.0.0, and libSecondversion 4.3.0.0. This means that the generated packages must also have a different version, but the only way to determine the version is to specify the variables CPACK_PACKAGE_VERSION_MAJOR, CPACK_PACKAGE_VERSION_MINORand CPACK_PACKAGE_VERSION_PATCH(and possibly an internal variable CPACK_PACKAGE_VERSION)) that set the version for all the generated packages.

Is there a way to set package versions for each component, for example by setting some variables similarly to other variables CPACK_COMPONENT_<COMPONENT>_*or CPACK_DEBIAN_<COMPONENT>_*?

+4
source share

Source: https://habr.com/ru/post/1680895/


All Articles