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
3
votes
3 answers

CMake - how to block executing installation scripts during packaging?

My CMakeLists.txt file contains commands, which should be executed by make install, and all this works fine. The sample CMakeLists.txt below is a short excerpt from my actual CMake file (the tm0001.cpp content is not important here - it might be any…
HEKTO
  • 3,876
  • 2
  • 24
  • 45
3
votes
1 answer

cpack and install(CODE ...) - CPACK_PACKAGING_INSTALL_PREFIX vs CMAKE_INSTALL_PREFIX

as a "post-install hook" I need to execute an install command like install(CODE "execute_process(COMMAND some_command ${CMAKE_INSTALL_PREFIX}/some_folder")) which creates a file in some_folder based on the files which were previously installed into…
Patrick Storz
  • 425
  • 4
  • 14
3
votes
0 answers

CPack and INSTALL(SCRIPT...)

I would like to use INSTALL(SCRIPT custom-script.cmake) during the package generation with CPack to apply some transformations on the files previously installed with INSTALL(FILE...). The problem is that the script should somehow know the…
user3159253
  • 16,836
  • 3
  • 30
  • 56
3
votes
1 answer

CPack: only pack files tracked by git

I'm trying to understand how to use CPack. I want to produce a binary and a source package. The binary one is perfectly fine, including only what's necessary. In the source distribution, though, there are basically all files present in the project's…
mattmilten
  • 6,242
  • 3
  • 35
  • 65
3
votes
1 answer

How add registry keys with CPACK_PACKAGE_INSTALL_REGISTRY_KEY?

I need to install some registry key for a NSIS installer. I'm working with CPACK and I found this command CPACK_PACKAGE_INSTALL_REGISTRY_KEY. There is not much doc on the Internet but I guess : set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "MyReg\\\\MyKey"…
sovif
  • 43
  • 1
  • 8
3
votes
1 answer

Generating source package with CPack on Windows

On OS X and Linux, I successfully used CMake/CPack to generate source package with make package_source. However, on Windows, I couldn't find a equivalent target after generating the Visual Studio project files ("Visual Studio 12 2013" to be…
Andy Li
  • 5,894
  • 6
  • 37
  • 47
3
votes
0 answers

How to check if CMake install script is being run by CPack?

I want to detect if my install(SCRIPT script.cmake) is running under CPack (make package) or just regular make install. I have tried using: if(DEFINED CPACK_OUTPUT_CONFIG_FILE) if(DEFINED CPACK_PROJECT_CONFIG_FILE) if(DEFINED CPACK_GENERATOR)
Nazar554
  • 4,105
  • 3
  • 27
  • 38
3
votes
1 answer

CPack multiple packages with own dependencies

I have a problem creating two debian packages with CPack and CMake. I've done the example from here and I did manage to create two different debian packages, but I want each of them have their own dependencies. The resultant CMakeLists.txt is the…
Fran
  • 61
  • 1
  • 6
3
votes
1 answer

CPack / CMake: Different installation prefixes per CPACK_GENERATOR

How can I specify different installation prefixes for the different CPACK_GENERATORs? For example: the DEB package should be installed to /opt/project the TGZ archive should consist only of the project directory From the documentation I understood…
dubbaluga
  • 2,223
  • 5
  • 29
  • 38
3
votes
1 answer

cpack preinstall output log

im using cpack (CMake 3.0.2) for building RPMs from my sources. I have errors while building preinstall target, it says: CPack Error: Problem running install command: "/usr/bin/gmake" "preinstall" Please check…
3
votes
0 answers

How to create a NSIS installer with CPack without CMake

I would like to install several softwares at the same location. These softwares are binaries and include files which are not managed by CMake. My idea is to use CPack and NSIS generator but without CMake in order to just install the software at a…
oaimac
  • 784
  • 2
  • 12
  • 27
3
votes
1 answer

Is it possible to use Inno Setup with cmake/cpack?

I'm porting some of our projects at work over to cmake/cpack, and while our current stuff is using Inno Setup, there does not appear to be a built-in CPack generator for Inno Setup. It seems to be either zip files or NSIS. Are there any CPack…
Jonathan M Davis
  • 37,181
  • 17
  • 72
  • 102
3
votes
2 answers

How to find out MINIMUM requirements when making a .deb package?

I'm currently trying to package a software that uses CMake to a .deb package. I've managed to modify the CMakeLists.txt to use CPack and create a .deb file. But one thing that I have not managed to find out even with extensive googling is how do I…
Dago
  • 1,349
  • 1
  • 11
  • 19
2
votes
2 answers

CMake rpm installing a file in /etc/init.d

I want to install a file in /etc/init.d directory I have written code INSTALL(FILES ${CMAKE_SOURCE_DIR}/app/script/appd DESTINATION /etc/init.d/appd) but when I run packing code using cmake I get error CMake Error at…
Vivek Goel
  • 22,942
  • 29
  • 114
  • 186
2
votes
0 answers

How to introduce a code patch into Wix directories.wxs file using cMake

I am using cMake with Wix to generate my installer executable. I have my executable ready, but I am unable to get a shortcut on the desktop and include my program in the Windows Start menu. To achieve these two goals, I want to inject some code into…
dbz
  • 411
  • 7
  • 22