MantisBT - CMake
View Issue Details
0012931CMakeCMakepublic2012-02-03 10:262016-06-10 14:31
Thierry 
Kitware Robot 
normalmajoralways
closedmoved 
MSVC 2010 expressWindows 7enterprise 64bit
CMake 2.8.7 
 
0012931: MSVC 2010 project generation filters out known compile flags
I'm trying to have a library with only one file compiled with clr support.
The Makefile generator adds my flags correctly.

But the visual studio 10 generator filters out the known flags (/clr /FU...)
get my 2 files,
cmake -G "Visual Studio 10"

you can edit the vcxproj and see that some flags are filtered

cmake -G "NMake Makefiles"

that works fine.
My colleague still uses MSVC2008 and that generator seems to work.
No tags attached.
zip temp.zip (1,037) 2012-02-03 10:26
https://public.kitware.com/Bug/file/4202/temp.zip
Issue History
2012-02-03 10:26ThierryNew Issue
2012-02-03 10:26ThierryFile Added: temp.zip
2012-02-03 10:45ThierryNote Added: 0028460
2012-02-03 10:54Brad KingNote Added: 0028462
2012-08-11 21:09David ColeStatusnew => backlog
2012-08-11 21:09David ColeNote Added: 0030357
2016-06-10 14:28Kitware RobotNote Added: 0041976
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
(0028460)
Thierry   
2012-02-03 10:45   
It seems it works as expected if I remove the space between the option and the argument. For instance /FUSystem.dll instead of /FU system.dll
(0028462)
Brad King   
2012-02-03 10:54   
CMake has a table of known mappings from flags to IDE project options. In the case of VS 10 we computed the table from the MSBuild files that map the other direction:

http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmVS10CLFlagTable.h;hb=v2.8.7 [^]

The generator parses the specified flags:

http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmVisualStudioGeneratorOptions.cxx;hb=v2.8.7#l122 [^]

and handles each flag by mapping it through the table:

http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmIDEOptions.cxx;hb=v2.8.7#l34 [^]

The resulting project file should have the corresponding options set.

Perhaps the mapping has not been written to handle the options that have values as separate arguments. As you discovered you can work around the problem for now by not separating them.
(0030357)
David Cole   
2012-08-11 21:09   
Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0041976)
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.