summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetLinkLibrariesCommand.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-08-11 20:23:02 (GMT)
committerBrad King <brad.king@kitware.com>2008-08-11 20:23:02 (GMT)
commite322d288af7a2e9f413a703e07399976377c7dd0 (patch)
treee6b7c9d816deaacc25a7df4ac90d8ba337da0581 /Source/cmTargetLinkLibrariesCommand.h
parent881a0345d0504ebc2301ba9e234bc4dbbdbaf342 (diff)
downloadCMake-e322d288af7a2e9f413a703e07399976377c7dd0.zip
CMake-e322d288af7a2e9f413a703e07399976377c7dd0.tar.gz
CMake-e322d288af7a2e9f413a703e07399976377c7dd0.tar.bz2
ENH: Simple specification of link interfaces
Create an INTERFACE option to the target_link_libraries command to help set the LINK_INTERFACE_LIBRARIES and LINK_INTERFACE_LIBRARIES_DEBUG properties. This will help users specify link interfaces using variables from Find*.cmake modules that include the 'debug' and 'optimized' keywords.
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.h')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.h46
1 files changed, 38 insertions, 8 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index ccf86ad..6a9c0f4 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -64,23 +64,53 @@ public:
virtual const char* GetFullDocumentation()
{
return
- " target_link_libraries(target library1\n"
- " <debug | optimized | general> library2\n"
- " ...)\n"
+ " target_link_libraries(<target> [INTERFACE]\n"
+ " [[debug|optimized|general] <lib>] ...)\n"
"Specify a list of libraries to be linked into the specified target. "
- "The debug and optimized strings may be used to indicate that "
- "the next library listed is to be used only for that specific "
- "type of build. general indicates it is used for all build types "
- "and is assumed if not specified.\n"
"If any library name matches that of a target in the current project "
"a dependency will automatically be added in the build system to make "
- "sure the library being linked is up-to-date before the target links.";
+ "sure the library being linked is up-to-date before the target links."
+ "\n"
+ "A \"debug\", \"optimized\", or \"general\" keyword indicates that "
+ "the library immediately following it is to be used only for the "
+ "corresponding build configuration. "
+ "The \"debug\" keyword corresponds to the Debug configuration. "
+ "The \"optimized\" keyword corresponds to all other configurations. "
+ "The \"general\" keyword corresponds to all configurations, and is "
+ "purely optional (assumed if omitted). "
+ "Higher granularity may be achieved for per-configuration rules "
+ "by creating and linking to IMPORTED library targets. "
+ "See the IMPORTED mode of the add_library command for more "
+ "information. "
+ "\n"
+ "Library dependencies are transitive by default. "
+ "When this target is linked into another target then the libraries "
+ "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."
+ "\n"
+ "The INTERFACE option tells the command to append the libraries "
+ "to the LINK_INTERFACE_LIBRARIES and LINK_INTERFACE_LIBRARIES_DEBUG "
+ "target properties instead of using them for linking. "
+ "Libraries specified as \"debug\" are appended to the "
+ "the LINK_INTERFACE_LIBRARIES_DEBUG property. "
+ "Libraries specified as \"optimized\" are appended to the "
+ "the LINK_INTERFACE_LIBRARIES property. "
+ "Libraries specified as \"general\" (or without any keyword) are "
+ "appended to both properties."
+ ;
}
cmTypeMacro(cmTargetLinkLibrariesCommand, cmCommand);
private:
void LinkLibraryTypeSpecifierWarning(int left, int right);
static const char* LinkLibraryTypeNames[3];
+
+ cmTarget* Target;
+ bool DoingInterface;
+
+ void HandleLibrary(const char* lib, cmTarget::LinkLibraryType llt);
};