MantisBT - CMake
View Issue Details
0012124CMakeCMakepublic2011-04-26 16:082014-06-02 08:37
Glenn Coombs 
Stephen Kelly 
normalfeatureN/A
closedfixed 
MicrosoftWindows7
CMake-2-8 
CMake 2.8.11 
0012124: Need per configuration version of target_link_libraries() or fix IMPORTED_LOCATION to allow empty string
See http://www.cmake.org/pipermail/cmake/2011-April/044059.html [^] for full details.

I want to use target_link_libraries() to add a library dependency but only for my custom configuration called DebugPthreads. As target_link_libraries() doesn't support that functionality I tried specifying the dependency as an imported library so that I could set its location using the IMPORTED_LOCATION_DEBUGPTHREADS property. That works for the DebugPthreads configuration but there is no way to set an empty string or otherwise disable the imported library for the other configurations.
n/a
I'm using cmake 2.8.2 and Visual Studio 2008.
No tags attached.
Issue History
2011-04-26 16:08Glenn CoombsNew Issue
2011-08-01 11:59David ColeTarget Version => CMake 2.8.6
2011-09-06 14:49David ColeNote Added: 0027379
2011-09-06 14:49David ColeTarget VersionCMake 2.8.6 =>
2012-08-11 11:38David ColeStatusnew => backlog
2012-08-11 11:38David ColeNote Added: 0030303
2013-11-02 10:44Stephen KellyNote Added: 0034325
2013-11-02 10:44Stephen KellyStatusbacklog => resolved
2013-11-02 10:44Stephen KellyFixed in Version => CMake 2.8.11
2013-11-02 10:44Stephen KellyResolutionopen => fixed
2013-11-02 10:44Stephen KellyAssigned To => Stephen Kelly
2014-06-02 08:37Robert MaynardNote Added: 0035990
2014-06-02 08:37Robert MaynardStatusresolved => closed

Notes
(0027379)
David Cole   
2011-09-06 14:49   
Not enough time left to address this issue before the 2.8.6 release. Deferred until a future release.
(0030303)
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.
(0034325)
Stephen Kelly   
2013-11-02 10:44   
Use

 target_link_libraries(foo $<$<CONFIG:DebugPthreads>:depend>)
(0035990)
Robert Maynard   
2014-06-02 08:37   
Closing resolved issues that have not been updated in more than 4 months.