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.

> [ 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
(CONFIGURE_FILE):
>   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:3
(CONFIGURE_FILE):
>   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 2
> make[1]: *** Waiting for unfinished jobs....
> make[1]: *** [CMakeFiles/Makefile2:253: CMakeFiles/config2.dir/all]
Error 2
> [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
(CONFIGURE_FILE):
>   CONFIGURE_FILE Problem configuring file
>
> CMake Error at
/home/kaa/cmake_add_custom_command-target/cmake/config.cmake:3
(CONFIGURE_FILE):
>   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 2
> make[2]: *** [CMakeFiles/config3.dir/build.make:61: config] Error 1
> make[1]: *** [CMakeFiles/Makefile2:327: CMakeFiles/config3.dir/all]
Error 2
> make: *** [Makefile:84: all] Error 2

--

Best regards,
Oleh Kravchenko

Attachment: cmake_add_custom_command-target.tar.bz2
Description: application/bzip

Attachment: signature.asc
Description: OpenPGP digital signature

-- 

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:
https://cmake.org/mailman/listinfo/cmake-developers

Reply via email to