[CMake] CPack: Packaging debug and release configurations in a single zip
Patrick Johnmeyer
pjohnmeyer+cmake at gmail.com
Thu Feb 14 12:37:14 EST 2013
Slight correction below. CMAKE_GENERATOR is a separate argument to the
ExternalProject_Add function, and I had embedded it incorrectly as a
-G option in CMAKE_ARGS.
On Thu, Feb 14, 2013 at 11:21 AM, Patrick Johnmeyer
<pjohnmeyer+cmake at gmail.com> wrote:
>
> #####
> include(ExternalProject)
>
> ExternalProject_Add(MyProjectDebug
> PREFIX Debug
> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
CMAKE_GENERATOR ${CMAKE_GENERATOR}
> CMAKE_ARGS -D CMAKE_BUILD_TYPE=Debug -D CPACK_BUILD_CONFIG=Debug
> BUILD_COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR}/Debug/src/MyProjectDebug-build --config Debug
> )
>
> ExternalProject_Add(MyProjectRelease
> PREFIX Release
> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
CMAKE_GENERATOR ${CMAKE_GENERATOR}
> CMAKE_ARGS -D CMAKE_BUILD_TYPE=Release -D CPACK_BUILD_CONFIG=Release
> BUILD_COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR}/Release/src/MyProjectRelease-build --config Release
> )
>
>
> set(CPACK_INSTALL_CMAKE_PROJECTS
> "${CMAKE_BINARY_DIR}/Debug/src/MyProjectDebug-build;MyProject;ALL;/"
> "${CMAKE_BINARY_DIR}/Release/src/MyProjectRelease-build;MyProject;ALL;/"
> )
>
> include(CPack)
> #####
>
More information about the CMake
mailing list