Hi!

I've run into the same problem with many custom commands as discussed here:
http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/13434
Which is referenced in this bug report:
https://cmake.org/Bug/view.php?id=15612#c38924

I've had a look at this problem because this is the only thing that blocks
us from using ninja.

It seems to me that there are two possible solution:


* use a response file (rspfile and rspfile_content). This unfortunately is
only possible when modifying ninja to support multiline response files. As
far as I know this is not possible now. (the $in_newline does not work in
this case)


* Add a build target for each custom command, e.g. instead of

E.g. instead of an output like this:
----------------
build CMakeFiles\copy_czmq_3.0.2.util: CUSTOM_COMMAND
  COMMAND = cmd.exe /C "cd /D C:\dev\ras_robvis\vc140_x64_ninja &&
"c:\Program Files (x86)\CMake\bin\cmake.exe" -E copy_if_different
"C:/dev/ras_robvis/src/ext/lib_czmq/3.0.2/vc140_x64/czmq.dll"
"C:/dev/ras_robvis/vc140_x64_ninja/bin/./czmq.dll" && cd /D
C:\dev\ras_robvis\vc140_x64_ninja && "c:\Program Files
(x86)\CMake\bin\cmake.exe" -E copy_if_different
"C:/dev/ras_robvis/src/ext/lib_czmq/3.0.2/vc140_x64/czmqd.dll"
"C:/dev/ras_robvis/vc140_x64_ninja/bin/./czmqd.dll""
  DESC = Running utility command for copy_czmq_3.0.2
  restat = 1
build copy_czmq_3.0.2: phony CMakeFiles\copy_czmq_3.0.2.util
----------------

produce an output like this:
----------------
build CMakeFiles\copy_czmq_3.0.2.util.1: CUSTOM_COMMAND
  COMMAND = cmd.exe /C "cd /D C:\dev\ras_robvis\vc140_x64_ninja &&
"c:\Program Files (x86)\CMake\bin\cmake.exe" -E copy_if_different
"C:/dev/ras_robvis/src/ext/lib_czmq/3.0.2/vc140_x64/czmq.dll"
"C:/dev/ras_robvis/vc140_x64_ninja/bin/./czmq.dll""
  restat = 1

build CMakeFiles\copy_czmq_3.0.2.util.2: CUSTOM_COMMAND
  COMMAND = cmd.exe /C "cd /D C:\dev\ras_robvis\vc140_x64_ninja &&
"c:\Program Files (x86)\CMake\bin\cmake.exe" -E copy_if_different
"C:/dev/ras_robvis/src/ext/lib_czmq/3.0.2/vc140_x64/czmqd.dll"
"C:/dev/ras_robvis/vc140_x64_ninja/bin/./czmqd.dll""
  restat = 1

build CMakeFiles\copy_czmq_3.0.2.util: phony |
CMakeFiles\copy_czmq_3.0.2.util.1 CMakeFiles\copy_czmq_3.0.2.util.2
  DESC = Running utility command for copy_czmq_3.0.2

build copy_czmq_3.0.2: phony CMakeFiles\copy_czmq_3.0.2.util
----------------


I did not yet have a look at the cmake code so I am not sure how difficult
it is to implement this, or even if this is the best way to solve this.

Any comments? is this reasonable?

Martin

-- 
Martin
-- 

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-developers

Reply via email to