cmMakefile.h 23 KB

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