cmMakefile.h 23 KB

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