2016-10-30 18:24:19 +01:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2008-10-12 18:41:06 +02:00
|
|
|
#ifndef cmTargetLinkLibrariesCommand_h
|
|
|
|
#define cmTargetLinkLibrariesCommand_h
|
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2017-07-20 19:35:53 +02:00
|
|
|
|
2017-04-14 19:02:05 +02:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2008-10-12 18:41:06 +02:00
|
|
|
#include "cmCommand.h"
|
2017-04-14 19:02:05 +02:00
|
|
|
#include "cmTargetLinkLibraryType.h"
|
|
|
|
|
|
|
|
class cmExecutionStatus;
|
|
|
|
class cmTarget;
|
2008-10-12 18:41:06 +02:00
|
|
|
|
|
|
|
/** \class cmTargetLinkLibrariesCommand
|
|
|
|
* \brief Specify a list of libraries to link into executables.
|
|
|
|
*
|
|
|
|
* cmTargetLinkLibrariesCommand is used to specify a list of libraries to link
|
|
|
|
* into executable(s) or shared objects. The names of the libraries
|
2012-02-18 12:40:36 +02:00
|
|
|
* should be those defined by the LIBRARY(library) command(s).
|
2018-04-23 21:13:27 +02:00
|
|
|
*
|
|
|
|
* Additionally, it allows to propagate usage-requirements (including link
|
|
|
|
* libraries) from one target into another.
|
2008-10-12 18:41:06 +02:00
|
|
|
*/
|
|
|
|
class cmTargetLinkLibrariesCommand : public cmCommand
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* This is a virtual constructor for the command.
|
|
|
|
*/
|
2018-01-26 17:06:56 +01:00
|
|
|
cmCommand* Clone() override { return new cmTargetLinkLibrariesCommand; }
|
2008-10-12 18:41:06 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is called when the command is first encountered in
|
|
|
|
* the CMakeLists.txt file.
|
|
|
|
*/
|
2016-10-30 18:24:19 +01:00
|
|
|
bool InitialPass(std::vector<std::string> const& args,
|
2018-01-26 17:06:56 +01:00
|
|
|
cmExecutionStatus& status) override;
|
2008-10-12 18:41:06 +02:00
|
|
|
|
|
|
|
private:
|
2008-10-12 21:55:53 +03:00
|
|
|
void LinkLibraryTypeSpecifierWarning(int left, int right);
|
|
|
|
static const char* LinkLibraryTypeNames[3];
|
|
|
|
|
|
|
|
cmTarget* Target;
|
2016-07-09 11:21:54 +02:00
|
|
|
enum ProcessingState
|
|
|
|
{
|
2012-02-18 12:40:36 +02:00
|
|
|
ProcessingLinkLibraries,
|
2013-11-03 12:27:13 +02:00
|
|
|
ProcessingPlainLinkInterface,
|
|
|
|
ProcessingKeywordLinkInterface,
|
|
|
|
ProcessingPlainPublicInterface,
|
|
|
|
ProcessingKeywordPublicInterface,
|
|
|
|
ProcessingPlainPrivateInterface,
|
|
|
|
ProcessingKeywordPrivateInterface
|
2012-02-18 12:40:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
ProcessingState CurrentProcessingState;
|
2008-10-12 21:55:53 +03:00
|
|
|
|
2016-03-13 13:35:51 +01:00
|
|
|
bool HandleLibrary(const std::string& lib, cmTargetLinkLibraryType llt);
|
2008-10-12 18:41:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|