ctest_build: How to pass parallel build level?
When the generator is Visual Studio 15 2017 Win64
, this ctest_build command from a ctest script
set(CTEST_BUILD_FLAGS "-j 2")
ctest_build( TARGET install )
constructs an invalid cmake/msbuild command.
"C:\Program Files\CMake\bin\cmake.exe" --build . --config "Debug" --target "install" -- -j 2
The correct command omits the double dash (--
). From the command line I can run this build command succesfully:
"C:\Program Files\CMake\bin\cmake.exe" --build . --config "Debug" --target "install" -j 2
Related: ProcessorCount documentation
Edited by Brad King