Hey there

I was hoping I'd find the answer online but there seems to be no way to do what 
I want with the version of CMAKE I'm stuck with.

I'm currently using CMAKE 2.8.7 to generate a VS2010 solution and project. I'd 
like to add a PRE_BUILD step that runs one set of commands for a debug build 
and another for release. Here's a made up example of what I'd like to do

If we're in debug

ADD_CUSTOM_COMMAND (TARGET ${MY_PROJECT}
                PRE_BUILD
                COMMAND jam
                ARGS -j8 -sDEBUG=1 ${MY_JAM_TARGET}
                COMMENT "Running JAM target: ${ MY_JAM_TARGET }"
                WORKING_DIRECTORY ${MY_BUILD_DIR}
                VERBATIM)

And if we're in release

ADD_CUSTOM_COMMAND (TARGET ${MY_PROJECT}
                PRE_BUILD
                COMMAND jam
                ARGS -j8 ${MY_JAM_TARGET}
                COMMENT "Running JAM target: ${ MY_JAM_TARGET }"
                WORKING_DIRECTORY ${MY_BUILD_DIR}
                VERBATIM)

Note in release, we are not passing the argument "-sDEBUG=1"

Is there a way to do this in 2.8.7? I can't use 2.8.10 because it generates 
vcxproj files that will not load in VS2010

Thanks in advance

BA
--

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