[CMake] Parallel build with custom command

Ruslan Baratov ruslan_baratov at yahoo.com
Tue Oct 7 02:19:04 EDT 2014


Hi,

I have a problem with parallel build of project with custom command. 
Custom command generates two files and depends on generator script. For 
optimization purpose first file created only when not exists. This lead 
to conflict, even if I "protect" custom command with a custom target and 
set explicit dependencies:

 > cmake -H. -B_builds
 > cmake --build _builds -- -j4 # First build OK
 > touch generate.cmake
 > cmake --build _builds -- -j4 # Second build. Unexpected `Script run` 
several messages
[ 16%] Custom command
Script run
[ 33%] Custom target
[ 33%] Built target Generate
[ 66%] [ 66%] Custom command
Custom command
Script run
Script run
Scanning dependencies of target Blib
[ 66%] Custom command
Script run
[ 66%] [ 83%] Built target Alib
Custom command
Script run
[100%] Building CXX object CMakeFiles/Blib.dir/B.cpp.o
Linking CXX static library libBlib.a
[100%] Built target Blib

CMakeLists.txt: http://pastebin.com/dspw4j1S
generate.cmake: http://pastebin.com/XNS6hPRX

Is it a known issue?


More information about the CMake mailing list