summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-14 18:28:07 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-14 18:50:39 (GMT)
commit00e78c19903c24bb7cc969f3b825b2502661f3c0 (patch)
tree7de3b40f4c5208560a5053e1a9b7ec39035e4164 /Source/cmTarget.h
parent9d11bd50661a1fb0a079c7c17120273f21ea9a8c (diff)
downloadCMake-00e78c19903c24bb7cc969f3b825b2502661f3c0.zip
CMake-00e78c19903c24bb7cc969f3b825b2502661f3c0.tar.gz
CMake-00e78c19903c24bb7cc969f3b825b2502661f3c0.tar.bz2
cmTarget: Construct with basic information up front
Avoid having partially constructed cmTarget instances around, except for the special case of GLOBAL_TARGET construction.
Diffstat (limited to 'Source/cmTarget.h')
-rw-r--r--Source/cmTarget.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index b0bfc72..8a1d27e 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -63,7 +63,16 @@ private:
class cmTarget
{
public:
- cmTarget();
+ enum Visibility
+ {
+ VisibilityNormal,
+ VisibilityImported,
+ VisibilityImportedGlobally
+ };
+
+ cmTarget(std::string const& name, cmState::TargetType type, Visibility vis,
+ cmMakefile* mf);
+
enum CustomCommandType
{
PRE_BUILD,
@@ -76,21 +85,13 @@ public:
*/
cmState::TargetType GetType() const { return this->TargetTypeValue; }
- /**
- * Set the target type
- */
- void SetType(cmState::TargetType f, const std::string& name);
-
- void MarkAsImported(bool global = false);
-
///! Set/Get the name of the target
const std::string& GetName() const { return this->Name; }
/** Get a copy of this target adapted for the given directory. */
cmTarget CopyForDirectory(cmMakefile* mf) const;
- ///! Set the cmMakefile that owns this target
- void SetMakefile(cmMakefile* mf);
+ /** Get the cmMakefile that owns this target. */
cmMakefile* GetMakefile() const { return this->Makefile; }
#define DECLARE_TARGET_POLICY(POLICY) \
@@ -282,6 +283,9 @@ public:
};
private:
+ void SetType(cmState::TargetType f, const std::string& name);
+ void SetMakefile(cmMakefile* mf);
+
bool HandleLocationPropertyPolicy(cmMakefile* context) const;
const char* GetSuffixVariableInternal(bool implib) const;