MantisBT - CMake
View Issue Details
0011695CMakeCMakepublic2011-01-13 19:512011-05-02 14:46
Vladislav Vaintroub 
David Cole 
normalmajoralways
closedfixed 
CMake-2-8 
CMake 2.8.4CMake 2.8.4 
0011695: rc.exe error in 2.8.4-rc1 if ADD_DEFINITITIONS contains definition with space
If add definition contains string with space character, build using VS2010
(or maybe also other VS) would fail with rc.exe error

Example project:

cmake_minimum_required(VERSION 2.6)
ADD_DEFINITIONS(-DMYSQL_DATADIR="data 1")
ADD_EXECUTABLE(main main.cc versioninfo_exe.rc)

Output of
cmake --build . --config debug

...
ResourceCompile:
  C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D WIN32 /D _WI
NDOWS /D _DEBUG /D "MYSQL_DATADIR=\"data 1\"" /D "CMAKE_INTDIR=\"Debug\"" /l"0x0
409" /nologo /fo"main.dir\Debug\versioninfo_exe.res" ..\versioninfo_exe.rc
  Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385

  Copyright (C) Microsoft Corporation. All rights reserved.


RC : fatal error RC1107: invalid usage; use RC /? for Help [H:\bzr\repro\yyy\mai
n.vcxproj]
unpack attached repro.zip, try to build with VS2010 generator
Very interesting, if I omit
cmake_minimum_required(VERSION 2.6)

altogether, the error does not happen.
The command line for rc.exe in case cmake_minimum_required is NOT set contains
/D "MYSQL_DATADIR=data 1"

If cmake_minimum_required is set, command line changes to
/D "MYSQL_DATADIR=\"data 1\""
No tags attached.
zip repro.zip (860) 2011-01-13 19:51
https://public.kitware.com/Bug/file/3622/repro.zip
Issue History
2011-01-13 19:51Vladislav VaintroubNew Issue
2011-01-13 19:51Vladislav VaintroubFile Added: repro.zip
2011-01-14 08:34Brad KingNote Added: 0024673
2011-01-14 08:38Brad KingNote Added: 0024674
2011-01-17 17:01David ColeAssigned To => David Cole
2011-01-17 17:01David ColeStatusnew => assigned
2011-01-17 17:01David ColeTarget Version => CMake 2.8.4
2011-01-17 17:01David ColeDescription Updatedbug_revision_view_page.php?rev_id=137#r137
2011-01-20 07:05David ColeAssigned ToDavid Cole => Bill Hoffman
2011-01-25 19:08David ColeAssigned ToBill Hoffman => David Cole
2011-01-25 19:08David ColeNote Added: 0025076
2011-01-25 19:08David ColeStatusassigned => resolved
2011-01-25 19:08David ColeFixed in Version => CMake 2.8.4
2011-01-25 19:08David ColeResolutionopen => fixed
2011-01-26 08:41David ColeNote Added: 0025078
2011-01-26 08:42David ColeNote Edited: 0025078bug_revision_view_page.php?bugnote_id=25078#r174
2011-05-02 14:46David ColeNote Added: 0026375
2011-05-02 14:46David ColeStatusresolved => closed

Notes
(0024673)
Brad King   
2011-01-14 08:34   
The reason cmake_minimum_required(VERSION 2.6) affects it is due to CMake Policy CMP0005:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0005 [^]
(0024674)
Brad King   
2011-01-14 08:38   
Previous versions of CMake did not pass *any* preprocessor definitions to the resource compiler in VS 2010. It was added here:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=16e7d4ba [^]
(0025076)
David Cole   
2011-01-25 19:08   
Fixed in this commit, just pushed to CMake 'next':
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=662756036e4f4983b00ab7740773a55bef808c64 [^]

Hopefully, we can squeeze this into the 2.8.4-rc2 build coming up...
(0025078)
David Cole   
2011-01-26 08:41   
(edited on: 2011-01-26 08:42)
See also follow commits to correct dashboard issues that arose on the nightly builds last night:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78fe97f2ff4dbe66590ee79a342ac01a5566ef31 [^]
(KWStyle line too long problem)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8f9919d93cad64de58775e4a7609b0ffb37d061e [^]
(test failed because of space in the /D value on VS6 and Cygwin)

Need more investigation here to determine if VS6 and Cygwin actually support spaces here and CMake is generating something incorrectly, or whether they are simply not supported via these rc/windres compiler implementations...

(0026375)
David Cole   
2011-05-02 14:46   
Closing resolved issues that have not been updated in more than 3 months.