View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0016050CMakeCMakepublic2016-04-06 03:412016-06-10 14:31
ReporterLluís Batlle 
Assigned ToKitware Robot 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
Platformi686OSWindowsOS Version7
Product VersionCMake 3.5.1 
Target VersionFixed in Version 
Summary0016050: Missing source files generate broken Makefiles (NMake)
DescriptionUsing the "NMake Makefiles" and "NMake Makefiles JOM" generate broken makefiles, in case that one source file of ADD_EXECUTABLE is missing.

Steps To ReproduceIn 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 InformationIf 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.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0042976)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-04-06 03:41 Lluís Batlle New Issue
2016-06-10 14:29 Kitware Robot Note Added: 0042976
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team