Oleh Kravchenko
2018-07-04 16:52:23 UTC
Hello CMake Developers!
Looks like I found interesting bug in CMake:
- ADD_CUSTOM_TARGET() always creates Makefile rule for ADD_CUSTOM_COMMAND().
- As result build simetimes failed if specified -jN for make.
Please find attached simple project which reproduce the problem.
Best regards,
Oleh Kravchenko
Looks like I found interesting bug in CMake:
- ADD_CUSTOM_TARGET() always creates Makefile rule for ADD_CUSTOM_COMMAND().
- As result build simetimes failed if specified -jN for make.
Please find attached simple project which reproduce the problem.
[ 12%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[ 25%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[ 37%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[ 50%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[ 62%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[ 75%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[ 87%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[100%] Generate /home/kaa/cmake_add_custom_command-target/build/config
CMake Error at
/home/kaa/cmake_add_custom_command-target/cmake/config.cmake:3[ 25%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[ 37%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[ 50%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[ 62%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[ 75%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[ 87%] Generate /home/kaa/cmake_add_custom_command-target/build/config
[100%] Generate /home/kaa/cmake_add_custom_command-target/build/config
CMake Error at
  CONFIGURE_FILE Problem configuring file
make[2]: *** [CMakeFiles/config2.dir/build.make:61: config] Error 1
make[2]: *** Deleting file 'config'
CMake Error at
/home/kaa/cmake_add_custom_command-target/cmake/config.cmake:3make[2]: *** [CMakeFiles/config2.dir/build.make:61: config] Error 1
make[2]: *** Deleting file 'config'
CMake Error at
  CONFIGURE_FILE Problem configuring file
make[2]: *** [CMakeFiles/config5.dir/build.make:61: config] Error 1
make[2]: *** Deleting file 'config'
make[1]: *** [CMakeFiles/Makefile2:216: CMakeFiles/config5.dir/all]
Error 2make[2]: *** [CMakeFiles/config5.dir/build.make:61: config] Error 1
make[2]: *** Deleting file 'config'
make[1]: *** [CMakeFiles/Makefile2:216: CMakeFiles/config5.dir/all]
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:253: CMakeFiles/config2.dir/all]
Error 2make[1]: *** [CMakeFiles/Makefile2:253: CMakeFiles/config2.dir/all]
[100%] Built target config1
[100%] Built target config4
[100%] Built target config7
[100%] Built target config6
CMake Error at
/home/kaa/cmake_add_custom_command-target/cmake/config.cmake:3[100%] Built target config4
[100%] Built target config7
[100%] Built target config6
CMake Error at
  CONFIGURE_FILE Problem configuring file
CMake Error at
/home/kaa/cmake_add_custom_command-target/cmake/config.cmake:3CMake Error at
  CONFIGURE_FILE Problem configuring file
make[2]: *** [CMakeFiles/config0.dir/build.make:61: config] Error 1
make[2]: *** Deleting file 'config'
make[1]: *** [CMakeFiles/Makefile2:142: CMakeFiles/config0.dir/all]
Error 2make[2]: *** [CMakeFiles/config0.dir/build.make:61: config] Error 1
make[2]: *** Deleting file 'config'
make[1]: *** [CMakeFiles/Makefile2:142: CMakeFiles/config0.dir/all]
make[2]: *** [CMakeFiles/config3.dir/build.make:61: config] Error 1
make[1]: *** [CMakeFiles/Makefile2:327: CMakeFiles/config3.dir/all]
Error 2make[1]: *** [CMakeFiles/Makefile2:327: CMakeFiles/config3.dir/all]
make: *** [Makefile:84: all] Error 2
--Best regards,
Oleh Kravchenko