MantisBT - CMake
View Issue Details
0013830CMakeCMakepublic2013-01-03 17:302016-06-10 14:31
Amine Khaldi 
Kitware Robot 
normalfeaturealways
closedmoved 
CMake 2.8.10.2 
 
0013830: Add support for RC-specific preprocessor definitions
ReactOS uses set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> ${I18N_DEFS} /fo<OBJECT> <SOURCE>")

Which works perfectly with ninja and nmake makefiles. When you use the VS 2010 generator you will get a *very* different handling of rc files, that leads to broken binaries. There is absolutely no way to customize it at least and put it inside an if(MSVC_IDE) or something (as a hack).
No tags attached.
Issue History
2013-01-03 17:30Amine KhaldiNew Issue
2013-01-04 08:22Brad KingNote Added: 0031973
2013-01-04 08:26Amine KhaldiNote Added: 0031975
2013-01-04 08:44Brad KingNote Added: 0031977
2013-01-04 08:46Amine KhaldiNote Added: 0031978
2013-01-07 10:56Brad KingNote Added: 0031993
2013-01-07 10:58Amine KhaldiNote Added: 0031994
2013-01-07 10:58Amine KhaldiNote Edited: 0031994bug_revision_view_page.php?bugnote_id=31994#r989
2013-01-07 11:49Brad KingSeveritymajor => feature
2013-01-07 11:49Brad KingStatusnew => backlog
2013-01-07 11:49Brad KingSummaryVS 2010 generator completely ignores the RC compiling rule => Add support for RC-specific preprocessor definitions
2016-06-10 14:28Kitware RobotNote Added: 0042190
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0031973)
Brad King   
2013-01-04 08:22   
Rule variables are used only for the Makefile and Ninja generators. The VS 10 IDE generators just add sources to the .vcxproj files and let MSBuild handle compilation.

What goes in ${I18N_DEFS} that you want to end up on the command line?
(0031975)
Amine Khaldi   
2013-01-04 08:26   
Localization defines. We found no way to add them to the RC compiler only.

Also, the VS generator adds a flag for the "Culture" (it adds /l 0x0409 flag which represents English (United States) (0x409) ) that we didn't ask for and we find no way to remove it.
(0031977)
Brad King   
2013-01-04 08:44   
CMake doesn't have per-language preprocessor definition configuration, but you can set it on a specific source file:

 set_property(SOURCE my.rc PROPERTIES COMPILE_DEFINITIONS -DI18N)

The Culture flag is not coming from CMake. That is default behavior of the project files. CMake will map flags to project file elements for the cl, lib, and link tools but no such feature is yet implemented for resource compilation.
(0031978)
Amine Khaldi   
2013-01-04 08:46   
We have more than 800 targets. I sincerely hope that setting the COMPILE_DEFINITIONS property with our list of defines (tons of defines) for localization, is not the only solution, because that's just impractical.
(0031993)
Brad King   
2013-01-07 10:56   
Is your main goal to add preprocessor definitions exclusively for resources and not for C/C++ code?
(0031994)
Amine Khaldi   
2013-01-07 10:58   
Yes, since these are localization definitions that affect only rc files.

(0042190)
Kitware Robot   
2016-06-10 14:28   
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.