[CMake] ninja generator and add_custom_target bug

Russell L. Carter rcarter at esturion.net
Thu Oct 2 13:54:04 EDT 2014


Hi,

With this cmake code:

ADD_CUSTOM_TARGET(uninstall
  COMMAND echo "\nRemoving installed files:"
  COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt | xargs
rm -fv
  )

(sorry about the wrapping...)

the ninja generator fails with:

ninja: error: build.ninja:90: expected '=', got lexing error

which turns out to be (again, the wrapping makes this hard
to see):

build CMakeFiles/uninstall: CUSTOM_COMMAND
  COMMAND = cd /usr/home/rcarter/projects/nail/core/build/c++.Debug &&
echo
Removing\ installed\ files: && cat
/usr/home/rcarter/projects/nail/core/build/c++.Debug/install_manifest.txt
| xargs rm -fv

The problem seems to be that the echo'd text starting with
"Removing" begins after a newline.

The cmake code works fine with the gmake generator.

Best regards,
Russell


More information about the CMake mailing list