View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015399CMakeCMakepublic2015-02-10 05:572015-07-08 08:57
ReporterFlorent 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSWindowsOS Version7
Product VersionCMake 3.1.1 
Target VersionFixed in Version 
Summary0015399: cmake xml-escapes ";" for visual studio generators resulting in malformed "ignore default libraries"
DescriptionI have the following cmakelist :

set_property(TARGET MyLibraryUsingFortranRt APPEND PROPERTY LINK_FLAGS
            "/NODEFAULTLIB:svml_disp.lib"
            "libifcoremt.lib"
            "libcmt.lib"
            "libcmtd.lib"
            "libmmt.lib"
            "libifport.lib")

this generates the following xml fragment with 3.1 (Visual 2010 generator)
      <IgnoreSpecificDefaultLibraries>svml_disp.lib%3Blibifcoremt.lib%3Blibcmt.lib%3Blibcmtd.lib%3Blibmmt.lib%3Blibifport.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>


(notice how ";" got correctly escaped to %3B ! )

However for this specific filed VS expect to have ";" present in the xml as it is the case with 3.0 making it impossible to ignore several libraries.



Additional Informationfrom my end-less researches, this is linked to

http://www.cmake.org/Bug/view.php?id=15031 [^]

and most likely this commit :
http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8fa087ab [^]
TagsNo tags attached.
Attached Filespng file icon VS_escaped_ignore_specific_libraries.PNG [^] (6,749 bytes) 2015-02-10 05:57

 Relationships

  Notes
(0037948)
Brad King (manager)
2015-02-10 08:59

The LINK_FLAGS property is one of the oldest properties and pre-dates the modern ;-list convention. It is supposed to be a command-line string, and so should be space-separated. Add each /NODEFAULTLIB:somelib.lib as its own flag, e.g.:

set_property(TARGET MyLibraryUsingFortranRt APPEND PROPERTY LINK_FLAGS "/NODEFAULTLIB:svml_disp.lib /NODEFAULTLIB:libifcoremt.lib ...")
(0037956)
Florent (reporter)
2015-02-11 03:48

It works for me, thanks !

Why did the behavior changed ? just out of curiosity ...
(0037957)
Brad King (manager)
2015-02-11 08:37

Re-setting to 'resolved' because we leave issues open for comments until after 4 months of inactivity before marking as 'closed'.

> Why did the behavior changed

The old behavior of not encoding ";" in values was a bug. For any code using the official interfaces/approach within CMake to set things the only change in behavior was to make a case that previously didn't work (";" in actual flag values passed to the tools) now work. Your LINK_FLAGS case worked only by accident due to the bug. Using the command-line space-separated value will work in both old and new versions of CMake.

(0039048)
Robert Maynard (manager)
2015-07-08 08:57

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-02-10 05:57 Florent New Issue
2015-02-10 05:57 Florent File Added: VS_escaped_ignore_specific_libraries.PNG
2015-02-10 08:59 Brad King Note Added: 0037948
2015-02-10 08:59 Brad King Status new => resolved
2015-02-10 08:59 Brad King Resolution open => no change required
2015-02-11 03:48 Florent Note Added: 0037956
2015-02-11 03:49 Florent Status resolved => closed
2015-02-11 08:37 Brad King Note Added: 0037957
2015-02-11 08:37 Brad King Status closed => resolved
2015-07-08 08:57 Robert Maynard Note Added: 0039048
2015-07-08 08:57 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team