Name and description of multiple debian packages with CMake and CPack

久未见 提交于 2019-12-05 16:01:33

From last few days I am searching for such solution. Let me first explain first my requirement and then how did i managed to solve problem.

I want to create 4 package from my single project

  1. Master package: Which contains all binary,static/shared libraries,header files,configuration files and scripts.
  2. Runtime package: Which contains only executable which are required to run my application i.e. binary ,shared library and scripts.
  3. Configuration package: Which contains basic skeleton and place holder for configuration file.
  4. Development packages: Which contains shared/static library and header files.

Generating Master package is easy one and straight forward. But If I use that way then I am unable to use other packages. So after struggling and scraping documents and mail archives, I came to one solution or workaround.

In my solution I am creating One extra custom target for each package I want to create. On that target I am creating other cmake project, which has list of files(Absolute location of file) to be install in that package, build that project and last create package by calling cpack.

Here is my solution.

There may be better/scale-able solution than this, If any one come across that please let me know.

I'm a bit late to the party but in CMake before version 3.5 components packaging was not supported for CPack debian packages.

From version 3.5 on quite a few per component features were added so the easiest way to solve you problem would be to bump the version of CMake and set the variables described in the documentation:

https://cmake.org/cmake/help/v3.5/module/CPackDeb.html or a newer one https://cmake.org/cmake/help/v3.9/module/CPackDeb.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!