cmMakefile.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmMakefile_h
  14. #define cmMakefile_h
  15. #include "cmData.h"
  16. #include "cmSystemTools.h"
  17. #include "cmTarget.h"
  18. #include "cmListFileCache.h"
  19. #include "cmCacheManager.h"
  20. #if defined(CMAKE_BUILD_WITH_CMAKE)
  21. #include "cmSourceGroup.h"
  22. #endif
  23. #include <cmsys/RegularExpression.hxx>
  24. class cmFunctionBlocker;
  25. class cmCommand;
  26. class cmInstallGenerator;
  27. class cmLocalGenerator;
  28. class cmMakeDepend;
  29. class cmSourceFile;
  30. class cmTest;
  31. class cmVariableWatch;
  32. class cmake;
  33. /** \class cmMakefile
  34. * \brief Process the input CMakeLists.txt file.
  35. *
  36. * Process and store into memory the input CMakeLists.txt file.
  37. * Each CMakeLists.txt file is parsed and the commands found there
  38. * are added into the build process.
  39. */
  40. class cmMakefile
  41. {
  42. public:
  43. /**
  44. * Return major and minor version numbers for cmake.
  45. */
  46. static unsigned int GetMajorVersion() { return CMake_VERSION_MAJOR; }
  47. static unsigned int GetMinorVersion() { return CMake_VERSION_MINOR; }
  48. static unsigned int GetPatchVersion() { return CMake_VERSION_PATCH; }
  49. static const char* GetReleaseVersion();
  50. /**
  51. * Return the major and minor version of the cmake that
  52. * was used to write the currently loaded cache, note
  53. * this method will not work before the cache is loaded.
  54. */
  55. unsigned int GetCacheMajorVersion();
  56. unsigned int GetCacheMinorVersion();
  57. /**
  58. * Construct an empty makefile.
  59. */
  60. cmMakefile();
  61. /**
  62. * Destructor.
  63. */
  64. ~cmMakefile();
  65. /**
  66. * Read and parse a CMakeLists.txt file.
  67. */
  68. bool ReadListFile(const char* listfile, const char* external= 0);
  69. /**
  70. * Add a function blocker to this makefile
  71. */
  72. void AddFunctionBlocker(cmFunctionBlocker *fb)
  73. { this->FunctionBlockers.push_back(fb);}
  74. void RemoveFunctionBlocker(cmFunctionBlocker *fb)
  75. { this->FunctionBlockers.remove(fb);}
  76. void RemoveFunctionBlocker(const cmListFileFunction& lff);
  77. /**
  78. * Add file to the written file list. These file should not be in the list
  79. * of dependencies because they cause infinite loops.
  80. */
  81. void AddWrittenFile(const char* file);
  82. bool HasWrittenFile(const char* file);
  83. /**
  84. * Check if there are any infinite loops
  85. */
  86. bool CheckInfiniteLoops();
  87. /**
  88. * Try running cmake and building a file. This is used for dynalically
  89. * loaded commands, not as part of the usual build process.
  90. */
  91. int TryCompile(const char *srcdir, const char *bindir,
  92. const char *projectName, const char *targetName,
  93. const std::vector<std::string> *cmakeArgs,
  94. std::string *output);
  95. /**
  96. * Specify the makefile generator. This is platform/compiler
  97. * dependent, although the interface is through a generic
  98. * superclass.
  99. */
  100. void SetLocalGenerator(cmLocalGenerator*);
  101. ///! Get the current makefile generator.
  102. cmLocalGenerator* GetLocalGenerator()
  103. { return this->LocalGenerator;}
  104. /**
  105. * Perform FinalPass, Library dependency analysis etc before output of the
  106. * makefile.
  107. */
  108. void ConfigureFinalPass();
  109. /**
  110. * run the final pass on all commands.
  111. */
  112. void FinalPass();
  113. /**
  114. * Print the object state to std::cout.
  115. */
  116. void Print();
  117. /** Add a custom command to the build. */
  118. void AddCustomCommandToTarget(const char* target,
  119. const std::vector<std::string>& depends,
  120. const cmCustomCommandLines& commandLines,
  121. cmTarget::CustomCommandType type,
  122. const char* comment, const char* workingDir);
  123. void AddCustomCommandToOutput(const char* output,
  124. const std::vector<std::string>& depends,
  125. const char* main_dependency,
  126. const cmCustomCommandLines& commandLines,
  127. const char* comment, const char* workingDir,
  128. bool replace = false);
  129. void AddCustomCommandOldStyle(const char* target,
  130. const std::vector<std::string>& outputs,
  131. const std::vector<std::string>& depends,
  132. const char* source,
  133. const cmCustomCommandLines& commandLines,
  134. const char* comment);
  135. /**
  136. * Add a define flag to the build.
  137. */
  138. void AddDefineFlag(const char* definition);
  139. void RemoveDefineFlag(const char* definition);
  140. /**
  141. * Add an executable to the build.
  142. */
  143. cmTarget* AddExecutable(const char *exename,
  144. const std::vector<std::string> &srcs);
  145. /**
  146. * Add a utility to the build. A utiltity target is a command that
  147. * is run every time the target is built.
  148. */
  149. void AddUtilityCommand(const char* utilityName, bool all,
  150. const char* output,
  151. const std::vector<std::string>& depends,
  152. const char* workingDirectory,
  153. const char* command,
  154. const char* arg1=0,
  155. const char* arg2=0,
  156. const char* arg3=0,
  157. const char* arg4=0);
  158. void AddUtilityCommand(const char* utilityName, bool all,
  159. const char* output,
  160. const char* workingDirectory,
  161. const std::vector<std::string>& depends,
  162. const cmCustomCommandLines& commandLines);
  163. /**
  164. * Add a link library to the build.
  165. */
  166. void AddLinkLibrary(const char*);
  167. void AddLinkLibrary(const char*, cmTarget::LinkLibraryType type);
  168. void AddLinkLibraryForTarget(const char *tgt, const char*,
  169. cmTarget::LinkLibraryType type);
  170. void AddLinkDirectoryForTarget(const char *tgt, const char* d);
  171. /**
  172. * Add a link directory to the build.
  173. */
  174. void AddLinkDirectory(const char*);
  175. /**
  176. * Get the list of link directories
  177. */
  178. std::vector<std::string>& GetLinkDirectories()
  179. {
  180. return this->LinkDirectories;
  181. }
  182. const std::vector<std::string>& GetLinkDirectories() const
  183. {
  184. return this->LinkDirectories;
  185. }
  186. void SetLinkDirectories(const std::vector<std::string>& vec)
  187. {
  188. this->LinkDirectories = vec;
  189. }
  190. /**
  191. * Add a subdirectory to the build.
  192. */
  193. void AddSubDirectory(const char*, bool includeTopLevel=true,
  194. bool preorder = false);
  195. void AddSubDirectory(const char* fullSrcDir,const char *fullBinDir,
  196. bool includeTopLevel, bool preorder,
  197. bool immediate);
  198. /**
  199. * Configure a subdirectory
  200. */
  201. void ConfigureSubDirectory(cmLocalGenerator *);
  202. /**
  203. * Add an include directory to the build.
  204. */
  205. void AddIncludeDirectory(const char*, bool before = false);
  206. /**
  207. * Add a variable definition to the build. This variable
  208. * can be used in CMake to refer to lists, directories, etc.
  209. */
  210. void AddDefinition(const char* name, const char* value);
  211. ///! Add a definition to this makefile and the global cmake cache.
  212. void AddCacheDefinition(const char* name, const char* value,
  213. const char* doc,
  214. cmCacheManager::CacheEntryType type);
  215. /**
  216. * Add bool variable definition to the build.
  217. */
  218. void AddDefinition(const char* name, bool);
  219. ///! Add a definition to this makefile and the global cmake cache.
  220. void AddCacheDefinition(const char* name, bool, const char* doc);
  221. /**
  222. * Remove a variable definition from the build. This is not valid
  223. * for cache entries, and will only affect the current makefile.
  224. */
  225. void RemoveDefinition(const char* name);
  226. /**
  227. * Specify the name of the project for this build.
  228. */
  229. void SetProjectName(const char*);
  230. /**
  231. * Get the name of the project for this build.
  232. */
  233. const char* GetProjectName()
  234. {
  235. return this->ProjectName.c_str();
  236. }
  237. /**
  238. * Set the name of the library.
  239. */
  240. void AddLibrary(const char *libname, int shared,
  241. const std::vector<std::string> &srcs);
  242. #if defined(CMAKE_BUILD_WITH_CMAKE)
  243. /**
  244. * Add a source group for consideration when adding a new source.
  245. */
  246. void AddSourceGroup(const char* name, const char* regex=0,
  247. const char* parent=0);
  248. #endif
  249. /**
  250. * Add an auxiliary directory to the build.
  251. */
  252. void AddExtraDirectory(const char* dir);
  253. /**
  254. * Add an auxiliary directory to the build.
  255. */
  256. void MakeStartDirectoriesCurrent()
  257. {
  258. this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
  259. this->cmStartDirectory.c_str());
  260. this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
  261. this->StartOutputDirectory.c_str());
  262. }
  263. //@{
  264. /**
  265. * Set/Get the home directory (or output directory) in the project. The
  266. * home directory is the top directory of the project. It is where
  267. * CMakeSetup or configure was run. Remember that CMake processes
  268. * CMakeLists files by recursing up the tree starting at the StartDirectory
  269. * and going up until it reaches the HomeDirectory.
  270. */
  271. void SetHomeDirectory(const char* dir);
  272. const char* GetHomeDirectory() const
  273. {
  274. return this->cmHomeDirectory.c_str();
  275. }
  276. void SetHomeOutputDirectory(const char* lib);
  277. const char* GetHomeOutputDirectory() const
  278. {
  279. return this->HomeOutputDirectory.c_str();
  280. }
  281. //@}
  282. //@{
  283. /**
  284. * Set/Get the start directory (or output directory). The start directory
  285. * is the directory of the CMakeLists.txt file that started the current
  286. * round of processing. Remember that CMake processes CMakeLists files by
  287. * recursing up the tree starting at the StartDirectory and going up until
  288. * it reaches the HomeDirectory.
  289. */
  290. void SetStartDirectory(const char* dir)
  291. {
  292. this->cmStartDirectory = dir;
  293. cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
  294. this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
  295. this->cmStartDirectory.c_str());
  296. }
  297. const char* GetStartDirectory() const
  298. {
  299. return this->cmStartDirectory.c_str();
  300. }
  301. void SetStartOutputDirectory(const char* lib)
  302. {
  303. this->StartOutputDirectory = lib;
  304. cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
  305. cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str());
  306. this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
  307. this->StartOutputDirectory.c_str());
  308. }
  309. const char* GetStartOutputDirectory() const
  310. {
  311. return this->StartOutputDirectory.c_str();
  312. }
  313. //@}
  314. const char* GetCurrentDirectory() const
  315. {
  316. return this->cmStartDirectory.c_str();
  317. }
  318. const char* GetCurrentOutputDirectory() const
  319. {
  320. return this->StartOutputDirectory.c_str();
  321. }
  322. /* Get the current CMakeLists.txt file that is being processed. This
  323. * is just used in order to be able to 'branch' from one file to a second
  324. * transparently */
  325. const char* GetCurrentListFile() const
  326. {
  327. return this->cmCurrentListFile.c_str();
  328. }
  329. //@}
  330. /**
  331. * Set a regular expression that include files must match
  332. * in order to be considered as part of the depend information.
  333. */
  334. void SetIncludeRegularExpression(const char* regex)
  335. {
  336. this->IncludeFileRegularExpression = regex;
  337. }
  338. const char* GetIncludeRegularExpression()
  339. {
  340. return this->IncludeFileRegularExpression.c_str();
  341. }
  342. /**
  343. * Set a regular expression that include files that are not found
  344. * must match in order to be considered a problem.
  345. */
  346. void SetComplainRegularExpression(const char* regex)
  347. {
  348. this->ComplainFileRegularExpression = regex;
  349. }
  350. const char* GetComplainRegularExpression()
  351. {
  352. return this->ComplainFileRegularExpression.c_str();
  353. }
  354. /**
  355. * Get the list of targets
  356. */
  357. cmTargets &GetTargets() { return this->Targets; }
  358. cmTarget* FindTarget(const char* name);
  359. /**
  360. * Get a list of include directories in the build.
  361. */
  362. std::vector<std::string>& GetIncludeDirectories()
  363. {
  364. return this->IncludeDirectories;
  365. }
  366. const std::vector<std::string>& GetIncludeDirectories() const
  367. {
  368. return this->IncludeDirectories;
  369. }
  370. void SetIncludeDirectories(const std::vector<std::string>& vec)
  371. {
  372. this->IncludeDirectories = vec;
  373. }
  374. /** Expand out any arguements in the vector that have ; separated
  375. * strings into multiple arguements. A new vector is created
  376. * containing the expanded versions of all arguments in argsIn.
  377. * This method differes from the one in cmSystemTools in that if
  378. * the CmakeLists file is version 1.2 or earlier it will check for
  379. * source lists being used without ${} around them
  380. */
  381. void ExpandSourceListArguments(std::vector<std::string> const& argsIn,
  382. std::vector<std::string>& argsOut,
  383. unsigned int startArgumentIndex);
  384. /** Get a cmSourceFile pointer for a given source name, if the name is
  385. * not found, then a null pointer is returned.
  386. */
  387. cmSourceFile* GetSource(const char* sourceName) const;
  388. ///! Add a new cmSourceFile to the list of sources for this makefile.
  389. cmSourceFile* AddSource(cmSourceFile const&);
  390. /** Get a cmSourceFile pointer for a given source name, if the name is
  391. * not found, then create the source file and return it. generated
  392. * indicates if it is a generated file, this is used in determining
  393. * how to create the source file instance e.g. name
  394. */
  395. cmSourceFile* GetOrCreateSource(const char* sourceName,
  396. bool generated = false);
  397. /**
  398. * Obtain a list of auxiliary source directories.
  399. */
  400. std::vector<std::string>& GetAuxSourceDirectories()
  401. {return this->AuxSourceDirectories;}
  402. //@{
  403. /**
  404. * Return a list of extensions associated with source and header
  405. * files
  406. */
  407. const std::vector<std::string>& GetSourceExtensions() const
  408. {return this->SourceFileExtensions;}
  409. const std::vector<std::string>& GetHeaderExtensions() const
  410. {return this->HeaderFileExtensions;}
  411. //@}
  412. /**
  413. * Given a variable name, return its value (as a string).
  414. * If the variable is not found in this makefile instance, the
  415. * cache is then queried.
  416. */
  417. const char* GetDefinition(const char*) const;
  418. const char* GetSafeDefinition(const char*) const;
  419. const char* GetRequiredDefinition(const char* name) const;
  420. /**
  421. * Get the list of all variables in the current space. If argument
  422. * cacheonly is specified and is greater than 0, then only cache
  423. * variables will be listed.
  424. */
  425. std::vector<std::string> GetDefinitions(int cacheonly=0) const;
  426. /** Test a boolean cache entry to see if it is true or false,
  427. * returns false if no entry defined.
  428. */
  429. bool IsOn(const char* name) const;
  430. bool IsSet(const char* name) const;
  431. /**
  432. * Get a list of preprocessor define flags.
  433. */
  434. const char* GetDefineFlags()
  435. {return this->DefineFlags.c_str();}
  436. /**
  437. * Make sure CMake can write this file
  438. */
  439. bool CanIWriteThisFile(const char* fileName);
  440. /**
  441. * Get the vector of used command instances.
  442. */
  443. const std::vector<cmCommand*>& GetUsedCommands() const
  444. {return this->UsedCommands;}
  445. #if defined(CMAKE_BUILD_WITH_CMAKE)
  446. /**
  447. * Get the vector source groups.
  448. */
  449. const std::vector<cmSourceGroup>& GetSourceGroups() const
  450. { return this->SourceGroups; }
  451. /**
  452. * Get the source group
  453. */
  454. cmSourceGroup* GetSourceGroup(const char* name);
  455. #endif
  456. /**
  457. * Get the vector of list files on which this makefile depends
  458. */
  459. const std::vector<std::string>& GetListFiles() const
  460. { return this->ListFiles; }
  461. ///! When the file changes cmake will be re-run from the build system.
  462. void AddCMakeDependFile(const char* file)
  463. { this->ListFiles.push_back(file);}
  464. /**
  465. * Expand all defined variables in the string.
  466. * Defined variables come from the this->Definitions map.
  467. * They are expanded with ${var} where var is the
  468. * entry in the this->Definitions map. Also @var@ is
  469. * expanded to match autoconf style expansions.
  470. */
  471. const char *ExpandVariablesInString(std::string& source) const;
  472. const char *ExpandVariablesInString(std::string& source, bool escapeQuotes,
  473. bool noEscapes,
  474. bool atOnly = false,
  475. const char* filename = 0,
  476. long line = -1,
  477. bool removeEmpty = false) const;
  478. /**
  479. * Remove any remaining variables in the string. Anything with ${var} or
  480. * @var@ will be removed.
  481. */
  482. void RemoveVariablesInString(std::string& source, bool atOnly = false) const;
  483. /**
  484. * Expand variables in the makefiles ivars such as link directories etc
  485. */
  486. void ExpandVariables();
  487. /**
  488. * Replace variables and #cmakedefine lines in the given string.
  489. * See cmConfigureFileCommand for details.
  490. */
  491. void ConfigureString(const std::string& input, std::string& output,
  492. bool atOnly, bool escapeQuotes);
  493. /**
  494. * Copy file but change lines acording to ConfigureString
  495. */
  496. int ConfigureFile(const char* infile, const char* outfile,
  497. bool copyonly, bool atOnly, bool escapeQuotes);
  498. #if defined(CMAKE_BUILD_WITH_CMAKE)
  499. /**
  500. * find what source group this source is in
  501. */
  502. cmSourceGroup& FindSourceGroup(const char* source,
  503. std::vector<cmSourceGroup> &groups);
  504. #endif
  505. void RegisterData(cmData*);
  506. void RegisterData(const char*, cmData*);
  507. cmData* LookupData(const char*) const;
  508. /**
  509. * Execute a single CMake command. Returns true if the command
  510. * succeeded or false if it failed.
  511. */
  512. bool ExecuteCommand(const cmListFileFunction& lff);
  513. /** Check if a command exists. */
  514. bool CommandExists(const char* name) const;
  515. /**
  516. * Add a command to this cmake instance
  517. */
  518. void AddCommand(cmCommand* );
  519. ///! Enable support for named language, if nil then all languages are enabled.
  520. void EnableLanguage(std::vector<std::string>const& languages);
  521. /**
  522. * Set/Get the name of the parent directories CMakeLists file
  523. * given a current CMakeLists file name
  524. */
  525. cmCacheManager *GetCacheManager() const;
  526. /**
  527. * Get the variable watch. This is used to determine when certain variables
  528. * are accessed.
  529. */
  530. #ifdef CMAKE_BUILD_WITH_CMAKE
  531. cmVariableWatch* GetVariableWatch() const;
  532. #endif
  533. ///! Display progress or status message.
  534. void DisplayStatus(const char*, float);
  535. /**
  536. * Expand the given list file arguments into the full set after
  537. * variable replacement and list expansion.
  538. */
  539. void ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
  540. std::vector<std::string>& outArgs);
  541. /**
  542. * Get the instance
  543. */
  544. cmake *GetCMakeInstance() const;
  545. /**
  546. * Get all the source files this makefile knows about
  547. */
  548. const std::vector<cmSourceFile*> &GetSourceFiles() const
  549. {return this->SourceFiles;}
  550. std::vector<cmSourceFile*> &GetSourceFiles() {return this->SourceFiles;}
  551. /**
  552. * Is there a source file that has the provided source file as an output?
  553. * if so then return it
  554. */
  555. cmSourceFile *GetSourceFileWithOutput(const char *outName);
  556. /**
  557. * Add a macro to the list of macros. The arguments should be name of the
  558. * macro and a documentation signature of it
  559. */
  560. void AddMacro(const char* name, const char* signature);
  561. ///! Add a new cmTest to the list of tests for this makefile.
  562. cmTest* CreateTest(const char* testName);
  563. /** Get a cmTest pointer for a given test name, if the name is
  564. * not found, then a null pointer is returned.
  565. */
  566. cmTest* GetTest(const char* testName) const;
  567. const std::vector<cmTest*> *GetTests() const;
  568. std::vector<cmTest*> *GetTests();
  569. /**
  570. * Get a list of macros as a ; separated string
  571. */
  572. void GetListOfMacros(std::string& macros);
  573. /**
  574. * Return a location of a file in cmake or custom modules directory
  575. */
  576. std::string GetModulesFile(const char* name);
  577. ///! Set/Get a property of this directory
  578. void SetProperty(const char *prop, const char *value);
  579. const char *GetProperty(const char *prop);
  580. bool GetPropertyAsBool(const char *prop) const;
  581. typedef std::map<cmStdString, cmStdString> DefinitionMap;
  582. ///! Initialize a makefile from its parent
  583. void InitializeFromParent();
  584. ///! Set/Get the preorder flag
  585. void SetPreOrder(bool p) { this->PreOrder = p; }
  586. bool GetPreOrder() { return this->PreOrder; }
  587. void AddInstallGenerator(cmInstallGenerator* g)
  588. { this->InstallGenerators.push_back(g); }
  589. std::vector<cmInstallGenerator*>& GetInstallGenerators()
  590. { return this->InstallGenerators; }
  591. protected:
  592. // add link libraries and directories to the target
  593. void AddGlobalLinkInformation(const char* name, cmTarget& target);
  594. std::string Prefix;
  595. std::vector<std::string> AuxSourceDirectories; //
  596. std::string cmStartDirectory;
  597. std::string StartOutputDirectory;
  598. std::string cmHomeDirectory;
  599. std::string HomeOutputDirectory;
  600. std::string cmCurrentListFile;
  601. std::string ProjectName; // project name
  602. // libraries, classes, and executables
  603. cmTargets Targets;
  604. std::vector<cmSourceFile*> SourceFiles;
  605. // Tests
  606. std::vector<cmTest*> Tests;
  607. // The include and link-library paths. These may have order
  608. // dependency, so they must be vectors (not set).
  609. std::vector<std::string> IncludeDirectories;
  610. std::vector<std::string> LinkDirectories;
  611. std::vector<std::string> ListFiles; // list of command files loaded
  612. cmTarget::LinkLibraryVectorType LinkLibraries;
  613. std::vector<cmInstallGenerator*> InstallGenerators;
  614. std::string IncludeFileRegularExpression;
  615. std::string ComplainFileRegularExpression;
  616. std::vector<std::string> SourceFileExtensions;
  617. std::vector<std::string> HeaderFileExtensions;
  618. std::string DefineFlags;
  619. #if defined(CMAKE_BUILD_WITH_CMAKE)
  620. std::vector<cmSourceGroup> SourceGroups;
  621. #endif
  622. DefinitionMap Definitions;
  623. std::vector<cmCommand*> UsedCommands;
  624. cmLocalGenerator* LocalGenerator;
  625. bool IsFunctionBlocked(const cmListFileFunction& lff);
  626. private:
  627. void ReadSources(std::ifstream& fin, bool t);
  628. friend class cmMakeDepend; // make depend needs direct access
  629. // to the Sources array
  630. void PrintStringVector(const char* s, const
  631. std::vector<std::pair<cmStdString, bool> >& v) const;
  632. void PrintStringVector(const char* s,
  633. const std::vector<std::string>& v) const;
  634. void AddDefaultDefinitions();
  635. std::list<cmFunctionBlocker *> FunctionBlockers;
  636. typedef std::map<cmStdString, cmData*> DataMapType;
  637. DataMapType DataMap;
  638. typedef std::map<cmStdString, cmStdString> StringStringMap;
  639. StringStringMap MacrosMap;
  640. std::map<cmStdString, bool> SubDirectoryOrder;
  641. // used in AddDefinition for performance improvement
  642. DefinitionMap::key_type TemporaryDefinitionKey;
  643. cmsys::RegularExpression cmDefineRegex;
  644. cmsys::RegularExpression cmDefine01Regex;
  645. std::map<cmStdString,cmStdString> Properties;
  646. // should this makefile be processed before or after processing the parent
  647. bool PreOrder;
  648. // stack of list files being read
  649. std::deque<cmStdString> ListFileStack;
  650. };
  651. #endif