cmTarget.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  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 "cmListFileCache.h"
  16. #include "cmLinkItem.h"
  17. #include <cmsys/auto_ptr.hxx>
  18. #if defined(CMAKE_BUILD_WITH_CMAKE)
  19. # ifdef CMake_HAVE_CXX11_UNORDERED_MAP
  20. # include <unordered_map>
  21. # else
  22. # include <cmsys/hash_map.hxx>
  23. # endif
  24. #endif
  25. #define CM_FOR_EACH_TARGET_POLICY(F) \
  26. F(CMP0003) \
  27. F(CMP0004) \
  28. F(CMP0008) \
  29. F(CMP0020) \
  30. F(CMP0021) \
  31. F(CMP0022) \
  32. F(CMP0027) \
  33. F(CMP0038) \
  34. F(CMP0041) \
  35. F(CMP0042) \
  36. F(CMP0046) \
  37. F(CMP0052) \
  38. F(CMP0060) \
  39. F(CMP0063)
  40. class cmake;
  41. class cmMakefile;
  42. class cmSourceFile;
  43. class cmGlobalGenerator;
  44. class cmComputeLinkInformation;
  45. class cmListFileBacktrace;
  46. class cmTarget;
  47. class cmGeneratorTarget;
  48. class cmTargetTraceDependencies;
  49. class cmTargetInternals;
  50. class cmTargetInternalPointer
  51. {
  52. public:
  53. cmTargetInternalPointer();
  54. cmTargetInternalPointer(cmTargetInternalPointer const& r);
  55. ~cmTargetInternalPointer();
  56. cmTargetInternalPointer& operator=(cmTargetInternalPointer const& r);
  57. cmTargetInternals* operator->() const { return this->Pointer; }
  58. cmTargetInternals* Get() const { return this->Pointer; }
  59. private:
  60. cmTargetInternals* Pointer;
  61. };
  62. /** \class cmTarget
  63. * \brief Represent a library or executable target loaded from a makefile.
  64. *
  65. * cmTarget represents a target loaded from
  66. * a makefile.
  67. */
  68. class cmTarget
  69. {
  70. public:
  71. cmTarget();
  72. enum TargetType { EXECUTABLE, STATIC_LIBRARY,
  73. SHARED_LIBRARY, MODULE_LIBRARY,
  74. OBJECT_LIBRARY, UTILITY, GLOBAL_TARGET,
  75. INTERFACE_LIBRARY,
  76. UNKNOWN_LIBRARY};
  77. static const char* GetTargetTypeName(TargetType targetType);
  78. enum CustomCommandType { PRE_BUILD, PRE_LINK, POST_BUILD };
  79. /**
  80. * Return the type of target.
  81. */
  82. TargetType GetType() const
  83. {
  84. return this->TargetTypeValue;
  85. }
  86. /**
  87. * Set the target type
  88. */
  89. void SetType(TargetType f, const std::string& name);
  90. void MarkAsImported();
  91. ///! Set/Get the name of the target
  92. const std::string& GetName() const {return this->Name;}
  93. std::string GetExportName() const;
  94. ///! Set the cmMakefile that owns this target
  95. void SetMakefile(cmMakefile *mf);
  96. cmMakefile *GetMakefile() const { return this->Makefile;}
  97. #define DECLARE_TARGET_POLICY(POLICY) \
  98. cmPolicies::PolicyStatus GetPolicyStatus ## POLICY () const \
  99. { return this->PolicyMap.Get(cmPolicies::POLICY); }
  100. CM_FOR_EACH_TARGET_POLICY(DECLARE_TARGET_POLICY)
  101. #undef DECLARE_TARGET_POLICY
  102. /**
  103. * Get the list of the custom commands for this target
  104. */
  105. std::vector<cmCustomCommand> const &GetPreBuildCommands() const
  106. {return this->PreBuildCommands;}
  107. std::vector<cmCustomCommand> const &GetPreLinkCommands() const
  108. {return this->PreLinkCommands;}
  109. std::vector<cmCustomCommand> const &GetPostBuildCommands() const
  110. {return this->PostBuildCommands;}
  111. void AddPreBuildCommand(cmCustomCommand const &cmd)
  112. {this->PreBuildCommands.push_back(cmd);}
  113. void AddPreLinkCommand(cmCustomCommand const &cmd)
  114. {this->PreLinkCommands.push_back(cmd);}
  115. void AddPostBuildCommand(cmCustomCommand const &cmd)
  116. {this->PostBuildCommands.push_back(cmd);}
  117. /**
  118. * Get the list of the source files used by this target
  119. */
  120. void GetSourceFiles(std::vector<cmSourceFile*> &files,
  121. const std::string& config) const;
  122. bool GetConfigCommonSourceFiles(std::vector<cmSourceFile*>& files) const;
  123. /**
  124. * Add sources to the target.
  125. */
  126. void AddSources(std::vector<std::string> const& srcs);
  127. void AddTracedSources(std::vector<std::string> const& srcs);
  128. cmSourceFile* AddSourceCMP0049(const std::string& src);
  129. cmSourceFile* AddSource(const std::string& src);
  130. enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED};
  131. //* how we identify a library, by name and type
  132. typedef std::pair<std::string, LinkLibraryType> LibraryID;
  133. typedef std::vector<LibraryID > LinkLibraryVectorType;
  134. const LinkLibraryVectorType &GetOriginalLinkLibraries() const
  135. {return this->OriginalLinkLibraries;}
  136. /** Compute the link type to use for the given configuration. */
  137. LinkLibraryType ComputeLinkType(const std::string& config) const;
  138. /**
  139. * Clear the dependency information recorded for this target, if any.
  140. */
  141. void ClearDependencyInformation(cmMakefile& mf, const std::string& target);
  142. // Check to see if a library is a framework and treat it different on Mac
  143. bool NameResolvesToFramework(const std::string& libname) const;
  144. void AddLinkLibrary(cmMakefile& mf,
  145. const std::string& target, const std::string& lib,
  146. LinkLibraryType llt);
  147. enum TLLSignature {
  148. KeywordTLLSignature,
  149. PlainTLLSignature
  150. };
  151. bool PushTLLCommandTrace(TLLSignature signature,
  152. cmListFileContext const& lfc);
  153. void GetTllSignatureTraces(std::ostringstream &s, TLLSignature sig) const;
  154. void MergeLinkLibraries( cmMakefile& mf, const std::string& selfname,
  155. const LinkLibraryVectorType& libs );
  156. const std::vector<std::string>& GetLinkDirectories() const;
  157. void AddLinkDirectory(const std::string& d);
  158. /**
  159. * Set the path where this target should be installed. This is relative to
  160. * INSTALL_PREFIX
  161. */
  162. std::string GetInstallPath() const {return this->InstallPath;}
  163. void SetInstallPath(const char *name) {this->InstallPath = name;}
  164. /**
  165. * Set the path where this target (if it has a runtime part) should be
  166. * installed. This is relative to INSTALL_PREFIX
  167. */
  168. std::string GetRuntimeInstallPath() const {return this->RuntimeInstallPath;}
  169. void SetRuntimeInstallPath(const char *name) {
  170. this->RuntimeInstallPath = name; }
  171. /**
  172. * Get/Set whether there is an install rule for this target.
  173. */
  174. bool GetHaveInstallRule() const { return this->HaveInstallRule; }
  175. void SetHaveInstallRule(bool h) { this->HaveInstallRule = h; }
  176. /** Add a utility on which this project depends. A utility is an executable
  177. * name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE
  178. * commands. It is not a full path nor does it have an extension.
  179. */
  180. void AddUtility(const std::string& u, cmMakefile *makefile = 0);
  181. ///! Get the utilities used by this target
  182. std::set<std::string>const& GetUtilities() const { return this->Utilities; }
  183. std::set<cmLinkItem>const& GetUtilityItems() const;
  184. cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const;
  185. /** Finalize the target at the end of the Configure step. */
  186. void FinishConfigure();
  187. ///! Set/Get a property of this target file
  188. void SetProperty(const std::string& prop, const char *value);
  189. void AppendProperty(const std::string& prop, const char* value,
  190. bool asString=false);
  191. const char *GetProperty(const std::string& prop) const;
  192. const char *GetProperty(const std::string& prop, cmMakefile* context) const;
  193. bool GetPropertyAsBool(const std::string& prop) const;
  194. void CheckProperty(const std::string& prop, cmMakefile* context) const;
  195. bool IsImported() const {return this->IsImportedTarget;}
  196. void GetObjectLibrariesCMP0026(std::vector<cmTarget*>& objlibs) const;
  197. /** The link interface specifies transitive library dependencies and
  198. other information needed by targets that link to this target. */
  199. struct LinkInterfaceLibraries
  200. {
  201. // Libraries listed in the interface.
  202. std::vector<cmLinkItem> Libraries;
  203. };
  204. struct LinkInterface: public LinkInterfaceLibraries
  205. {
  206. // Languages whose runtime libraries must be linked.
  207. std::vector<std::string> Languages;
  208. // Shared library dependencies needed for linking on some platforms.
  209. std::vector<cmLinkItem> 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<cmLinkItem> WrongConfigLibraries;
  216. bool ImplementationIsInterface;
  217. LinkInterface(): Multiplicity(0), ImplementationIsInterface(false) {}
  218. };
  219. /** Get the link interface for the given configuration. Returns 0
  220. if the target cannot be linked. */
  221. LinkInterface const* GetLinkInterface(const std::string& config,
  222. cmTarget const* headTarget) const;
  223. LinkInterfaceLibraries const*
  224. GetLinkInterfaceLibraries(const std::string& config,
  225. cmTarget const* headTarget,
  226. bool usage_requirements_only) const;
  227. /** The link implementation specifies the direct library
  228. dependencies needed by the object files of the target. */
  229. struct LinkImplementationLibraries
  230. {
  231. // Libraries linked directly in this configuration.
  232. std::vector<cmLinkImplItem> Libraries;
  233. // Libraries linked directly in other configurations.
  234. // Needed only for OLD behavior of CMP0003.
  235. std::vector<cmLinkItem> WrongConfigLibraries;
  236. };
  237. struct LinkImplementation: public LinkImplementationLibraries
  238. {
  239. // Languages whose runtime libraries must be linked.
  240. std::vector<std::string> Languages;
  241. };
  242. LinkImplementation const*
  243. GetLinkImplementation(const std::string& config) const;
  244. LinkImplementationLibraries const*
  245. GetLinkImplementationLibraries(const std::string& config) const;
  246. cmTarget const* FindTargetToLink(std::string const& name) const;
  247. /** Strip off leading and trailing whitespace from an item named in
  248. the link dependencies of this target. */
  249. std::string CheckCMP0004(std::string const& item) const;
  250. /** Get the directory in which this target will be built. If the
  251. configuration name is given then the generator will add its
  252. subdirectory for that configuration. Otherwise just the canonical
  253. output directory is given. */
  254. std::string GetDirectory(const std::string& config = "",
  255. bool implib = false) const;
  256. /** Get the directory in which this targets .pdb files will be placed.
  257. If the configuration name is given then the generator will add its
  258. subdirectory for that configuration. Otherwise just the canonical
  259. pdb output directory is given. */
  260. std::string GetPDBDirectory(const std::string& config) const;
  261. const char* ImportedGetLocation(const std::string& config) const;
  262. /** Get the target major and minor version numbers interpreted from
  263. the VERSION property. Version 0 is returned if the property is
  264. not set or cannot be parsed. */
  265. void GetTargetVersion(int& major, int& minor) const;
  266. /** Get the target major, minor, and patch version numbers
  267. interpreted from the VERSION or SOVERSION property. Version 0
  268. is returned if the property is not set or cannot be parsed. */
  269. void
  270. GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
  271. /** Whether this library has \@rpath and platform supports it. */
  272. bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
  273. /** Whether this library defaults to \@rpath. */
  274. bool MacOSXRpathInstallNameDirDefault() const;
  275. /** Test for special case of a third-party shared library that has
  276. no soname at all. */
  277. bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
  278. /** Does this target have a GNU implib to convert to MS format? */
  279. bool HasImplibGNUtoMS() const;
  280. /** Convert the given GNU import library name (.dll.a) to a name with a new
  281. extension (.lib or ${CMAKE_IMPORT_LIBRARY_SUFFIX}). */
  282. bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
  283. const char* newExt = 0) const;
  284. bool HaveBuildTreeRPATH(const std::string& config) const;
  285. bool HaveInstallTreeRPATH() const;
  286. // Get the properties
  287. cmPropertyMap &GetProperties() const { return this->Properties; }
  288. bool GetMappedConfig(std::string const& desired_config,
  289. const char** loc,
  290. const char** imp,
  291. std::string& suffix) const;
  292. /** Get the macro to define when building sources in this target.
  293. If no macro should be defined null is returned. */
  294. const char* GetExportMacro() const;
  295. void GetCompileDefinitions(std::vector<std::string> &result,
  296. const std::string& config,
  297. const std::string& language) const;
  298. // Compute the set of languages compiled by the target. This is
  299. // computed every time it is called because the languages can change
  300. // when source file properties are changed and we do not have enough
  301. // information to forward these property changes to the targets
  302. // until we have per-target object file properties.
  303. void GetLanguages(std::set<std::string>& languages,
  304. std::string const& config) const;
  305. /** Return whether this target is an executable with symbol exports
  306. enabled. */
  307. bool IsExecutableWithExports() const;
  308. /** Return whether this target may be used to link another target. */
  309. bool IsLinkable() const;
  310. /** Return whether or not the target is for a DLL platform. */
  311. bool IsDLLPlatform() const { return this->DLLPlatform; }
  312. /** Return whether or not the target has a DLL import library. */
  313. bool HasImportLibrary() const;
  314. /** Return whether this target is a shared library Framework on
  315. Apple. */
  316. bool IsFrameworkOnApple() const;
  317. /** Return whether this target is a CFBundle (plugin) on Apple. */
  318. bool IsCFBundleOnApple() const;
  319. /** Return whether this target is a XCTest on Apple. */
  320. bool IsXCTestOnApple() const;
  321. /** Return whether this target is an executable Bundle on Apple. */
  322. bool IsAppBundleOnApple() const;
  323. /** Return the framework version string. Undefined if
  324. IsFrameworkOnApple returns false. */
  325. std::string GetFrameworkVersion() const;
  326. /** Get a backtrace from the creation of the target. */
  327. cmListFileBacktrace const& GetBacktrace() const;
  328. /** Get a build-tree directory in which to place target support files. */
  329. std::string GetSupportDirectory() const;
  330. /** Return whether this target uses the default value for its output
  331. directory. */
  332. bool UsesDefaultOutputDir(const std::string& config, bool implib) const;
  333. /** @return whether this target have a well defined output file name. */
  334. bool HaveWellDefinedOutputFiles() const;
  335. std::vector<std::string> GetIncludeDirectories(
  336. const std::string& config,
  337. const std::string& language) const;
  338. void InsertInclude(std::string const& entry,
  339. cmListFileBacktrace const& bt,
  340. bool before = false);
  341. void InsertCompileOption(std::string const& entry,
  342. cmListFileBacktrace const& bt,
  343. bool before = false);
  344. void InsertCompileDefinition(std::string const& entry,
  345. cmListFileBacktrace const& bt);
  346. void AppendBuildInterfaceIncludes();
  347. void GetCompileOptions(std::vector<std::string> &result,
  348. const std::string& config,
  349. const std::string& language) const;
  350. void GetCompileFeatures(std::vector<std::string> &features,
  351. const std::string& config) const;
  352. bool IsNullImpliedByLinkLibraries(const std::string &p) const;
  353. std::string GetDebugGeneratorExpressions(const std::string &value,
  354. cmTarget::LinkLibraryType llt) const;
  355. void AddSystemIncludeDirectories(const std::set<std::string> &incs);
  356. void AddSystemIncludeDirectories(const std::vector<std::string> &incs);
  357. std::set<std::string> const & GetSystemIncludeDirectories() const
  358. { return this->SystemIncludeDirectories; }
  359. bool LinkLanguagePropagatesToDependents() const
  360. { return this->TargetTypeValue == STATIC_LIBRARY; }
  361. std::map<std::string, std::string> const&
  362. GetMaxLanguageStandards() const
  363. {
  364. return this->MaxLanguageStandards;
  365. }
  366. #if defined(_WIN32) && !defined(__CYGWIN__)
  367. const LinkLibraryVectorType &GetLinkLibrariesForVS6() const {
  368. return this->LinkLibrariesForVS6;}
  369. #endif
  370. private:
  371. bool HandleLocationPropertyPolicy(cmMakefile* context) const;
  372. #if defined(_WIN32) && !defined(__CYGWIN__)
  373. /**
  374. * A list of direct dependencies. Use in conjunction with DependencyMap.
  375. */
  376. typedef std::vector< LibraryID > DependencyList;
  377. /**
  378. * This map holds the dependency graph. map[x] returns a set of
  379. * direct dependencies of x. Note that the direct depenencies are
  380. * ordered. This is necessary to handle direct dependencies that
  381. * themselves have no dependency information.
  382. */
  383. typedef std::map< LibraryID, DependencyList > DependencyMap;
  384. /**
  385. * Inserts \a dep at the end of the dependency list of \a lib.
  386. */
  387. void InsertDependencyForVS6( DependencyMap& depMap,
  388. const LibraryID& lib,
  389. const LibraryID& dep);
  390. /*
  391. * Deletes \a dep from the dependency list of \a lib.
  392. */
  393. void DeleteDependencyForVS6( DependencyMap& depMap,
  394. const LibraryID& lib,
  395. const LibraryID& dep);
  396. /**
  397. * Emits the library \a lib and all its dependencies into link_line.
  398. * \a emitted keeps track of the libraries that have been emitted to
  399. * avoid duplicates--it is more efficient than searching
  400. * link_line. \a visited is used detect cycles. Note that \a
  401. * link_line is in reverse order, in that the dependencies of a
  402. * library are listed before the library itself.
  403. */
  404. void EmitForVS6( const LibraryID lib,
  405. const DependencyMap& dep_map,
  406. std::set<LibraryID>& emitted,
  407. std::set<LibraryID>& visited,
  408. DependencyList& link_line);
  409. /**
  410. * Finds the dependencies for \a lib and inserts them into \a
  411. * dep_map.
  412. */
  413. void GatherDependenciesForVS6( const cmMakefile& mf,
  414. const LibraryID& lib,
  415. DependencyMap& dep_map);
  416. void AnalyzeLibDependenciesForVS6( const cmMakefile& mf );
  417. #endif
  418. const char* GetSuffixVariableInternal(bool implib) const;
  419. const char* GetPrefixVariableInternal(bool implib) const;
  420. // Use a makefile variable to set a default for the given property.
  421. // If the variable is not defined use the given default instead.
  422. void SetPropertyDefault(const std::string& property,
  423. const char* default_value);
  424. // Returns ARCHIVE, LIBRARY, or RUNTIME based on platform and type.
  425. const char* GetOutputTargetType(bool implib) const;
  426. std::string GetFullNameImported(const std::string& config,
  427. bool implib) const;
  428. std::string ImportedGetFullPath(const std::string& config,
  429. bool implib) const;
  430. void GetSourceFiles(std::vector<std::string> &files,
  431. const std::string& config) const;
  432. private:
  433. mutable cmPropertyMap Properties;
  434. std::set<std::string> SystemIncludeDirectories;
  435. std::set<std::string> LinkDirectoriesEmmitted;
  436. std::set<std::string> Utilities;
  437. mutable std::set<std::string> LinkImplicitNullProperties;
  438. std::map<std::string, cmListFileBacktrace> UtilityBacktraces;
  439. mutable std::map<std::string, std::string> MaxLanguageStandards;
  440. cmPolicies::PolicyMap PolicyMap;
  441. std::string Name;
  442. std::string InstallPath;
  443. std::string RuntimeInstallPath;
  444. mutable std::string ExportMacro;
  445. std::vector<std::string> LinkDirectories;
  446. std::vector<cmCustomCommand> PreBuildCommands;
  447. std::vector<cmCustomCommand> PreLinkCommands;
  448. std::vector<cmCustomCommand> PostBuildCommands;
  449. std::vector<std::pair<TLLSignature, cmListFileContext> > TLLCommands;
  450. LinkLibraryVectorType PrevLinkedLibraries;
  451. LinkLibraryVectorType OriginalLinkLibraries;
  452. #if defined(_WIN32) && !defined(__CYGWIN__)
  453. LinkLibraryVectorType LinkLibrariesForVS6;
  454. #endif
  455. cmMakefile* Makefile;
  456. cmTargetInternalPointer Internal;
  457. TargetType TargetTypeValue;
  458. bool HaveInstallRule;
  459. bool RecordDependencies;
  460. bool DLLPlatform;
  461. bool IsAndroid;
  462. bool IsApple;
  463. bool IsImportedTarget;
  464. bool BuildInterfaceIncludesAppended;
  465. mutable bool DebugIncludesDone;
  466. mutable bool DebugCompileOptionsDone;
  467. mutable bool DebugCompileDefinitionsDone;
  468. mutable bool DebugSourcesDone;
  469. mutable bool DebugCompileFeaturesDone;
  470. mutable bool LinkImplementationLanguageIsContextDependent;
  471. #if defined(_WIN32) && !defined(__CYGWIN__)
  472. bool LinkLibrariesForVS6Analyzed;
  473. #endif
  474. // Cache target output paths for each configuration.
  475. struct OutputInfo;
  476. OutputInfo const* GetOutputInfo(const std::string& config) const;
  477. bool
  478. ComputeOutputDir(const std::string& config,
  479. bool implib, std::string& out) const;
  480. bool ComputePDBOutputDir(const std::string& kind, const std::string& config,
  481. std::string& out) const;
  482. // Cache import information from properties for each configuration.
  483. struct ImportInfo
  484. {
  485. ImportInfo(): NoSOName(false), Multiplicity(0) {}
  486. bool NoSOName;
  487. int Multiplicity;
  488. std::string Location;
  489. std::string SOName;
  490. std::string ImportLibrary;
  491. std::string Languages;
  492. std::string Libraries;
  493. std::string LibrariesProp;
  494. std::string SharedDeps;
  495. };
  496. ImportInfo const* GetImportInfo(const std::string& config) const;
  497. void ComputeImportInfo(std::string const& desired_config,
  498. ImportInfo& info) const;
  499. LinkInterface const*
  500. GetImportLinkInterface(const std::string& config, cmTarget const* head,
  501. bool usage_requirements_only) const;
  502. LinkImplementationLibraries const*
  503. GetLinkImplementationLibrariesInternal(const std::string& config,
  504. cmTarget const* head) const;
  505. void ExpandLinkItems(std::string const& prop, std::string const& value,
  506. std::string const& config, cmTarget const* headTarget,
  507. bool usage_requirements_only,
  508. std::vector<cmLinkItem>& items,
  509. bool& hadHeadSensitiveCondition) const;
  510. void LookupLinkItems(std::vector<std::string> const& names,
  511. std::vector<cmLinkItem>& items) const;
  512. std::string ProcessSourceItemCMP0049(const std::string& s);
  513. void ClearLinkMaps();
  514. void MaybeInvalidatePropertyCache(const std::string& prop);
  515. void ProcessSourceExpression(std::string const& expr);
  516. // Internal representation details.
  517. friend class cmTargetInternals;
  518. friend class cmGeneratorTarget;
  519. friend class cmTargetTraceDependencies;
  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) const;
  526. };
  527. #ifdef CMAKE_BUILD_WITH_CMAKE
  528. #ifdef CMake_HAVE_CXX11_UNORDERED_MAP
  529. typedef std::unordered_map<std::string, cmTarget> cmTargets;
  530. #else
  531. typedef cmsys::hash_map<std::string, cmTarget> cmTargets;
  532. #endif
  533. #else
  534. typedef std::map<std::string,cmTarget> cmTargets;
  535. #endif
  536. class cmTargetSet: public std::set<std::string> {};
  537. class cmTargetManifest: public std::map<std::string, cmTargetSet> {};
  538. #endif