In recent days, I have been looking for such a solution. Let me first explain my requirement first, and then how I managed to solve the problem.
I want to create 4 packages from my one project
- Main package : contains all binary, static / shared libraries, header files, configuration files and scripts.
- Runtime package : contains only the executable file that is required to run my application, i.e. binary, shared library and scripts.
- Configuration package : contains the main skeleton and space holder for the configuration file.
- Development Packs : Contains shared / static libraries and header files.
Creating a Master package is easy and straightforward. But if I use this path, then I can not use other packages. Therefore, after the struggle and cleaning of documents and mail archives, I came to one solution or a workaround.
In my solution, I create one additional custom target for each package that I want to create. For this purpose, I create another cmake project in which there is a list of files (Absolute file location) that need to be installed in this package, create this project and last create the package by calling cpack.
Here is my solution.
There may be a better / scalable solution than this. If anyone meets this, let me know.
source share