Notes |
|
(0032154)
|
Brad King
|
2013-01-24 15:26
|
|
This is expected. Any use of LINK_PRIVATE or LINK_PUBLIC means that LINK_INTERFACE_LIBRARIES will be populated. Once this happens then any libraries not in the link interface will not be public anymore. It is only for historical reasons that having no explicit link interface means that everything is public by default. |
|
|
(0032155)
|
Brad King
|
2013-01-24 15:27
|
|
The LINK_* options are meant to allow everything in one command:
target_link_libraries(AvogadroIO LINK_PUBLIC AvogadroCore LINK_PRIVATE hdf5) |
|
|
(0032156)
|
Marcus D. Hanwell
|
2013-01-24 15:30
|
|
It would be helpful to make this clearer in the documentation (it wasn't clear to me when we read it). I didn't expect a second call to make previous libraries private, and assumed any calls made without such arguments would have maintained the previous behavior, i.e. being equivalent to calling with LINK_PUBLIC. |
|
|
(0032160)
|
Brad King
|
2013-01-24 15:48
|
|
Multiple signatures set the link interface so it makes more sense IMO to document in the old signature that the others may make its libraries private. How about this patch?
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index 34fe54c..3da3950 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -93,7 +93,9 @@ public:
"linked to this target will appear on the link line for the other "
"target too. "
"See the LINK_INTERFACE_LIBRARIES target property to override the "
- "set of transitive link dependencies for a target."
+ "set of transitive link dependencies for a target. "
+ "Calls to other signatures of this command may set the property "
+ "making any libraries linked exclusively by this signature private."
"\n"
" target_link_libraries(<target> LINK_INTERFACE_LIBRARIES\n"
" [[debug|optimized|general] <lib>] ...)\n"
|
|
|
(0032161)
|
Marcus D. Hanwell
|
2013-01-24 16:22
|
|
I think that is better, I still feel like this is a very surprising result (a subsequent call, possibly in a function/macro, changes the behavior of existing unchanged calls). I will remember to be careful with it, I am surprised that the standard call with no arguments is not equivalent to calling with LINK_PUBLIC (which was the previous default to the best of my understanding). I guess you are saying it is equivalent to silently inserting LINK_PRIVATE once any of the new forms of target_link_libraries are called. |
|
|
(0032162)
|
Brad King
|
2013-01-24 16:48
|
|
|
|
(0033192)
|
Robert Maynard
|
2013-06-03 09:05
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|