How to change package destination folder in CPack?

I have a CMake project with several modules with root CMakeLists.txt with add_subdirectory macro macros.

As far as I understand, the default value for CPack / CMake is to create a package in the project root folder, where CMakeLists.txt is located. I would like to create a separate installation module with my own folder and create packages there? How to do it?

+5
source share
2 answers

Take a look at the variables CPACK_TOPLEVEL_TAGand CPACK_PACKAGE_FILE_NAMEin the documentation .

+2
source

To get the created packages in the "packages" subdirectory of your build directory, use:

SET(CPACK_OUTPUT_FILE_PREFIX packages)
+4

All Articles