cmTarget.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmTarget_h
  11. #define cmTarget_h
  12. #include "cmCustomCommand.h"
  13. #include "cmPropertyMap.h"
  14. #include "cmPolicies.h"
  15. #include "cmMakefileIncludeDirectoriesEntry.h"
  16. #include <cmsys/auto_ptr.hxx>
  17. class cmake;
  18. class cmMakefile;
  19. class cmSourceFile;
  20. class cmGlobalGenerator;
  21. class cmComputeLinkInformation;
  22. class cmListFileBacktrace;
  23. class cmTarget;
  24. struct cmTargetLinkInformationMap:
  25. public std::map<std::pair<cmTarget*, std::string>, cmComputeLinkInformation*>
  26. {
  27. typedef std::map<std::pair<cmTarget*, std::string>,
  28. cmComputeLinkInformation*> derived;
  29. cmTargetLinkInformationMap() {}
  30. cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r);
  31. ~cmTargetLinkInformationMap();
  32. };
  33. class cmTargetInternals;
  34. class cmTargetInternalPointer
  35. {
  36. public:
  37. cmTargetInternalPointer();
  38. cmTargetInternalPointer(cmTargetInternalPointer const& r);
  39. ~cmTargetInternalPointer();
  40. cmTargetInternalPointer& operator=(cmTargetInternalPointer const& r);
  41. cmTargetInternals* operator->() const { return this->Pointer; }
  42. cmTargetInternals* Get() const { return this->Pointer; }
  43. private:
  44. cmTargetInternals* Pointer;
  45. };
  46. /** \class cmTarget
  47. * \brief Represent a library or executable target loaded from a makefile.
  48. *
  49. * cmTarget represents a target loaded from
  50. * a makefile.
  51. */
  52. class cmTarget
  53. {
  54. public:
  55. cmTarget();
  56. enum TargetType { EXECUTABLE, STATIC_LIBRARY,
  57. SHARED_LIBRARY, MODULE_LIBRARY,
  58. OBJECT_LIBRARY, UTILITY, GLOBAL_TARGET,
  59. UNKNOWN_LIBRARY};
  60. static const char* GetTargetTypeName(TargetType targetType);
  61. enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };
  62. /**
  63. * Return the type of target.
  64. */
  65. TargetType GetType() const
  66. {
  67. return this->TargetTypeValue;
  68. }
  69. /**
  70. * Set the target type
  71. */
  72. void SetType(TargetType f, const char* name);
  73. void MarkAsImported();
  74. ///! Set/Get the name of the target
  75. const char* GetName() const {return this->Name.c_str();}
  76. ///! Set the cmMakefile that owns this target
  77. void SetMakefile(cmMakefile *mf);
  78. cmMakefile *GetMakefile() const { return this->Makefile;};
  79. /** Get the status of policy CMP0003 when the target was created. */
  80. cmPolicies::PolicyStatus GetPolicyStatusCMP0003() const
  81. { return this->PolicyStatusCMP0003; }
  82. /** Get the status of policy CMP0004 when the target was created. */
  83. cmPolicies::PolicyStatus GetPolicyStatusCMP0004() const
  84. { return this->PolicyStatusCMP0004; }
  85. /** Get the status of policy CMP0008 when the target was created. */
  86. cmPolicies::PolicyStatus GetPolicyStatusCMP0008() const
  87. { return this->PolicyStatusCMP0008; }
  88. /**
  89. * Get the list of the custom commands for this target
  90. */
  91. std::vector<cmCustomCommand> &GetPreBuildCommands()
  92. {return this->PreBuildCommands;}
  93. std::vector<cmCustomCommand> &GetPreLinkCommands()
  94. {return this->PreLinkCommands;}
  95. std::vector<cmCustomCommand> &GetPostBuildCommands()
  96. {return this->PostBuildCommands;}
  97. /**
  98. * Get the list of the source files used by this target
  99. */
  100. std::vector<cmSourceFile*> const& GetSourceFiles();
  101. void AddSourceFile(cmSourceFile* sf);
  102. std::vector<std::string> const& GetObjectLibraries() const
  103. {
  104. return this->ObjectLibraries;
  105. }
  106. /** Get sources that must be built before the given source. */
  107. std::vector<cmSourceFile*> const* GetSourceDepends(cmSourceFile* sf);
  108. /**
  109. * Flags for a given source file as used in this target. Typically assigned
  110. * via SET_TARGET_PROPERTIES when the property is a list of source files.
  111. */
  112. enum SourceFileType
  113. {
  114. SourceFileTypeNormal,
  115. SourceFileTypePrivateHeader, // is in "PRIVATE_HEADER" target property
  116. SourceFileTypePublicHeader, // is in "PUBLIC_HEADER" target property
  117. SourceFileTypeResource, // is in "RESOURCE" target property *or*
  118. // has MACOSX_PACKAGE_LOCATION=="Resources"
  119. SourceFileTypeMacContent // has MACOSX_PACKAGE_LOCATION!="Resources"
  120. };
  121. struct SourceFileFlags
  122. {
  123. SourceFileFlags(): Type(SourceFileTypeNormal), MacFolder(0) {}
  124. SourceFileFlags(SourceFileFlags const& r):
  125. Type(r.Type), MacFolder(r.MacFolder) {}
  126. SourceFileType Type;
  127. const char* MacFolder; // location inside Mac content folders
  128. };
  129. /**
  130. * Get the flags for a given source file as used in this target
  131. */
  132. struct SourceFileFlags GetTargetSourceFileFlags(const cmSourceFile* sf);
  133. /**
  134. * Add sources to the target.
  135. */
  136. void AddSources(std::vector<std::string> const& srcs);
  137. cmSourceFile* AddSource(const char* src);
  138. enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED};
  139. //* how we identify a library, by name and type
  140. typedef std::pair<cmStdString, LinkLibraryType> LibraryID;
  141. typedef std::vector<LibraryID > LinkLibraryVectorType;
  142. const LinkLibraryVectorType &GetLinkLibraries() const {
  143. return this->LinkLibraries;}
  144. const LinkLibraryVectorType &GetOriginalLinkLibraries() const
  145. {return this->OriginalLinkLibraries;}
  146. void GetDirectLinkLibraries(const char *config,
  147. std::vector<std::string> &,
  148. cmTarget *head);
  149. /** Compute the link type to use for the given configuration. */
  150. LinkLibraryType ComputeLinkType(const char* config);
  151. /**
  152. * Clear the dependency information recorded for this target, if any.
  153. */
  154. void ClearDependencyInformation(cmMakefile& mf, const char* target);
  155. // Check to see if a library is a framework and treat it different on Mac
  156. bool NameResolvesToFramework(const std::string& libname);
  157. void AddLinkLibrary(cmMakefile& mf,
  158. const char *target, const char* lib,
  159. LinkLibraryType llt);
  160. void MergeLinkLibraries( cmMakefile& mf, const char* selfname,
  161. const LinkLibraryVectorType& libs );
  162. const std::vector<std::string>& GetLinkDirectories();
  163. void AddLinkDirectory(const char* d);
  164. /**
  165. * Set the path where this target should be installed. This is relative to
  166. * INSTALL_PREFIX
  167. */
  168. std::string GetInstallPath() {return this->InstallPath;}
  169. void SetInstallPath(const char *name) {this->InstallPath = name;}
  170. /**
  171. * Set the path where this target (if it has a runtime part) should be
  172. * installed. This is relative to INSTALL_PREFIX
  173. */
  174. std::string GetRuntimeInstallPath() {return this->RuntimeInstallPath;}
  175. void SetRuntimeInstallPath(const char *name) {
  176. this->RuntimeInstallPath = name; }
  177. /**
  178. * Get/Set whether there is an install rule for this target.
  179. */
  180. bool GetHaveInstallRule() { return this->HaveInstallRule; }
  181. void SetHaveInstallRule(bool h) { this->HaveInstallRule = h; }
  182. /** Add a utility on which this project depends. A utility is an executable
  183. * name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE
  184. * commands. It is not a full path nor does it have an extension.
  185. */
  186. void AddUtility(const char* u) { this->Utilities.insert(u);}
  187. ///! Get the utilities used by this target
  188. std::set<cmStdString>const& GetUtilities() const { return this->Utilities; }
  189. /** Finalize the target at the end of the Configure step. */
  190. void FinishConfigure();
  191. ///! Set/Get a property of this target file
  192. void SetProperty(const char *prop, const char *value);
  193. void AppendProperty(const char* prop, const char* value,bool asString=false);
  194. const char *GetProperty(const char *prop);
  195. const char *GetProperty(const char *prop, cmProperty::ScopeType scope);
  196. bool GetPropertyAsBool(const char *prop);
  197. void CheckProperty(const char* prop, cmMakefile* context);
  198. const char* GetFeature(const char* feature, const char* config);
  199. bool IsImported() const {return this->IsImportedTarget;}
  200. /** The link interface specifies transitive library dependencies and
  201. other information needed by targets that link to this target. */
  202. struct LinkInterface
  203. {
  204. // Languages whose runtime libraries must be linked.
  205. std::vector<std::string> Languages;
  206. // Libraries listed in the interface.
  207. std::vector<std::string> Libraries;
  208. // Shared library dependencies needed for linking on some platforms.
  209. std::vector<std::string> SharedDeps;
  210. // Number of repetitions of a strongly connected component of two
  211. // or more static libraries.
  212. int Multiplicity;
  213. // Libraries listed for other configurations.
  214. // Needed only for OLD behavior of CMP0003.
  215. std::vector<std::string> WrongConfigLibraries;
  216. LinkInterface(): Multiplicity(0) {}
  217. };
  218. /** Get the link interface for the given configuration. Returns 0
  219. if the target cannot be linked. */
  220. LinkInterface const* GetLinkInterface(const char* config,
  221. cmTarget *headTarget);
  222. /** The link implementation specifies the direct library
  223. dependencies needed by the object files of the target. */
  224. struct LinkImplementation
  225. {
  226. // Languages whose runtime libraries must be linked.
  227. std::vector<std::string> Languages;
  228. // Libraries linked directly in this configuration.
  229. std::vector<std::string> Libraries;
  230. // Libraries linked directly in other configurations.
  231. // Needed only for OLD behavior of CMP0003.
  232. std::vector<std::string> WrongConfigLibraries;
  233. };
  234. LinkImplementation const* GetLinkImplementation(const char* config,
  235. cmTarget *head);
  236. /** Link information from the transitive closure of the link
  237. implementation and the interfaces of its dependencies. */
  238. struct LinkClosure
  239. {
  240. // The preferred linker language.
  241. std::string LinkerLanguage;
  242. // Languages whose runtime libraries must be linked.
  243. std::vector<std::string> Languages;
  244. };
  245. LinkClosure const* GetLinkClosure(const char* config, cmTarget *head);
  246. /** Strip off leading and trailing whitespace from an item named in
  247. the link dependencies of this target. */
  248. std::string CheckCMP0004(std::string const& item);
  249. /** Get the directory in which this target will be built. If the
  250. configuration name is given then the generator will add its
  251. subdirectory for that configuration. Otherwise just the canonical
  252. output directory is given. */
  253. std::string GetDirectory(const char* config = 0, bool implib = false);
  254. /** Get the directory in which this targets .pdb files will be placed.
  255. If the configuration name is given then the generator will add its
  256. subdirectory for that configuration. Otherwise just the canonical
  257. pdb output directory is given. */
  258. std::string GetPDBDirectory(const char* config = 0);
  259. /** Get the location of the target in the build tree for the given
  260. configuration. This location is suitable for use as the LOCATION
  261. target property. */
  262. const char* GetLocation(const char* config);
  263. /** Get the target major and minor version numbers interpreted from
  264. the VERSION property. Version 0 is returned if the property is
  265. not set or cannot be parsed. */
  266. void GetTargetVersion(int& major, int& minor);
  267. /** Get the target major, minor, and patch version numbers
  268. interpreted from the VERSION or SOVERSION property. Version 0
  269. is returned if the property is not set or cannot be parsed. */
  270. void GetTargetVersion(bool soversion, int& major, int& minor, int& patch);
  271. /**
  272. * Trace through the source files in this target and add al source files
  273. * that they depend on, used by all generators
  274. */
  275. void TraceDependencies(const char* vsProjectFile);
  276. /**
  277. * Make sure the full path to all source files is known.
  278. */
  279. bool FindSourceFiles();
  280. ///! Return the preferred linker language for this target
  281. const char* GetLinkerLanguage(const char* config = 0, cmTarget *head = 0);
  282. /** Get the full name of the target according to the settings in its
  283. makefile. */
  284. std::string GetFullName(const char* config=0, bool implib = false);
  285. void GetFullNameComponents(std::string& prefix,
  286. std::string& base, std::string& suffix,
  287. const char* config=0, bool implib = false);
  288. /** Get the name of the pdb file for the target. */
  289. std::string GetPDBName(const char* config=0);
  290. /** Whether this library has soname enabled and platform supports it. */
  291. bool HasSOName(const char* config);
  292. /** Get the soname of the target. Allowed only for a shared library. */
  293. std::string GetSOName(const char* config);
  294. /** Test for special case of a third-party shared library that has
  295. no soname at all. */
  296. bool IsImportedSharedLibWithoutSOName(const char* config);
  297. /** Get the full path to the target according to the settings in its
  298. makefile and the configuration type. */
  299. std::string GetFullPath(const char* config=0, bool implib = false,
  300. bool realname = false);
  301. /** Get the names of the library needed to generate a build rule
  302. that takes into account shared library version numbers. This
  303. should be called only on a library target. */
  304. void GetLibraryNames(std::string& name, std::string& soName,
  305. std::string& realName, std::string& impName,
  306. std::string& pdbName, const char* config);
  307. /** Get the names of the executable needed to generate a build rule
  308. that takes into account executable version numbers. This should
  309. be called only on an executable target. */
  310. void GetExecutableNames(std::string& name, std::string& realName,
  311. std::string& impName,
  312. std::string& pdbName, const char* config);
  313. /** Does this target have a GNU implib to convert to MS format? */
  314. bool HasImplibGNUtoMS();
  315. /** Convert the given GNU import library name (.dll.a) to a name with a new
  316. extension (.lib or ${CMAKE_IMPORT_LIBRARY_SUFFIX}). */
  317. bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
  318. const char* newExt = 0);
  319. /** Add the target output files to the global generator manifest. */
  320. void GenerateTargetManifest(const char* config);
  321. /**
  322. * Compute whether this target must be relinked before installing.
  323. */
  324. bool NeedRelinkBeforeInstall(const char* config);
  325. bool HaveBuildTreeRPATH();
  326. bool HaveInstallTreeRPATH();
  327. /** Return true if builtin chrpath will work for this target */
  328. bool IsChrpathUsed(const char* config);
  329. std::string GetInstallNameDirForBuildTree(const char* config,
  330. bool for_xcode = false);
  331. std::string GetInstallNameDirForInstallTree(const char* config,
  332. bool for_xcode = false);
  333. cmComputeLinkInformation* GetLinkInformation(const char* config,
  334. cmTarget *head = 0);
  335. // Get the properties
  336. cmPropertyMap &GetProperties() { return this->Properties; };
  337. bool GetMappedConfig(std::string const& desired_config,
  338. const char** loc,
  339. const char** imp,
  340. std::string& suffix);
  341. // Define the properties
  342. static void DefineProperties(cmake *cm);
  343. /** Get the macro to define when building sources in this target.
  344. If no macro should be defined null is returned. */
  345. const char* GetExportMacro();
  346. // Compute the set of languages compiled by the target. This is
  347. // computed every time it is called because the languages can change
  348. // when source file properties are changed and we do not have enough
  349. // information to forward these property changes to the targets
  350. // until we have per-target object file properties.
  351. void GetLanguages(std::set<cmStdString>& languages) const;
  352. /** Return whether this target is an executable with symbol exports
  353. enabled. */
  354. bool IsExecutableWithExports();
  355. /** Return whether this target may be used to link another target. */
  356. bool IsLinkable();
  357. /** Return whether or not the target is for a DLL platform. */
  358. bool IsDLLPlatform() { return this->DLLPlatform; }
  359. /** Return whether or not the target has a DLL import library. */
  360. bool HasImportLibrary();
  361. /** Return whether this target is a shared library Framework on
  362. Apple. */
  363. bool IsFrameworkOnApple();
  364. /** Return whether this target is a CFBundle (plugin) on Apple. */
  365. bool IsCFBundleOnApple();
  366. /** Return whether this target is an executable Bundle on Apple. */
  367. bool IsAppBundleOnApple();
  368. /** Return the framework version string. Undefined if
  369. IsFrameworkOnApple returns false. */
  370. std::string GetFrameworkVersion();
  371. /** Get a backtrace from the creation of the target. */
  372. cmListFileBacktrace const& GetBacktrace() const;
  373. /** Get a build-tree directory in which to place target support files. */
  374. std::string GetSupportDirectory() const;
  375. /** Return whether this target uses the default value for its output
  376. directory. */
  377. bool UsesDefaultOutputDir(const char* config, bool implib);
  378. /** Append to @a base the mac content directory and return it. */
  379. std::string BuildMacContentDirectory(const std::string& base,
  380. const char* config = 0,
  381. bool includeMacOS = true);
  382. /** @return the mac content directory for this target. */
  383. std::string GetMacContentDirectory(const char* config = 0,
  384. bool implib = false,
  385. bool includeMacOS = true);
  386. /** @return whether this target have a well defined output file name. */
  387. bool HaveWellDefinedOutputFiles();
  388. /** @return the Mac framework directory without the base. */
  389. std::string GetFrameworkDirectory(const char* config = 0);
  390. std::vector<std::string> GetIncludeDirectories(const char *config);
  391. void InsertInclude(const cmMakefileIncludeDirectoriesEntry &entry,
  392. bool before = false);
  393. private:
  394. /**
  395. * A list of direct dependencies. Use in conjunction with DependencyMap.
  396. */
  397. typedef std::vector< LibraryID > DependencyList;
  398. /**
  399. * This map holds the dependency graph. map[x] returns a set of
  400. * direct dependencies of x. Note that the direct depenencies are
  401. * ordered. This is necessary to handle direct dependencies that
  402. * themselves have no dependency information.
  403. */
  404. typedef std::map< LibraryID, DependencyList > DependencyMap;
  405. /**
  406. * Inserts \a dep at the end of the dependency list of \a lib.
  407. */
  408. void InsertDependency( DependencyMap& depMap,
  409. const LibraryID& lib,
  410. const LibraryID& dep);
  411. /*
  412. * Deletes \a dep from the dependency list of \a lib.
  413. */
  414. void DeleteDependency( DependencyMap& depMap,
  415. const LibraryID& lib,
  416. const LibraryID& dep);
  417. /**
  418. * Emits the library \a lib and all its dependencies into link_line.
  419. * \a emitted keeps track of the libraries that have been emitted to
  420. * avoid duplicates--it is more efficient than searching
  421. * link_line. \a visited is used detect cycles. Note that \a
  422. * link_line is in reverse order, in that the dependencies of a
  423. * library are listed before the library itself.
  424. */
  425. void Emit( const LibraryID lib,
  426. const DependencyMap& dep_map,
  427. std::set<LibraryID>& emitted,
  428. std::set<LibraryID>& visited,
  429. DependencyList& link_line);
  430. /**
  431. * Finds the dependencies for \a lib and inserts them into \a
  432. * dep_map.
  433. */
  434. void GatherDependencies( const cmMakefile& mf,
  435. const LibraryID& lib,
  436. DependencyMap& dep_map);
  437. void AnalyzeLibDependencies( const cmMakefile& mf );
  438. const char* GetSuffixVariableInternal(bool implib);
  439. const char* GetPrefixVariableInternal(bool implib);
  440. std::string GetFullNameInternal(const char* config, bool implib);
  441. void GetFullNameInternal(const char* config, bool implib,
  442. std::string& outPrefix, std::string& outBase,
  443. std::string& outSuffix);
  444. // Use a makefile variable to set a default for the given property.
  445. // If the variable is not defined use the given default instead.
  446. void SetPropertyDefault(const char* property, const char* default_value);
  447. // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
  448. const char* GetOutputTargetType(bool implib);
  449. // Get the target base name.
  450. std::string GetOutputName(const char* config, bool implib);
  451. const char* ImportedGetLocation(const char* config);
  452. const char* NormalGetLocation(const char* config);
  453. std::string GetFullNameImported(const char* config, bool implib);
  454. std::string ImportedGetFullPath(const char* config, bool implib);
  455. std::string NormalGetFullPath(const char* config, bool implib,
  456. bool realname);
  457. /** Get the real name of the target. Allowed only for non-imported
  458. targets. When a library or executable file is versioned this is
  459. the full versioned name. If the target is not versioned this is
  460. the same as GetFullName. */
  461. std::string NormalGetRealName(const char* config);
  462. private:
  463. std::string Name;
  464. std::vector<cmCustomCommand> PreBuildCommands;
  465. std::vector<cmCustomCommand> PreLinkCommands;
  466. std::vector<cmCustomCommand> PostBuildCommands;
  467. TargetType TargetTypeValue;
  468. std::vector<cmSourceFile*> SourceFiles;
  469. std::vector<std::string> ObjectLibraries;
  470. LinkLibraryVectorType LinkLibraries;
  471. LinkLibraryVectorType PrevLinkedLibraries;
  472. bool LinkLibrariesAnalyzed;
  473. std::vector<std::string> LinkDirectories;
  474. std::set<cmStdString> LinkDirectoriesEmmitted;
  475. bool HaveInstallRule;
  476. std::string InstallPath;
  477. std::string RuntimeInstallPath;
  478. std::string Location;
  479. std::string ExportMacro;
  480. std::set<cmStdString> Utilities;
  481. bool RecordDependencies;
  482. cmPropertyMap Properties;
  483. LinkLibraryVectorType OriginalLinkLibraries;
  484. bool DLLPlatform;
  485. bool IsApple;
  486. bool IsImportedTarget;
  487. // Cache target output paths for each configuration.
  488. struct OutputInfo;
  489. OutputInfo const* GetOutputInfo(const char* config);
  490. bool ComputeOutputDir(const char* config, bool implib, std::string& out);
  491. bool ComputePDBOutputDir(const char* config, std::string& out);
  492. // Cache import information from properties for each configuration.
  493. struct ImportInfo;
  494. ImportInfo const* GetImportInfo(const char* config,
  495. cmTarget *workingTarget);
  496. void ComputeImportInfo(std::string const& desired_config, ImportInfo& info,
  497. cmTarget *head);
  498. cmTargetLinkInformationMap LinkInformation;
  499. bool ComputeLinkInterface(const char* config, LinkInterface& iface,
  500. cmTarget *head);
  501. void ComputeLinkImplementation(const char* config,
  502. LinkImplementation& impl, cmTarget *head);
  503. void ComputeLinkClosure(const char* config, LinkClosure& lc, cmTarget *head);
  504. void ClearLinkMaps();
  505. void MaybeInvalidatePropertyCache(const char* prop);
  506. void ProcessSourceExpression(std::string const& expr);
  507. std::string GetDebugGeneratorExpressions(const std::string &value,
  508. cmTarget::LinkLibraryType llt);
  509. // The cmMakefile instance that owns this target. This should
  510. // always be set.
  511. cmMakefile* Makefile;
  512. // Policy status recorded when target was created.
  513. cmPolicies::PolicyStatus PolicyStatusCMP0003;
  514. cmPolicies::PolicyStatus PolicyStatusCMP0004;
  515. cmPolicies::PolicyStatus PolicyStatusCMP0008;
  516. // Internal representation details.
  517. friend class cmTargetInternals;
  518. cmTargetInternalPointer Internal;
  519. void ConstructSourceFileFlags();
  520. void ComputeVersionedName(std::string& vName,
  521. std::string const& prefix,
  522. std::string const& base,
  523. std::string const& suffix,
  524. std::string const& name,
  525. const char* version);
  526. };
  527. typedef std::map<cmStdString,cmTarget> cmTargets;
  528. class cmTargetSet: public std::set<cmStdString> {};
  529. class cmTargetManifest: public std::map<cmStdString, cmTargetSet> {};
  530. #endif