summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetLinkLibrariesCommand.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-06-04 14:21:33 (GMT)
committerBrad King <brad.king@kitware.com>2013-07-24 15:52:44 (GMT)
commitb655865bbf85e0bb9587dea099c5996836f48cb8 (patch)
treef8f7e299fc5eced4a6f100e1067622bb8f52d767 /Source/cmTargetLinkLibrariesCommand.h
parent828ddb68139a080594c2e6a96d57cb9e93d2ccb3 (diff)
downloadCMake-b655865bbf85e0bb9587dea099c5996836f48cb8.zip
CMake-b655865bbf85e0bb9587dea099c5996836f48cb8.tar.gz
CMake-b655865bbf85e0bb9587dea099c5996836f48cb8.tar.bz2
target_link_libraries: Add PUBLIC/PRIVATE/INTERFACE keyword signature
Add a new signature to help populate INTERFACE_LINK_LIBRARIES and LINK_LIBRARIES cleanly in a single call. Add policy CMP0023 to control whether the keyword signatures can be mixed with uses of the plain signatures on the same target.
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.h')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index e390343..f2b2543 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -113,6 +113,16 @@ public:
"directory of the framework will also be processed as a \"usage "
"requirement\". This has the same effect as passing the framework "
"directory as an include directory."
+ " target_link_libraries(<target>\n"
+ " <PRIVATE|PUBLIC|INTERFACE> <lib> ...\n"
+ " [<PRIVATE|PUBLIC|INTERFACE> <lib> ... ] ...])\n"
+ "The PUBLIC, PRIVATE and INTERFACE keywords can be used to specify "
+ "both the link dependencies and the link interface in one command. "
+ "Libraries and targets following PUBLIC are linked to, and are "
+ "made part of the link interface. Libraries and targets "
+ "following PRIVATE are linked to, but are not made part of the "
+ "link interface. Libraries following INTERFACE are appended "
+ "to the link interface and are not used for linking <target>."
"\n"
" target_link_libraries(<target> LINK_INTERFACE_LIBRARIES\n"
" [[debug|optimized|general] <lib>] ...)\n"
@@ -120,7 +130,8 @@ public:
"to the INTERFACE_LINK_LIBRARIES target property instead of using them "
"for linking. If policy CMP0022 is not NEW, then this mode also "
"appends libraries to the LINK_INTERFACE_LIBRARIES and its "
- "per-configuration equivalent. "
+ "per-configuration equivalent. This signature "
+ "is for compatibility only. Prefer the INTERFACE mode instead. "
"Libraries specified as \"debug\" are wrapped in a generator "
"expression to correspond to debug builds. If policy CMP0022 is not "
"NEW, the libraries are also appended to the "
@@ -139,7 +150,9 @@ public:
" [<LINK_PRIVATE|LINK_PUBLIC>\n"
" [[debug|optimized|general] <lib>] ...])\n"
"The LINK_PUBLIC and LINK_PRIVATE modes can be used to specify both "
- "the link dependencies and the link interface in one command. "
+ "the link dependencies and the link interface in one command. This "
+ "signature is for compatibility only. Prefer the PUBLIC or PRIVATE "
+ "keywords instead. "
"Libraries and targets following LINK_PUBLIC are linked to, and are "
"made part of the INTERFACE_LINK_LIBRARIES. If policy CMP0022 is not "
"NEW, they are also made part of the LINK_INTERFACE_LIBRARIES. "
@@ -185,14 +198,17 @@ private:
cmTarget* Target;
enum ProcessingState {
ProcessingLinkLibraries,
- ProcessingLinkInterface,
- ProcessingPublicInterface,
- ProcessingPrivateInterface
+ ProcessingPlainLinkInterface,
+ ProcessingKeywordLinkInterface,
+ ProcessingPlainPublicInterface,
+ ProcessingKeywordPublicInterface,
+ ProcessingPlainPrivateInterface,
+ ProcessingKeywordPrivateInterface
};
ProcessingState CurrentProcessingState;
- void HandleLibrary(const char* lib, cmTarget::LinkLibraryType llt);
+ bool HandleLibrary(const char* lib, cmTarget::LinkLibraryType llt);
};