On 07/30/2014 11:06 AM, Williams, Norman K wrote: > I was trying to get ExternalProjects generated with the Ninja > generator to do a better job of handling multiple CPUs and load, > so I tried the naïve solution below.
For reference in the archives, your previous post about this was here: CMake, Ninja generator, and ExternalProjects http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/10543 > I needed to add flags to the program named in CMAKE_MAKE_PROGRAM. The relevant part of the ExternalProject module source is the block that constructs the default BUILD_COMMAND when not using a Makefile generator: # Drive the project with "cmake --build". get_target_property(cmake_command ${name} _EP_CMAKE_COMMAND) if(cmake_command) set(cmd "${cmake_command}") else() set(cmd "${CMAKE_COMMAND}") endif() set(args --build ${binary_dir} --config ${CMAKE_CFG_INTDIR}) At build time, "cmake --build" loads the CMAKE_MAKE_PROGRAM from the CMakeCache.txt of the build tree, at least for the Ninja generator. When running "cmake --build" by hand one can specify additional args: cmake --build . -- $ExtraArgs Everything after the "--" option will be given to the native tool. Perhaps one could add a special-case here when cmake_generator is "Ninja" to extend the "cmake --build" command with th needed options to ninja. > the only alternative is to explicitly set the BUILD_COMMAND for > every ExternalProject_add command. That would also work with existing CMake releases, but would have to be conditional on the generator in use. -Brad -- 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
