How to change package destination folder in CPack?

試著忘記壹切 提交于 2019-12-06 02:03:46

问题


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?


回答1:


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




回答2:


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

SET(CPACK_OUTPUT_FILE_PREFIX packages)


来源:https://stackoverflow.com/questions/3219128/how-to-change-package-destination-folder-in-cpack

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