[CMake] CPack: Create debian packge for each sub-project

DKLind davidklind at gmail.com
Mon Jul 24 10:30:40 EDT 2017


Here's a little trick I learned. Executing the custom target, "make
package_target target=xyz", will build the target and call cpack to create
the package. Additional parameters can be passed by putting the target value
in quotes (make package_target target="xyz -j4").

Executing cpack causes the target to be built. But, if you want to see the
output of make, before cpack, "COMMAND make ${PARAMS}" will do that.

    set(PARAMS
        "$(if $(target),$(target))"
    )
    string(REPLACE " " ";" PARAMS ${PARAMS})

    add_custom_target(package_target
        COMMAND make ${PARAMS}
        COMMAND cpack -D CPACK_COMPONENTS_ALL=${PARAMS}
    )



--
View this message in context: http://cmake.3232098.n2.nabble.com/CPack-Create-debian-packge-for-each-sub-project-tp7595889p7595912.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list