MantisBT - CMake
View Issue Details
0012348CMakeCMakepublic2011-07-18 09:482016-06-10 14:31
Dan Thill 
Kitware Robot 
normalminoralways
closedmoved 
WindowsWindows XP-64 SP25.2.3790
CMake 2.8.5 
 
0012348: Setting CMAKE_CXX_CREATE_STATIC_LIBRARY has no effect in VS2008
Overriding the CMAKE_CXX_CREATE_STATIC_LIBRARY rule doesn't seem to have any effect when generating a 64-bit VS2008 project. I am attempting to add the /LTCG (link time code generation) on a global basis. I've trolled the lists and bug tracker quite a bit and I'm not the only one who has had problems with this.
1) Create a simple static library using ADD_LIBRARY( libname STATIC [files])

2) Modify CMAKE_CXX_CREATE_STATIC_LIBRARY, e.g., add link time code generation:

STRING( REPLACE "/nologo" "/nologo /LTCG" CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})

3) Inspect the generated project properties ( Configuration Properties -> Librarian -> Command Line )and see that the command line is still "/OUT:"[xxxx]" /NOLOGO".

As a test, I manually added "/LTCG" to to the original CMAKE_CXX_CREATE_STATIC_LIBRARY value in Platform/cl.cmake. During configuration, printing the value of CMAKE_CXX_CREATE_STATIC_LIBRARY shows the expected value. But the flag does not appear in the generated .vcproj file. It's as if the project file generator is using a hardcoded value.

I am aware of the STATIC_LIBRARY_FLAGS and STATIC_LIBRARY_FLAGS_* target properties and they work correctly, but I'd prefer to not have to add (what should be) a global compiler setting explicitly on every static library in my project (of which there are dozens), or override/create my own ADD_LIBRARY macro.
No tags attached.
Issue History
2011-07-18 09:48Dan ThillNew Issue
2011-07-29 15:01Source_changeset_attached => VTK master 87705c2f
2012-08-11 11:38David ColeStatusnew => backlog
2012-08-11 11:38David ColeNote Added: 0030287
2016-06-10 14:28Kitware RobotNote Added: 0041864
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
(0030287)
David Cole   
2012-08-11 11:38   
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.
(0041864)
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.