I have a CMake project to build multiple shared libraries and tools, most of these under subdirectories:
add_directory(libFirst)
add_directory(libSecond)
add_directory(myTool)
# etc...
The install(TARGET "someTarget" COMPONENT "someTarget" ...)
rules are in the respective subdirectory/CMakeLists.txt
files.
I would like to generate Debian packages for all of these using a make package
command from the build directory. I have CPACK_DEB_COMPONENT_INSTALL
set to ON
.
The problem I'm facing, is that not all of the targets have the same VERSION
and/or SOVERSION
. For example, libFirst
is at version 1.0.0.0 and libSecond
is version 4.3.0.0. This means that the generated packages should also have different version, but the only way I've found to specify the version is to specify the CPACK_PACKAGE_VERSION_MAJOR
, CPACK_PACKAGE_VERSION_MINOR
and CPACK_PACKAGE_VERSION_PATCH
variables (and perhaps the internal CPACK_PACKAGE_VERSION
variable), which set the version for all generated packages.
Is there a way to set package versions per-component, for example by setting some variables similarly to the other CPACK_COMPONENT_<COMPONENT>_*
or CPACK_DEBIAN_<COMPONENT>_*
variables?