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                                    
======================================================================

-- 

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

Reply via email to