CPACK_INSTALL_CMAKE_PROJECTS ignores directory location when creating a Debian package.
This issue seems to be resolved for newer versions of CMake. It does not occur on CMake v3.10.2, but it does occur on v3.5.1.
While trying to use CPack to package an application into a Debian package I've had some issues controlling where the install components appear in the Debian package. According to the reference, CPACK_INSTALL_CMAKE_PROJECTS takes four arguments. The fourth argument is the directory where the given module gets installed.
In my example, I have two modules:
- MODULE_A should appear under /usr/local
- MODULE_B should appear under /etc
CMAKE_PACKAGING_INSTALL_PREFIX was set to "/" in order to override the default "/usr" value.
set(CPACK_INSTALL_CMAKE_PROJECTS
"build;MY_PROJECT;MY_MODULE_A;/usr/local"
"build;MY_PROJECT;MY_MODULE_B;/etc"
When I run CPack version 3.10.2 everything works just fine. The components end up at their expected locations.
On the other hand, CPack version 3.5.1 seems to completely ignore the directories passed to the function CPACK_INSTALL_CMAKE_PROJECTS.