View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010554CMakeCMakepublic2010-04-14 13:582016-06-10 14:31
ReporterJean Sreng 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0010554: CMAKE_MODULE_LINKER_FLAGS_DEBUG has no effect in Visual Studio 2008 generator
DescriptionAttempting to locally modify the library link options using

 SET ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /machine:x64" )
 SET ( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /machine:x64" )

ADD_LIBRARY(Hello hello.cxx)

Does not generate the line "AdditionalOptions" in the .vcproj . This line is however generated for executables (add_executable and CMAKE_EXE_LINKER_FLAGS)

The expected behavior in this case would be to add "AdditionalOptions" = "/machine:x64" (or whatever is in CMAKE_MODULE_LINKER_FLAGS) in the section
<Tool Name="VCLibrarianTool" ...> of the .vcproj

(This also applies for LINK_FLAGS of SET_TARGET_PROPERTIES)

I think this issue is related to bug 0000613.

As weird as it may sound, MS Visual C++ can need some options to be passed to its "library" tool (lib.exe) when generating libs.

TagsNo tags attached.
Attached Files

 Relationships
related to 0000629closedBill Hoffman SET_TARGET_PROPERTIES( LINK_FLAGS) doesn't work on libraries 
related to 0000613closedBill Hoffman Can't change linker flags on MSVC 

  Notes
(0020193)
Jean Sreng (reporter)
2010-04-15 07:45

Found a workaround:

set_target_properties(${name} PROPERTIES STATIC_LIBRARY_FLAGS "${CMAKE_XXX_LINKER_FLAGS}") did the trick.

However, I'm not sure if the behavior described in the previous message should or should not be implemented nevertheless...
(0024803)
David Cole (manager)
2011-01-17 15:36

Are you sure you're testing with a SHARED library?

By default, CMake will be using a static library for add_library, so there's nothing to "link" with CMAKE_SHARED_LINKER_FLAGS or CMAKE_MODULE_LINKER_FLAGS...

What happens if you do the following (add the "SHARED" flag)?
  SET ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /machine:x64" )
  SET ( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /machine:x64" )
  ADD_LIBRARY(Hello SHARED hello.cxx)
(0030613)
David Cole (manager)
2012-08-13 15:16

Sending old, not-recently-updated issues to the backlog.

(The age of the bug alone 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.
(0041685)
Kitware Robot (administrator)
2016-06-10 14:27

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.

 Issue History
Date Modified Username Field Change
2010-04-14 13:58 Jean Sreng New Issue
2010-04-15 07:45 Jean Sreng Note Added: 0020193
2011-01-17 15:34 David Cole Relationship added related to 0000629
2011-01-17 15:34 David Cole Relationship added related to 0000613
2011-01-17 15:36 David Cole Note Added: 0024803
2011-01-17 15:36 David Cole Assigned To => David Cole
2011-01-17 15:36 David Cole Status new => assigned
2012-08-13 15:16 David Cole Status assigned => backlog
2012-08-13 15:16 David Cole Note Added: 0030613
2012-08-13 15:17 David Cole Assigned To David Cole =>
2016-06-10 14:27 Kitware Robot Note Added: 0041685
2016-06-10 14:27 Kitware Robot Status backlog => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:27 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team