MantisBT - CMake
View Issue Details
0015711CMakeCMakepublic2015-08-26 07:012016-01-04 11:52
A. Klitzing 
 
normalmajoralways
closedduplicate 
MSVC 2015 / Ninja 1.6.0Windows10.4.10
CMake 3.3.1 
 
0015711: Ninja cannot build resource file
If we use Ninja generator to build our application it will fail to compile our .rc file.

If we use the NMake Makefile it builds without any problems.
Here is the output of "ninja -v":

[...]
[14/16] C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe /nologo /TP /DWIN32 /D_WINDOWS /W3 /GR /EHsc /W3 /MD /O2 /Ob2 /D NDEBUG -Isrc -IC:\ninja\source\src -IC:\ninja\source\src\global -IC:\ninja\source\src\core -IC:\ninja\libs\build\dist\include -IC:\ninja\libs\build\dist\include\QtCore -IC:\ninja\libs\build\dist\mkspecs\win32-msvc2015 -IC:\ninja\source\src\external -IC:\ninja\source\src\card\base -IC:\ninja\source\src\activation -IC:\ninja\source\src\settings -IC:\ninja\source\src\network -IC:\ninja\libs\build\dist\include\QtNetwork -IC:\ninja\libs\build\dist\include\QtXml -IC:\ninja\libs\build\dist\include\QtGui -IC:\ninja\libs\build\dist\include\QtWidgets -IC:\ninja\libs\build\dist\include\QtQml -IC:\ninja\libs\build\dist\include\QtQuick -DAPPCAST_URL=\"https://XYZ\" [^] -DVERSION=\"1.0.0+67-stable\" /showIncludes -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MESSAGELOGCONTEXT -DQT_NETWORK_LIB -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DUNICODE -DUSE_DESKTOP_WIDGETS -DUSE_WINDOWS_WIDGETS /Fosrc\CMakeFiles\Application.dir\main.cpp.obj /Fdsrc\CMakeFiles\Application.dir\ /FS -c C:\ninja\source\src\main.cpp
[15/16] "" RC C:\ninja\source\resources\windows.rc "src/CMakeFiles/Application.dir/__/resources/windows.rc.res.d" src\CMakeFiles\Application.dir\__\resources\windows.rc.res "" "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe" C:\PROGRA~2\WI3CF2~1\8.1\bin\x86\rc.exe /DWIN32 -IC:\ninja\build\src -IC:\ninja\source\src -IC:\ninja\source\src\global -IC:\ninja\source\src\core -IC:\ninja\libs\build\dist\include -IC:\ninja\libs\build\dist\include\QtCore -IC:\ninja\libs\build\dist\mkspecs\win32-msvc2015 -IC:\ninja\source\src\external -IC:\ninja\source\src\card\base -IC:\ninja\source\src\activation -IC:\ninja\source\src\settings -IC:\ninja\source\src\network -IC:\ninja\libs\build\dist\include\QtNetwork -IC:\ninja\libs\build\dist\include\QtXml -IC:\ninja\libs\build\dist\include\QtGui -IC:\ninja\libs\build\dist\include\QtWidgets -IC:\ninja\libs\build\dist\include\QtQml -IC:\ninja\libs\build\dist\include\QtQuick -DVERSION_MAJOR=1 -DVERSION_MINOR=4 -DVERSION_PATCH=3 -DVERSION_TWEAK=0 -DVERSION=1.0.0+67-stable -DQT_CORE_LIB -DQT_GUI_LIB -DQT_MESSAGELOGCONTEXT -DQT_NETWORK_LIB -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DUNICODE -DUSE_DESKTOP_WIDGETS -DUSE_WINDOWS_WIDGETS /fosrc\CMakeFiles\Application.dir\__\resources\windows.rc.res C:\ninja\source\resources\windows.rc
ninja: fatal: CreateProcess: Falscher Parameter.
No tags attached.
duplicate of 0015088closed Kitware Robot Ninja generator makes an invalid RC_COMPILER rule 
Issue History
2015-08-26 07:01A. KlitzingNew Issue
2015-08-26 09:21A. KlitzingNote Added: 0039327
2015-08-26 09:37A. KlitzingNote Added: 0039328
2015-08-27 09:03Brad KingRelationship addedduplicate of 0015088
2015-08-27 09:04Brad KingNote Added: 0039336
2015-08-27 09:04Brad KingStatusnew => resolved
2015-08-27 09:04Brad KingResolutionopen => duplicate
2016-01-04 11:52Robert MaynardNote Added: 0040127
2016-01-04 11:52Robert MaynardStatusresolved => closed

Notes
(0039327)
A. Klitzing   
2015-08-26 09:21   
rules.ninja:

rule RC_COMPILER__Application
  depfile = $DEP_FILE
  deps = gcc
  command = "" RC $in "$DEP_FILE" $out "" "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe" C:\PROGRA~2\WI3CF2~1\8.1\bin\x86\rc.exe $FLAGS $DEFINES /fo$out $in
  description = Building RC object $out


Is "deps = gcc" correct? Compiler is MSVC. If I change it to msvc it is still broken.


It looks like this:
https://public.kitware.com/Bug/view.php?id=15088 [^]
(0039328)
A. Klitzing   
2015-08-26 09:37   
Ok, I found the problem.

http://www.cmake.org/gitweb?p=cmake.git;a=blob_plain;f=Modules/CMakeClDeps.cmake [^]

It will check and use CMAKE_C_COMPILER only. But there is no CMAKE_C_COMPILER for a CXX project. If I change it here in CMakeClDeps to CMAKE_CXX_COMPILER it works!
Of course... it must work for both. ;-)
(0039336)
Brad King   
2015-08-27 09:04   
Resolving as duplicate of 0015088 but I also linked from there to the discussion here.
(0040127)
Robert Maynard   
2016-01-04 11:52   
Closing resolved issues that have not been updated in more than 4 months.