How to change package destination folder in CPack?

2019-05-02 06:10发布

I have a multiple module CMake project with a root CMakeLists.txt with multipe add_subdirectory macros.

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

2条回答
一纸荒年 Trace。
2楼-- · 2019-05-02 06:22

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

SET(CPACK_OUTPUT_FILE_PREFIX packages)
查看更多
放我归山
3楼-- · 2019-05-02 06:32

Take a look at the CPACK_TOPLEVEL_TAG and the CPACK_PACKAGE_FILE_NAME variables in the documentation.

查看更多
登录 后发表回答