I want to add stuff to a custom command based on some definition:

cmake_minimum_required(VERSION 2.6)

set(DO_RELAX 1)
if(DO_RELAX)
    set(OR_RELAX "|| echo \"no big deal\"")
else()
    set(OR_RELAX "")
endif()

add_custom_command(OUTPUT foo COMMAND generate-foo ${OR_RELAX})
add_custom_target(do-foo ALL DEPENDS foo)


However, this produces the following rule in the generated makefile:

foo:
        $(CMAKE_COMMAND) -E cmake_progress_report 
/home/bnewcomb/tmp/cmake-tests/custom-or/CMakeFiles $(CMAKE_PROGRESS_1)
        @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold 
"Generating foo"
        generate-foo ||\ echo\ "no\ big\ deal"

Is there some way I can get cmake to not escape all of the 
spaces in the value of OR_RELAX?

Thanks,
B.

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to