When you INCLUDE(CPack) in a CMakeLists.txt file, it adds a target named package to the generated build files. You can configure a lot of things about that generated target and how it operates, but I can’t seem to find a way to change the name of the target itself; i.e., instead of a generated Makefile containing a target named package, I’d like it to contain one named (for example) bundle instead. Is there any way to do this?
When you INCLUDE(CPack) in a CMakeLists.txt file, it adds a target named package to
Share
CMake only adds the default
packagetarget if a package config file namedCPackConfig.cmakeexists in the outermost binary build directory. By forcing the CPack module to generate the package file under a different name, you can prevent thepackagetarget from being created:You can manually add a
bundletarget then:This is also true for the default
package_sourcetarget. Use the variableCPACK_SOURCE_OUTPUT_CONFIG_FILEto override the default package configuration file nameCPackSourceConfig.cmake.