[cmake-developers] [CMake 0016050]: Missing source files generate broken Makefiles (NMake)

Mantis Bug Tracker mantis at public.kitware.com
Wed Apr 6 03:41:27 EDT 2016


The following issue has been SUBMITTED. 
====================================================================== 
https://public.kitware.com/Bug/view.php?id=16050 
====================================================================== 
Reported By:                Lluís Batlle
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   16050
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-04-06 03:41 EDT
Last Modified:              2016-04-06 03:41 EDT
====================================================================== 
Summary:                    Missing source files generate broken Makefiles
(NMake)
Description: 
Using the "NMake Makefiles" and "NMake Makefiles JOM" generate broken makefiles,
in case that one source file of ADD_EXECUTABLE is missing.



Steps to Reproduce: 
In my case, I have something like:

ADD_EXECUTABLE(program WIN32 src1.cpp src1.hpp help.h)
TARGET_LINK_LIBRARIES(program lib1 lib2)

Running "cmake -G 'NMake Makefiles'" (or JOM) it reports properly:
CMake Error at CMakeLists.txt:57 (ADD_EXECUTABLE):
  Cannot find source file:

    F:/projects/prog/build/help.h

But then I can type "nmake program", and it goes on building lib1 and lib2, and
then it tries to link program with the libs without any object files. It does
not compile any "program" source files. Of course the linker reports missing
_WinMainCRTStartup.



Additional Information: 
If I use the ninja generator, it works fine. When trying to run "ninja program",
it tries to run cmake again, and it fails because of the missing source file.

NMake should also do the same: run cmake again, to see if the CMakeLists.txt has
been fixed and all sources are found.

I had missed the "CMake Error" line when using NMake, and I spent time trying to
find out the sudden miss of the _WinMainCRTStartup symbol.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-04-06 03:41 Lluís Batlle   New Issue                                    
======================================================================



More information about the cmake-developers mailing list