Questions tagged [cpack]

CPack is a packing and install tool for CMake generated projects

CPack is develop by Kitware to generated a package (install file) from your CMake generated projects. It is, like CMake, multi platfom aware and used different generators for different platforms, e.g. NSIS for windows plattforms.

It is been shipped with your CMake installation.

The documents can be found here.

330 questions
9
votes
1 answer

CPack: How to specify different package versions for components?

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" ...)…
jotik
  • 17,044
  • 13
  • 58
  • 123
9
votes
2 answers

CMake CPack debian packages

Has someone worked with a working example of a CPack script for debian packages with Qt and OpenGL dependencies? I've set this one set (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libgcc1 (>= 1:3.4.2-12), libQtOpenGL (>=4.6.0), libQtCore…
linello
  • 8,451
  • 18
  • 63
  • 109
8
votes
0 answers

How to create a self-starting C++ systemd service with CPackDeb?

I'm new to Debian packaging and I believe this is a fairly basic question, but I am embarrassed to say I've struck out on Google. I have a C++ project which builds with CMake and packages a debian with CPack. This project has a service component…
Sean Kelly
  • 338
  • 1
  • 10
8
votes
1 answer

Creating a Brew Package using CPack

Been looking for this but cannot find an example or good doc. Does anyone have an example of how to create a brew package using cpack from cmake?
Matthew Hoggan
  • 7,402
  • 16
  • 75
  • 140
8
votes
1 answer

What does the CPack preinstall target do

I have a fairly complicated project that builds using CMake. The project uses CPack to generate .deb packages. When I just build the project with make (i.e. not building a .deb) a clean build takes roughly 2 minutes. However when I build a package…
shay
  • 755
  • 10
  • 22
8
votes
1 answer

CPack tries to build all targets

I have a CMake project composed of one root CMakeLists and multiple sub-CMakeLists (one for each project). I am trying to use CPack to generate a .deb file for one of these projects (APP_client). Yet, when I try to run CPack, it first runs a…
luigi_slz
  • 183
  • 1
  • 5
8
votes
1 answer

cpack generates RPMs with %files entries that conflict with the RPM spec. How to fix?

Recently, I need to ensure that our software can be packaged using cpack for RHEL 7 and its free rebuilds (e.g. CentOS 7). Nevertheless, I have been having an issue that didn't exist for RHEL 6.x and its free rebuilds: the RPMs that cpack generates…
user183394
  • 1,033
  • 1
  • 11
  • 20
8
votes
3 answers

How to generate .msi installer with cmake?

I am trying to generate .msi installer with cmake. I am able to generate .dll and .lib files with some configuration in CMakeLists.txt. Please provide an example CMakeLists.txt to generate an .msi installer. What are the commands that I need to use…
123r789
  • 1,600
  • 3
  • 22
  • 33
8
votes
1 answer

Copying files and including them in a CPack archive

So, there are numerous ways to copy files (and directories) at CMake runtime (file(COPY ...), configure_file(...) and add_custom_command() all work*), but I haven't yet found out how to make a file or directory copied from the source to build…
ChrisW
  • 4,970
  • 7
  • 55
  • 92
8
votes
0 answers

Using packagemaker with cpack for Mac OS X

I need to create installer for a product for Mac OS X using CPack with PackageMaker as the generator. I have done some small work, but I have many things that I want to find out. set(CPACK_PACKAGE_NAME "MyApp") set(CPACK_PACKAGE_VERSION…
nikolakoco
  • 1,343
  • 1
  • 12
  • 22
7
votes
2 answers

Rename the output of CPack

I would like to rename the installer file that CPack (v2.8.7) produces to include a version number that is obtained at build time from the version control system. It appears this cannot be be done by setting the CPACK_* variables because that…
glennr
  • 2,069
  • 2
  • 26
  • 37
7
votes
1 answer

Sign executable files on MacOS using CMake and PackageMaker CPack generator

I use CMake add_custom_command(TARGET POST_BUILD COMMAND codesign ...) for signing executable files on build. It works fine, but when CPack generates package it rewrites rpath on executable files and call strip command on them. This changes the…
7
votes
2 answers

How can I use CMake to install a script?

I have a project that builds several executables and also installs them. For the executables the relevant CMake code is: add_executable(foo "foo.cpp") add_executable(bar "bar.cpp;qux.cpp") install(TARGETS foo bar "/usr/bin") Then I create a .deb…
MatrixManAtYrService
  • 8,023
  • 1
  • 50
  • 61
7
votes
0 answers

How to run script after the CPack build step?

I'd like to run a script after the 'package' target. add_custom_command with POST_BUILD doesn't work. The make package command is expected to build, package and run the script. There should be no need for separate commands.
Velkan
  • 7,067
  • 6
  • 43
  • 87
7
votes
1 answer

Can CMake/CPack generate multiple NSIS installers for a single project?

I have a single project (with sub-projects) for which I would like to generate multiple NSIS installer executables, instead of having multiple components listed in a single NSIS installer. Is this possible? Or do I need to organize my code into…
KyleL
  • 1,379
  • 2
  • 13
  • 35
1
2
3
21 22