[CMake] add_custom_target: COMMAND embedded make code

DKLind davidklind at gmail.com
Fri Feb 24 19:34:53 EST 2017


Solved problem from another post with similar space escaping.

    set(PARAMS
        "$(if $(verbose), --verbose)"
        "$(if $(xml-output), --xml-output)"
        "$(if $(run), --run=$(run))"
        "$(if $(suite), --suite=$(suite))"
    )
    string(REPLACE " " ";" PARAMS ${PARAMS})
    add_custom_target(${PROJECT_NAME}_run
        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
$(xml-output), --xml-output)" "$(if $(run), --run=$(run))" "$(if $(suite),
--suite=$(suite))"
        COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${target} ${PARAMS}
        DEPENDS ${target}
    )



--
View this message in context: http://cmake.3232098.n2.nabble.com/add-custom-target-COMMAND-embedded-make-code-tp7595092p7595094.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list