On 13.04.2018 21:48, Alan W. Irwin wrote:
[...]
However, that is wrong since that command currently needs two arguments even if
one of them is empty.  So instead I need the generated command to be

./test-drv-info "temporary_target_" ps > /home/software/plplot/HEAD/build_dir/drivers/test_dyndrivers_dir/ps.driver_info

or

./test-drv-info "" ps > /home/software/plplot/HEAD/build_dir/drivers/test_dyndrivers_dir/ps.driver_info

depending on how LIBRARY_TARGET_PREFIX is set.

Is it possible to implement that?

Hi Alan,

with VERBATIM just using regular unescaped quotes (which are cmake syntax and not part of the value) around the argument should work e.g.

    COMMAND test-drv-info "${LIBRARY_TARGET_PREFIX}" ${SOURCE_ROOT_NAME} ${CMAKE_CURRENT_BINARY_DIR}/test_dyndrivers_dir/${SOURCE_ROOT_NAME}.driver_info


That way even when ${LIBRARY_TARGET_PREFIX} expands empty add_custom_command() will receive an argument which it will escape / quote as required by the build system.

Nils
--

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:
https://cmake.org/mailman/listinfo/cmake

Reply via email to