How about something like this:

if(${CMAKE_BUILD_TYPE STREQUAL DebugAndRelease)
    include(ExternalProject)
    ExternalProject_Add(MEDEBUG
        CMAKE_FLAGS -DCMAKE_BUILD_TYPE Debug)
    ExternalProject_Add(MERELEASE
        CMAKE_FLAGS -DCMAKE_BUILD_TYPE Release)
    install(FILES ...)
    #etc, etc.
    return()
endif()
# the usual build code comes after

That is, add a new special build type, that, when built, makes the project
just build itself twice as an external project, package it up, and exit
before the normal build code.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to