86
94
///! Set/Get the name of the target
87
95
const char* GetName() const {return this->Name.c_str();}
96
const char* GetExportName();
89
98
///! Set the cmMakefile that owns this target
90
99
void SetMakefile(cmMakefile *mf);
91
100
cmMakefile *GetMakefile() const { return this->Makefile;};
93
/** Get the status of policy CMP0003 when the target was created. */
94
cmPolicies::PolicyStatus GetPolicyStatusCMP0003() const
95
{ return this->PolicyStatusCMP0003; }
97
/** Get the status of policy CMP0004 when the target was created. */
98
cmPolicies::PolicyStatus GetPolicyStatusCMP0004() const
99
{ return this->PolicyStatusCMP0004; }
101
/** Get the status of policy CMP0008 when the target was created. */
102
cmPolicies::PolicyStatus GetPolicyStatusCMP0008() const
103
{ return this->PolicyStatusCMP0008; }
105
/** Get the status of policy CMP0020 when the target was created. */
106
cmPolicies::PolicyStatus GetPolicyStatusCMP0020() const
107
{ return this->PolicyStatusCMP0020; }
102
#define DECLARE_TARGET_POLICY(POLICY) \
103
cmPolicies::PolicyStatus GetPolicyStatus ## POLICY () const \
104
{ return this->PolicyStatus ## POLICY; }
106
CM_FOR_EACH_TARGET_POLICY(DECLARE_TARGET_POLICY)
108
#undef DECLARE_TARGET_POLICY
110
111
* Get the list of the custom commands for this target
189
190
void AddLinkLibrary(cmMakefile& mf,
190
191
const char *target, const char* lib,
191
192
LinkLibraryType llt);
197
bool PushTLLCommandTrace(TLLSignature signature);
198
void GetTllSignatureTraces(cmOStringStream &s, TLLSignature sig) const;
193
200
void MergeLinkLibraries( cmMakefile& mf, const char* selfname,
194
201
const LinkLibraryVectorType& libs );
271
278
if the target cannot be linked. */
272
279
LinkInterface const* GetLinkInterface(const char* config,
273
280
cmTarget *headTarget);
281
void GetTransitivePropertyLinkLibraries(const char* config,
282
cmTarget *headTarget,
283
std::vector<std::string> &libs);
275
285
/** The link implementation specifies the direct library
276
286
dependencies needed by the object files of the target. */
336
346
* Trace through the source files in this target and add al source files
337
347
* that they depend on, used by all generators
339
void TraceDependencies(const char* vsProjectFile);
349
void TraceDependencies();
342
352
* Make sure the full path to all source files is known.
362
372
/** Get the soname of the target. Allowed only for a shared library. */
363
373
std::string GetSOName(const char* config);
375
/** Whether this library has @rpath and platform supports it. */
376
bool HasMacOSXRpath(const char* config);
365
378
/** Test for special case of a third-party shared library that has
366
379
no soname at all. */
367
380
bool IsImportedSharedLibWithoutSOName(const char* config);
407
420
/** Return true if builtin chrpath will work for this target */
408
421
bool IsChrpathUsed(const char* config);
410
std::string GetInstallNameDirForBuildTree(const char* config,
411
bool for_xcode = false);
412
std::string GetInstallNameDirForInstallTree(const char* config,
413
bool for_xcode = false);
423
/** Return the install name directory for the target in the
424
* build tree. For example: "@rpath/", "@loader_path/",
425
* or "/full/path/to/library". */
426
std::string GetInstallNameDirForBuildTree(const char* config);
428
/** Return the install name directory for the target in the
429
* install tree. For example: "@rpath/" or "@loader_path/". */
430
std::string GetInstallNameDirForInstallTree();
415
432
cmComputeLinkInformation* GetLinkInformation(const char* config,
416
433
cmTarget *head = 0);
430
447
If no macro should be defined null is returned. */
431
448
const char* GetExportMacro();
433
std::string GetCompileDefinitions(const char *config);
450
void GetCompileDefinitions(std::vector<std::string> &result,
435
453
// Compute the set of languages compiled by the target. This is
436
454
// computed every time it is called because the languages can change
462
480
/** Return whether this target is an executable Bundle on Apple. */
463
481
bool IsAppBundleOnApple();
483
/** Return whether this target is an executable Bundle, a framework
484
or CFBundle on Apple. */
485
bool IsBundleOnApple();
465
487
/** Return the framework version string. Undefined if
466
488
IsFrameworkOnApple returns false. */
467
489
std::string GetFrameworkVersion();
477
499
bool UsesDefaultOutputDir(const char* config, bool implib);
479
/** Append to @a base the mac content directory and return it. */
480
std::string BuildMacContentDirectory(const std::string& base,
481
const char* config = 0,
482
bool includeMacOS = true);
484
501
/** @return the mac content directory for this target. */
485
std::string GetMacContentDirectory(const char* config = 0,
487
bool includeMacOS = true);
502
std::string GetMacContentDirectory(const char* config,
489
505
/** @return whether this target have a well defined output file name. */
490
506
bool HaveWellDefinedOutputFiles();
492
508
/** @return the Mac framework directory without the base. */
493
std::string GetFrameworkDirectory(const char* config = 0);
509
std::string GetFrameworkDirectory(const char* config, bool rootDir);
511
/** @return the Mac CFBundle directory without the base */
512
std::string GetCFBundleDirectory(const char* config, bool contentOnly);
514
/** @return the Mac App directory without the base */
515
std::string GetAppBundleDirectory(const char* config, bool contentOnly);
495
517
std::vector<std::string> GetIncludeDirectories(const char *config);
496
518
void InsertInclude(const cmValueWithOrigin &entry,
497
519
bool before = false);
520
void InsertCompileOption(const cmValueWithOrigin &entry,
521
bool before = false);
522
void InsertCompileDefinition(const cmValueWithOrigin &entry,
523
bool before = false);
499
525
void AppendBuildInterfaceIncludes();
527
void GetCompileOptions(std::vector<std::string> &result,
501
530
bool IsNullImpliedByLinkLibraries(const std::string &p);
502
531
bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
503
532
const char *config);
513
542
std::string GetDebugGeneratorExpressions(const std::string &value,
514
543
cmTarget::LinkLibraryType llt);
545
void AddSystemIncludeDirectories(const std::set<cmStdString> &incs);
546
void AddSystemIncludeDirectories(const std::vector<std::string> &incs);
547
std::set<cmStdString> const & GetSystemIncludeDirectories() const
548
{ return this->SystemIncludeDirectories; }
550
void FinalizeSystemIncludeDirectories();
552
bool LinkLanguagePropagatesToDependents() const
553
{ return this->TargetTypeValue == STATIC_LIBRARY; }
556
// The set of include directories that are marked as system include
558
std::set<cmStdString> SystemIncludeDirectories;
560
std::vector<std::pair<TLLSignature, cmListFileBacktrace> > TLLCommands;
517
563
* A list of direct dependencies. Use in conjunction with DependencyMap.
596
642
the same as GetFullName. */
597
643
std::string NormalGetRealName(const char* config);
645
/** Append to @a base the mac content directory and return it. */
646
std::string BuildMacContentDirectory(const std::string& base,
600
651
std::string Name;
601
652
std::vector<cmCustomCommand> PreBuildCommands;
660
713
cmMakefile* Makefile;
662
715
// Policy status recorded when target was created.
663
cmPolicies::PolicyStatus PolicyStatusCMP0003;
664
cmPolicies::PolicyStatus PolicyStatusCMP0004;
665
cmPolicies::PolicyStatus PolicyStatusCMP0008;
666
cmPolicies::PolicyStatus PolicyStatusCMP0020;
716
#define TARGET_POLICY_MEMBER(POLICY) \
717
cmPolicies::PolicyStatus PolicyStatus ## POLICY;
719
CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_MEMBER)
721
#undef TARGET_POLICY_MEMBER
668
723
// Internal representation details.
669
724
friend class cmTargetInternals;