The following issue has been SUBMITTED. ====================================================================== https://public.kitware.com/Bug/view.php?id=15923 ====================================================================== Reported By: Mads Brix Assigned To: ====================================================================== Project: CMake Issue ID: 15923 Category: CMake Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2016-01-18 07:20 EST Last Modified: 2016-01-18 07:20 EST ====================================================================== Summary: Makefile is written/updated even if there are errors in cmake. Description: If there is an error when running cmake (e.g. because of misspelled source file name) the Makefile will be written. This means that the next time one runs make, compilation is attempted (since the Makefile is up-to-date), and therefore the output is a compilation error, and not the (root cause) error from running cmake.
With ninja this does not happen - the build.ninja is only written/updated if cmake execution is error free. Another situation is where a succesful build has been done, and error is then introduced (e.g. by spelling mistake when adding new source file). Correction would be to change Makefile generator to work like Ninja generator and only write/update Makefile if cmake is error free. Found with cmake 3.3.2, also present in 3.4.1. Steps to Reproduce: 1) create directories source, build.Ninja, build.Make. 2) create simple CMakeLists.txt in source directory: project (TestMakefileError) add_executable(TestMakefileError NonExistentFile.cc) 3) In build.Make run: "cmake ../source/" Error from cmake is reported, but Makefile is written, so when running make the cmake error is not reported. 4) In build.Ninja run. "cmake -G Ninja ../source/" Error from cmake is reported, but build.ninja is not written. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2016-01-18 07:20 Mads Brix New Issue ====================================================================== -- 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-developers
