cmMakefileTargetGenerator.cxx 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  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. #include "cmMakefileTargetGenerator.h"
  14. #include "cmGeneratedFileStream.h"
  15. #include "cmGlobalGenerator.h"
  16. #include "cmGlobalUnixMakefileGenerator3.h"
  17. #include "cmLocalUnixMakefileGenerator3.h"
  18. #include "cmMakefile.h"
  19. #include "cmSourceFile.h"
  20. #include "cmTarget.h"
  21. #include "cmake.h"
  22. #include "cmMakefileExecutableTargetGenerator.h"
  23. #include "cmMakefileLibraryTargetGenerator.h"
  24. #include "cmMakefileUtilityTargetGenerator.h"
  25. cmMakefileTargetGenerator::cmMakefileTargetGenerator()
  26. {
  27. this->BuildFileStream = 0;
  28. this->InfoFileStream = 0;
  29. this->FlagFileStream = 0;
  30. }
  31. cmMakefileTargetGenerator *
  32. cmMakefileTargetGenerator::New(cmLocalUnixMakefileGenerator3 *lg,
  33. cmStdString tgtName, cmTarget *tgt)
  34. {
  35. cmMakefileTargetGenerator *result = 0;
  36. switch (tgt->GetType())
  37. {
  38. case cmTarget::EXECUTABLE:
  39. result = new cmMakefileExecutableTargetGenerator;
  40. break;
  41. case cmTarget::STATIC_LIBRARY:
  42. case cmTarget::SHARED_LIBRARY:
  43. case cmTarget::MODULE_LIBRARY:
  44. result = new cmMakefileLibraryTargetGenerator;
  45. break;
  46. case cmTarget::UTILITY:
  47. result = new cmMakefileUtilityTargetGenerator;
  48. break;
  49. default:
  50. return result;
  51. // break; /* unreachable */
  52. }
  53. result->TargetName = tgtName;
  54. result->Target = tgt;
  55. result->LocalGenerator = lg;
  56. result->GlobalGenerator = lg->GetGlobalGenerator();
  57. result->Makefile = lg->GetMakefile();
  58. return result;
  59. }
  60. //----------------------------------------------------------------------------
  61. void cmMakefileTargetGenerator::CreateRuleFile()
  62. {
  63. // Create a directory for this target.
  64. this->TargetBuildDirectory =
  65. this->LocalGenerator->GetTargetDirectory(*this->Target);
  66. this->TargetBuildDirectoryFull =
  67. this->LocalGenerator->ConvertToFullPath(this->TargetBuildDirectory);
  68. cmSystemTools::MakeDirectory(this->TargetBuildDirectoryFull.c_str());
  69. // Construct the rule file name.
  70. this->BuildFileName = this->TargetBuildDirectory;
  71. this->BuildFileName += "/build.make";
  72. this->BuildFileNameFull = this->TargetBuildDirectoryFull;
  73. this->BuildFileNameFull += "/build.make";
  74. // Construct the rule file name.
  75. this->ProgressFileName = this->TargetBuildDirectory;
  76. this->ProgressFileName += "/progress.make";
  77. this->ProgressFileNameFull = this->TargetBuildDirectoryFull;
  78. this->ProgressFileNameFull += "/progress.make";
  79. // reset the progress count
  80. this->NumberOfProgressActions = 0;
  81. // Open the rule file. This should be copy-if-different because the
  82. // rules may depend on this file itself.
  83. this->BuildFileStream =
  84. new cmGeneratedFileStream(this->BuildFileNameFull.c_str());
  85. this->BuildFileStream->SetCopyIfDifferent(true);
  86. if(!this->BuildFileStream)
  87. {
  88. return;
  89. }
  90. this->LocalGenerator->WriteDisclaimer(*this->BuildFileStream);
  91. this->LocalGenerator->WriteSpecialTargetsTop(*this->BuildFileStream);
  92. this->LocalGenerator->WriteMakeVariables(*this->BuildFileStream);
  93. }
  94. //----------------------------------------------------------------------------
  95. void cmMakefileTargetGenerator::WriteTargetBuildRules()
  96. {
  97. // write the custom commands for this target
  98. // Look for files registered for cleaning in this directory.
  99. if(const char* additional_clean_files =
  100. this->Makefile->GetProperty
  101. ("ADDITIONAL_MAKE_CLEAN_FILES"))
  102. {
  103. cmSystemTools::ExpandListArgument(additional_clean_files,
  104. this->CleanFiles);
  105. }
  106. // add custom commands to the clean rules?
  107. const char* clean_no_custom =
  108. this->Makefile->GetProperty("CLEAN_NO_CUSTOM");
  109. bool clean = cmSystemTools::IsOff(clean_no_custom);
  110. // First generate the object rule files. Save a list of all object
  111. // files for this target.
  112. const std::vector<cmSourceFile*>& sources = this->Target->GetSourceFiles();
  113. for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
  114. source != sources.end(); ++source)
  115. {
  116. if(cmCustomCommand* cc = (*source)->GetCustomCommand())
  117. {
  118. this->GenerateCustomRuleFile(*cc);
  119. if (clean)
  120. {
  121. const std::vector<std::string>& outputs = cc->GetOutputs();
  122. for(std::vector<std::string>::const_iterator o = outputs.begin();
  123. o != outputs.end(); ++o)
  124. {
  125. this->CleanFiles.push_back
  126. (this->Convert(o->c_str(),
  127. cmLocalGenerator::START_OUTPUT,
  128. cmLocalGenerator::UNCHANGED));
  129. }
  130. }
  131. }
  132. else if(!(*source)->GetPropertyAsBool("HEADER_FILE_ONLY"))
  133. {
  134. if(!this->GlobalGenerator->IgnoreFile
  135. ((*source)->GetSourceExtension().c_str()))
  136. {
  137. // Generate this object file's rule file.
  138. this->WriteObjectRuleFiles(*(*source));
  139. }
  140. else if((*source)->GetPropertyAsBool("EXTERNAL_OBJECT"))
  141. {
  142. // This is an external object file. Just add it.
  143. this->ExternalObjects.push_back((*source)->GetFullPath());
  144. }
  145. else
  146. {
  147. // We only get here if a source file is not an external object
  148. // and has an extension that is listed as an ignored file type
  149. // for this language. No message or diagnosis should be
  150. // given.
  151. }
  152. }
  153. }
  154. }
  155. //----------------------------------------------------------------------------
  156. void cmMakefileTargetGenerator::WriteCommonCodeRules()
  157. {
  158. // Include the dependencies for the target.
  159. std::string dependFileNameFull = this->TargetBuildDirectoryFull;
  160. dependFileNameFull += "/depend.make";
  161. *this->BuildFileStream
  162. << "# Include any dependencies generated for this target.\n"
  163. << this->LocalGenerator->IncludeDirective << " "
  164. << this->Convert(dependFileNameFull.c_str(),
  165. cmLocalGenerator::HOME_OUTPUT,
  166. cmLocalGenerator::MAKEFILE)
  167. << "\n\n";
  168. // Include the progress variables for the target.
  169. *this->BuildFileStream
  170. << "# Include the progress variables for this target.\n"
  171. << this->LocalGenerator->IncludeDirective << " "
  172. << this->Convert(this->ProgressFileNameFull.c_str(),
  173. cmLocalGenerator::HOME_OUTPUT,
  174. cmLocalGenerator::MAKEFILE)
  175. << "\n\n";
  176. // make sure the depend file exists
  177. if (!cmSystemTools::FileExists(dependFileNameFull.c_str()))
  178. {
  179. // Write an empty dependency file.
  180. cmGeneratedFileStream depFileStream(dependFileNameFull.c_str());
  181. depFileStream
  182. << "# Empty dependencies file for " << this->Target->GetName() << ".\n"
  183. << "# This may be replaced when dependencies are built." << std::endl;
  184. }
  185. // Open the flags file. This should be copy-if-different because the
  186. // rules may depend on this file itself.
  187. this->FlagFileNameFull = this->TargetBuildDirectoryFull;
  188. this->FlagFileNameFull += "/flags.make";
  189. this->FlagFileStream =
  190. new cmGeneratedFileStream(this->FlagFileNameFull.c_str());
  191. this->FlagFileStream->SetCopyIfDifferent(true);
  192. if(!this->FlagFileStream)
  193. {
  194. return;
  195. }
  196. this->LocalGenerator->WriteDisclaimer(*this->FlagFileStream);
  197. // Include the flags for the target.
  198. *this->BuildFileStream
  199. << "# Include the compile flags for this target's objects.\n"
  200. << this->LocalGenerator->IncludeDirective << " "
  201. << this->Convert(this->FlagFileNameFull.c_str(),
  202. cmLocalGenerator::HOME_OUTPUT,
  203. cmLocalGenerator::MAKEFILE)
  204. << "\n\n";
  205. }
  206. //----------------------------------------------------------------------------
  207. void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
  208. {
  209. // write language flags for target
  210. std::map<cmStdString,cmLocalUnixMakefileGenerator3::IntegrityCheckSet>&
  211. checkSet =
  212. this->LocalGenerator->GetIntegrityCheckSet()[this->Target->GetName()];
  213. for(std::map<cmStdString,
  214. cmLocalUnixMakefileGenerator3::IntegrityCheckSet>::const_iterator
  215. l = checkSet.begin(); l != checkSet.end(); ++l)
  216. {
  217. const char *lang = l->first.c_str();
  218. std::string flags;
  219. // Add the export symbol definition for shared library objects.
  220. bool shared = ((this->Target->GetType() == cmTarget::SHARED_LIBRARY) ||
  221. (this->Target->GetType() == cmTarget::MODULE_LIBRARY));
  222. if(shared)
  223. {
  224. flags += "-D";
  225. if(const char* custom_export_name =
  226. this->Target->GetProperty("DEFINE_SYMBOL"))
  227. {
  228. flags += custom_export_name;
  229. }
  230. else
  231. {
  232. std::string in = this->Target->GetName();
  233. in += "_EXPORTS";
  234. flags += cmSystemTools::MakeCindentifier(in.c_str());
  235. }
  236. }
  237. // Add language-specific flags.
  238. this->LocalGenerator
  239. ->AddLanguageFlags(flags, lang,
  240. this->LocalGenerator->ConfigurationName.c_str());
  241. // Add shared-library flags if needed.
  242. this->LocalGenerator->AddSharedFlags(flags, lang, shared);
  243. // Add include directory flags.
  244. this->LocalGenerator->
  245. AppendFlags(flags, this->LocalGenerator->GetIncludeFlags(lang));
  246. // Add include directory flags.
  247. this->LocalGenerator->
  248. AppendFlags(flags,this->GetFrameworkFlags().c_str());
  249. *this->FlagFileStream << lang << "_FLAGS = " << flags << "\n\n";
  250. }
  251. }
  252. //----------------------------------------------------------------------------
  253. void cmMakefileTargetGenerator::WriteObjectRuleFiles(cmSourceFile& source)
  254. {
  255. // Identify the language of the source file.
  256. const char* lang = this->LocalGenerator->GetSourceFileLanguage(source);
  257. if(!lang)
  258. {
  259. // don't know anything about this file so skip it
  260. return;
  261. }
  262. // Get the full path name of the object file.
  263. std::string objNoTargetDir;
  264. std::string obj =
  265. this->LocalGenerator->GetObjectFileName(*this->Target, source,
  266. &objNoTargetDir);
  267. // Avoid generating duplicate rules.
  268. if(this->ObjectFiles.find(obj) == this->ObjectFiles.end())
  269. {
  270. this->ObjectFiles.insert(obj);
  271. }
  272. else
  273. {
  274. cmOStringStream err;
  275. err << "Warning: Source file \""
  276. << source.GetSourceName().c_str() << "."
  277. << source.GetSourceExtension().c_str()
  278. << "\" is listed multiple times for target \""
  279. << this->Target->GetName()
  280. << "\".";
  281. cmSystemTools::Message(err.str().c_str(), "Warning");
  282. return;
  283. }
  284. // Create the directory containing the object file. This may be a
  285. // subdirectory under the target's directory.
  286. std::string dir = cmSystemTools::GetFilenamePath(obj.c_str());
  287. cmSystemTools::MakeDirectory
  288. (this->LocalGenerator->ConvertToFullPath(dir).c_str());
  289. // Save this in the target's list of object files.
  290. if ( source.GetPropertyAsBool("EXTRA_CONTENT") )
  291. {
  292. this->ExtraContent.insert(obj);
  293. }
  294. this->Objects.push_back(obj);
  295. // TODO: Remove
  296. //std::string relativeObj
  297. //= this->LocalGenerator->GetHomeRelativeOutputPath();
  298. //relativeObj += obj;
  299. // we compute some depends when writing the depend.make that we will also
  300. // use in the build.make, same with depMakeFile
  301. std::vector<std::string> depends;
  302. std::string depMakeFile;
  303. // generate the build rule file
  304. this->WriteObjectBuildFile(obj, lang, source, depends);
  305. // The object file should be checked for dependency integrity.
  306. this->LocalGenerator->
  307. CheckDependFiles[this->Target->GetName()][lang].insert(&source);
  308. // add this to the list of objects for this local generator
  309. if(cmSystemTools::FileIsFullPath(objNoTargetDir.c_str()))
  310. {
  311. objNoTargetDir = cmSystemTools::GetFilenameName(objNoTargetDir);
  312. }
  313. this->LocalGenerator->LocalObjectFiles[objNoTargetDir].
  314. push_back(this->Target);
  315. }
  316. //----------------------------------------------------------------------------
  317. void
  318. cmMakefileTargetGenerator
  319. ::WriteObjectBuildFile(std::string &obj,
  320. const char *lang,
  321. cmSourceFile& source,
  322. std::vector<std::string>& depends)
  323. {
  324. this->LocalGenerator->AppendRuleDepend(depends,
  325. this->FlagFileNameFull.c_str());
  326. // generate the depend scanning rule
  327. this->WriteObjectDependRules(source, depends);
  328. std::string relativeObj = this->LocalGenerator->GetHomeRelativeOutputPath();
  329. if ( source.GetPropertyAsBool("MACOSX_CONTENT") )
  330. {
  331. relativeObj = "";
  332. }
  333. relativeObj += obj;
  334. if(this->Makefile->GetDefinition("CMAKE_WINDOWS_OBJECT_PATH"))
  335. {
  336. relativeObj = cmSystemTools::ConvertToOutputPath(relativeObj.c_str());
  337. }
  338. // Write the build rule.
  339. // Build the set of compiler flags.
  340. std::string flags;
  341. // Add language-specific flags.
  342. std::string langFlags = "$(";
  343. langFlags += lang;
  344. langFlags += "_FLAGS)";
  345. this->LocalGenerator->AppendFlags(flags, langFlags.c_str());
  346. // Add target-specific flags.
  347. if(this->Target->GetProperty("COMPILE_FLAGS"))
  348. {
  349. this->LocalGenerator->AppendFlags
  350. (flags, this->Target->GetProperty("COMPILE_FLAGS"));
  351. }
  352. // Add flags from source file properties.
  353. if (source.GetProperty("COMPILE_FLAGS"))
  354. {
  355. this->LocalGenerator->AppendFlags
  356. (flags, source.GetProperty("COMPILE_FLAGS"));
  357. *this->FlagFileStream << "# Custom flags: "
  358. << relativeObj << "_FLAGS = "
  359. << source.GetProperty("COMPILE_FLAGS")
  360. << "\n"
  361. << "\n";
  362. }
  363. // Get the output paths for source and object files.
  364. std::string sourceFile = source.GetFullPath();
  365. if(this->LocalGenerator->UseRelativePaths)
  366. {
  367. sourceFile = this->Convert(sourceFile.c_str(),
  368. cmLocalGenerator::HOME_OUTPUT);
  369. }
  370. sourceFile = this->Convert(sourceFile.c_str(),
  371. cmLocalGenerator::NONE,
  372. cmLocalGenerator::SHELL);
  373. std::string objectFile = this->Convert(obj.c_str(),
  374. cmLocalGenerator::START_OUTPUT,
  375. cmLocalGenerator::SHELL);
  376. // Construct the build message.
  377. std::vector<std::string> no_commands;
  378. std::vector<std::string> commands;
  379. // add in a progress call if needed
  380. std::string progressDir = this->Makefile->GetHomeOutputDirectory();
  381. progressDir += cmake::GetCMakeFilesDirectory();
  382. cmOStringStream progCmd;
  383. progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
  384. progCmd << this->LocalGenerator->Convert(progressDir.c_str(),
  385. cmLocalGenerator::FULL,
  386. cmLocalGenerator::SHELL);
  387. this->NumberOfProgressActions++;
  388. progCmd << " $(CMAKE_PROGRESS_"
  389. << this->NumberOfProgressActions
  390. << ")";
  391. commands.push_back(progCmd.str());
  392. std::string buildEcho = "Building ";
  393. buildEcho += lang;
  394. buildEcho += " object ";
  395. buildEcho += relativeObj;
  396. this->LocalGenerator->AppendEcho(commands, buildEcho.c_str(),
  397. cmLocalUnixMakefileGenerator3::EchoBuild);
  398. // Construct the compile rules.
  399. std::string compileRuleVar = "CMAKE_";
  400. compileRuleVar += lang;
  401. compileRuleVar += "_COMPILE_OBJECT";
  402. std::string compileRule =
  403. this->Makefile->GetRequiredDefinition(compileRuleVar.c_str());
  404. cmSystemTools::ExpandListArgument(compileRule, commands);
  405. std::string outpath = this->Makefile->GetStartOutputDirectory();
  406. outpath += "/";
  407. outpath += this->Target->GetName();
  408. outpath += ".pdb";
  409. outpath = this->Convert(outpath.c_str(), cmLocalGenerator::FULL,
  410. cmLocalGenerator::MAKEFILE);
  411. cmLocalGenerator::RuleVariables vars;
  412. vars.Language = lang;
  413. vars.TargetPDB = outpath.c_str();
  414. vars.Source = sourceFile.c_str();
  415. vars.Object = relativeObj.c_str();
  416. std::string objdir = this->LocalGenerator->GetHomeRelativeOutputPath();
  417. objdir = this->Convert(objdir.c_str(),
  418. cmLocalGenerator::START_OUTPUT,
  419. cmLocalGenerator::SHELL);
  420. std::string objectDir = cmSystemTools::GetFilenamePath(obj);
  421. vars.ObjectDir = objectDir.c_str();
  422. vars.Flags = flags.c_str();
  423. // Expand placeholders in the commands.
  424. for(std::vector<std::string>::iterator i = commands.begin();
  425. i != commands.end(); ++i)
  426. {
  427. this->LocalGenerator->ExpandRuleVariables(*i, vars);
  428. }
  429. // Make the target dependency scanning rule include cmake-time-known
  430. // dependencies. The others are handled by the check-build-system
  431. // path.
  432. std::string depMark =
  433. this->LocalGenerator->GetRelativeTargetDirectory(*this->Target);
  434. depMark += "/depend.make.mark";
  435. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  436. depMark.c_str(),
  437. depends, no_commands, false);
  438. // Write the rule.
  439. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  440. relativeObj.c_str(),
  441. depends, commands, false);
  442. bool do_preprocess_rules =
  443. this->LocalGenerator->GetCreatePreprocessedSourceRules();
  444. bool do_assembly_rules =
  445. this->LocalGenerator->GetCreateAssemblySourceRules();
  446. if(do_preprocess_rules || do_assembly_rules)
  447. {
  448. std::vector<std::string> force_depends;
  449. force_depends.push_back("cmake_force");
  450. std::string::size_type dot_pos = relativeObj.rfind(".");
  451. std::string relativeObjBase = relativeObj.substr(0, dot_pos);
  452. if(do_preprocess_rules)
  453. {
  454. commands.clear();
  455. std::string relativeObjE = relativeObjBase + ".E";
  456. std::string preprocessEcho = "Preprocessing ";
  457. preprocessEcho += lang;
  458. preprocessEcho += " source to ";
  459. preprocessEcho += relativeObjE;
  460. this->LocalGenerator->AppendEcho(
  461. commands, preprocessEcho.c_str(),
  462. cmLocalUnixMakefileGenerator3::EchoBuild
  463. );
  464. std::string preprocessRuleVar = "CMAKE_";
  465. preprocessRuleVar += lang;
  466. preprocessRuleVar += "_CREATE_PREPROCESSED_SOURCE";
  467. if(const char* preprocessRule =
  468. this->Makefile->GetDefinition(preprocessRuleVar.c_str()))
  469. {
  470. cmSystemTools::ExpandListArgument(preprocessRule, commands);
  471. vars.PreprocessedSource = relativeObjE.c_str();
  472. // Expand placeholders in the commands.
  473. for(std::vector<std::string>::iterator i = commands.begin();
  474. i != commands.end(); ++i)
  475. {
  476. this->LocalGenerator->ExpandRuleVariables(*i, vars);
  477. }
  478. }
  479. else
  480. {
  481. std::string cmd = "$(CMAKE_COMMAND) -E cmake_unimplemented_variable ";
  482. cmd += preprocessRuleVar;
  483. commands.push_back(cmd);
  484. }
  485. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  486. relativeObjE.c_str(),
  487. force_depends, commands, false);
  488. }
  489. if(do_assembly_rules)
  490. {
  491. commands.clear();
  492. std::string relativeObjS = relativeObjBase + ".S";
  493. std::string assemblyEcho = "Compiling ";
  494. assemblyEcho += lang;
  495. assemblyEcho += " source to assembly ";
  496. assemblyEcho += relativeObjS;
  497. this->LocalGenerator->AppendEcho(
  498. commands, assemblyEcho.c_str(),
  499. cmLocalUnixMakefileGenerator3::EchoBuild
  500. );
  501. std::string assemblyRuleVar = "CMAKE_";
  502. assemblyRuleVar += lang;
  503. assemblyRuleVar += "_CREATE_ASSEMBLY_SOURCE";
  504. if(const char* assemblyRule =
  505. this->Makefile->GetDefinition(assemblyRuleVar.c_str()))
  506. {
  507. cmSystemTools::ExpandListArgument(assemblyRule, commands);
  508. vars.AssemblySource = relativeObjS.c_str();
  509. // Expand placeholders in the commands.
  510. for(std::vector<std::string>::iterator i = commands.begin();
  511. i != commands.end(); ++i)
  512. {
  513. this->LocalGenerator->ExpandRuleVariables(*i, vars);
  514. }
  515. }
  516. else
  517. {
  518. std::string cmd = "$(CMAKE_COMMAND) -E cmake_unimplemented_variable ";
  519. cmd += assemblyRuleVar;
  520. commands.push_back(cmd);
  521. }
  522. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  523. relativeObjS.c_str(),
  524. force_depends, commands, false);
  525. }
  526. }
  527. // If the language needs provides-requires mode, create the
  528. // corresponding targets.
  529. std::string objectRequires = relativeObj;
  530. objectRequires += ".requires";
  531. std::vector<std::string> p_depends;
  532. // always provide an empty requires target
  533. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  534. objectRequires.c_str(), p_depends,
  535. no_commands, true);
  536. // write a build rule to recursively build what this obj provides
  537. std::string objectProvides = relativeObj;
  538. objectProvides += ".provides";
  539. std::string temp = relativeObj;
  540. temp += ".provides.build";
  541. std::vector<std::string> r_commands;
  542. std::string tgtMakefileName =
  543. this->LocalGenerator->GetRelativeTargetDirectory(*this->Target);
  544. tgtMakefileName += "/build.make";
  545. r_commands.push_back
  546. (this->LocalGenerator->GetRecursiveMakeCall(tgtMakefileName.c_str(),
  547. temp.c_str()));
  548. p_depends.clear();
  549. p_depends.push_back(objectRequires);
  550. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  551. objectProvides.c_str(), p_depends,
  552. r_commands, true);
  553. // write the provides.build rule dependency on the obj file
  554. p_depends.clear();
  555. p_depends.push_back(relativeObj);
  556. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  557. temp.c_str(), p_depends, no_commands,
  558. true);
  559. }
  560. //----------------------------------------------------------------------------
  561. void cmMakefileTargetGenerator::WriteTargetRequiresRules()
  562. {
  563. std::vector<std::string> depends;
  564. std::vector<std::string> no_commands;
  565. // Construct the name of the dependency generation target.
  566. std::string depTarget =
  567. this->LocalGenerator->GetRelativeTargetDirectory(*this->Target);
  568. depTarget += "/requires";
  569. // This target drives dependency generation for all object files.
  570. std::string relPath = this->LocalGenerator->GetHomeRelativeOutputPath();
  571. std::string objTarget;
  572. for(std::vector<std::string>::const_iterator obj = this->Objects.begin();
  573. obj != this->Objects.end(); ++obj)
  574. {
  575. objTarget = relPath;
  576. objTarget += *obj;
  577. objTarget += ".requires";
  578. depends.push_back(objTarget);
  579. }
  580. // Write the rule.
  581. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  582. depTarget.c_str(),
  583. depends, no_commands, true);
  584. }
  585. //----------------------------------------------------------------------------
  586. void cmMakefileTargetGenerator::WriteTargetCleanRules()
  587. {
  588. std::vector<std::string> depends;
  589. std::vector<std::string> commands;
  590. // Construct the clean target name.
  591. std::string cleanTarget =
  592. this->LocalGenerator->GetRelativeTargetDirectory(*this->Target);
  593. cleanTarget += "/clean";
  594. // Construct the clean command.
  595. this->LocalGenerator->AppendCleanCommand(commands, this->CleanFiles,
  596. *this->Target);
  597. this->LocalGenerator->CreateCDCommand
  598. (commands,
  599. this->Makefile->GetStartOutputDirectory(),
  600. this->Makefile->GetHomeOutputDirectory());
  601. // Write the rule.
  602. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  603. cleanTarget.c_str(),
  604. depends, commands, true);
  605. }
  606. //----------------------------------------------------------------------------
  607. void cmMakefileTargetGenerator::WriteTargetDependRules()
  608. {
  609. // must write the targets depend info file
  610. std::string dir = this->LocalGenerator->GetTargetDirectory(*this->Target);
  611. this->InfoFileNameFull = dir;
  612. this->InfoFileNameFull += "/DependInfo.cmake";
  613. this->InfoFileNameFull =
  614. this->LocalGenerator->ConvertToFullPath(this->InfoFileNameFull);
  615. this->InfoFileStream =
  616. new cmGeneratedFileStream(this->InfoFileNameFull.c_str());
  617. this->InfoFileStream->SetCopyIfDifferent(true);
  618. if(!*this->InfoFileStream)
  619. {
  620. return;
  621. }
  622. this->LocalGenerator->
  623. WriteDependLanguageInfo(*this->InfoFileStream,*this->Target);
  624. // and now write the rule to use it
  625. std::vector<std::string> depends;
  626. std::vector<std::string> commands;
  627. // Construct the name of the dependency generation target.
  628. std::string depTarget =
  629. this->LocalGenerator->GetRelativeTargetDirectory(*this->Target);
  630. depTarget += "/depend";
  631. std::string depMark = depTarget;
  632. depMark += ".make.mark";
  633. depends.push_back(depMark);
  634. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  635. depTarget.c_str(),
  636. depends, commands, true);
  637. depends.clear();
  638. // Write the dependency generation rule.
  639. std::string depEcho = "Scanning dependencies of target ";
  640. depEcho += this->Target->GetName();
  641. this->LocalGenerator->AppendEcho(commands, depEcho.c_str(),
  642. cmLocalUnixMakefileGenerator3::EchoDepend);
  643. // Add a command to call CMake to scan dependencies. CMake will
  644. // touch the corresponding depends file after scanning dependencies.
  645. cmOStringStream depCmd;
  646. // TODO: Account for source file properties and directory-level
  647. // definitions when scanning for dependencies.
  648. #if !defined(_WIN32) || defined(__CYGWIN__)
  649. // This platform supports symlinks, so cmSystemTools will translate
  650. // paths. Make sure PWD is set to the original name of the home
  651. // output directory to help cmSystemTools to create the same
  652. // translation table for the dependency scanning process.
  653. depCmd << "cd "
  654. << (this->LocalGenerator->Convert(
  655. this->Makefile->GetHomeOutputDirectory(),
  656. cmLocalGenerator::FULL, cmLocalGenerator::SHELL))
  657. << " && ";
  658. #endif
  659. // Generate a call this signature:
  660. //
  661. // cmake -E cmake_depends <generator>
  662. // <home-src-dir> <start-src-dir>
  663. // <home-out-dir> <start-out-dir>
  664. // <dep-info>
  665. //
  666. // This gives the dependency scanner enough information to recreate
  667. // the state of our local generator sufficiently for its needs.
  668. depCmd << "$(CMAKE_COMMAND) -E cmake_depends \""
  669. << this->GlobalGenerator->GetName() << "\" "
  670. << this->Convert(this->Makefile->GetHomeDirectory(),
  671. cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
  672. << " "
  673. << this->Convert(this->Makefile->GetStartDirectory(),
  674. cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
  675. << " "
  676. << this->Convert(this->Makefile->GetHomeOutputDirectory(),
  677. cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
  678. << " "
  679. << this->Convert(this->Makefile->GetStartOutputDirectory(),
  680. cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
  681. << " "
  682. << this->Convert(this->InfoFileNameFull.c_str(),
  683. cmLocalGenerator::FULL, cmLocalGenerator::SHELL);
  684. commands.push_back(depCmd.str());
  685. // Write the rule.
  686. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  687. depMark.c_str(),
  688. depends, commands, false);
  689. }
  690. //----------------------------------------------------------------------------
  691. void cmMakefileTargetGenerator
  692. ::WriteObjectDependRules(cmSourceFile& source,
  693. std::vector<std::string>& depends)
  694. {
  695. // Create the list of dependencies known at cmake time. These are
  696. // shared between the object file and dependency scanning rule.
  697. depends.push_back(source.GetFullPath());
  698. if(const char* objectDeps = source.GetProperty("OBJECT_DEPENDS"))
  699. {
  700. std::vector<std::string> deps;
  701. cmSystemTools::ExpandListArgument(objectDeps, deps);
  702. for(std::vector<std::string>::iterator i = deps.begin();
  703. i != deps.end(); ++i)
  704. {
  705. depends.push_back(i->c_str());
  706. }
  707. }
  708. }
  709. //----------------------------------------------------------------------------
  710. void cmMakefileTargetGenerator
  711. ::GenerateCustomRuleFile(const cmCustomCommand& cc)
  712. {
  713. // Collect the commands.
  714. std::vector<std::string> commands;
  715. std::string comment = this->LocalGenerator->ConstructComment(cc);
  716. if(!comment.empty())
  717. {
  718. // add in a progress call if needed
  719. std::string progressDir = this->Makefile->GetHomeOutputDirectory();
  720. progressDir += cmake::GetCMakeFilesDirectory();
  721. cmOStringStream progCmd;
  722. progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
  723. progCmd << this->LocalGenerator->Convert(progressDir.c_str(),
  724. cmLocalGenerator::FULL,
  725. cmLocalGenerator::SHELL);
  726. this->NumberOfProgressActions++;
  727. progCmd << " $(CMAKE_PROGRESS_"
  728. << this->NumberOfProgressActions
  729. << ")";
  730. commands.push_back(progCmd.str());
  731. this->LocalGenerator
  732. ->AppendEcho(commands, comment.c_str(),
  733. cmLocalUnixMakefileGenerator3::EchoGenerate);
  734. }
  735. this->LocalGenerator->AppendCustomCommand(commands, cc);
  736. // Collect the dependencies.
  737. std::vector<std::string> depends;
  738. this->LocalGenerator->AppendCustomDepend(depends, cc);
  739. // Write the rule.
  740. const std::vector<std::string>& outputs = cc.GetOutputs();
  741. std::vector<std::string>::const_iterator o = outputs.begin();
  742. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  743. o->c_str(), depends, commands,
  744. false);
  745. // If the rule has multiple outputs, add a rule for the extra
  746. // outputs to just depend on the first output with no command. Also
  747. // register the extra outputs as paired with the first output so
  748. // that the check-build-system step will remove the primary output
  749. // if any extra outputs are missing, forcing the rule to regenerate
  750. // all outputs.
  751. depends.clear();
  752. depends.push_back(*o);
  753. commands.clear();
  754. cmGlobalUnixMakefileGenerator3* gg =
  755. static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
  756. std::string emptyCommand = gg->GetEmptyCommandHack();
  757. if(!emptyCommand.empty())
  758. {
  759. commands.push_back(emptyCommand);
  760. }
  761. for(++o; o != outputs.end(); ++o)
  762. {
  763. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
  764. o->c_str(), depends, commands,
  765. false);
  766. gg->AddMultipleOutputPair(o->c_str(), depends[0].c_str());
  767. }
  768. }
  769. //----------------------------------------------------------------------------
  770. void
  771. cmMakefileTargetGenerator
  772. ::WriteObjectsVariable(std::string& variableName,
  773. std::string& variableNameExternal)
  774. {
  775. // Write a make variable assignment that lists all objects for the
  776. // target.
  777. variableName =
  778. this->LocalGenerator->CreateMakeVariable(this->Target->GetName(),
  779. "_OBJECTS");
  780. *this->BuildFileStream
  781. << "# Object files for target " << this->Target->GetName() << "\n"
  782. << variableName.c_str() << " =";
  783. std::string object;
  784. const char* objName =
  785. this->Makefile->GetDefinition("CMAKE_NO_QUOTED_OBJECTS");
  786. const char* lineContinue =
  787. this->Makefile->GetDefinition("CMAKE_MAKE_LINE_CONTINUE");
  788. if(!lineContinue)
  789. {
  790. lineContinue = "\\";
  791. }
  792. for(std::vector<std::string>::const_iterator i = this->Objects.begin();
  793. i != this->Objects.end(); ++i)
  794. {
  795. if ( this->ExtraContent.find(i->c_str()) != this->ExtraContent.end() )
  796. {
  797. continue;
  798. }
  799. *this->BuildFileStream << " " << lineContinue << "\n";
  800. if(objName)
  801. {
  802. *this->BuildFileStream <<
  803. this->Convert(i->c_str(), cmLocalGenerator::START_OUTPUT,
  804. cmLocalGenerator::MAKEFILE);
  805. }
  806. else
  807. {
  808. *this->BuildFileStream <<
  809. this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str());
  810. }
  811. }
  812. *this->BuildFileStream << "\n";
  813. // Write a make variable assignment that lists all external objects
  814. // for the target.
  815. variableNameExternal =
  816. this->LocalGenerator->CreateMakeVariable(this->Target->GetName(),
  817. "_EXTERNAL_OBJECTS");
  818. *this->BuildFileStream
  819. << "\n"
  820. << "# External object files for target "
  821. << this->Target->GetName() << "\n"
  822. << variableNameExternal.c_str() << " =";
  823. for(std::vector<std::string>::const_iterator i =
  824. this->ExternalObjects.begin();
  825. i != this->ExternalObjects.end(); ++i)
  826. {
  827. object = this->Convert(i->c_str(),cmLocalGenerator::START_OUTPUT);
  828. *this->BuildFileStream
  829. << " " << lineContinue << "\n"
  830. << this->Makefile->GetSafeDefinition("CMAKE_OBJECT_NAME");
  831. if(objName)
  832. {
  833. *this->BuildFileStream <<
  834. this->Convert(i->c_str(), cmLocalGenerator::START_OUTPUT,
  835. cmLocalGenerator::MAKEFILE);
  836. }
  837. else
  838. {
  839. *this->BuildFileStream <<
  840. this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str());
  841. }
  842. }
  843. *this->BuildFileStream << "\n" << "\n";
  844. }
  845. //----------------------------------------------------------------------------
  846. void
  847. cmMakefileTargetGenerator
  848. ::WriteObjectsString(std::string& buildObjs)
  849. {
  850. std::string object;
  851. const char* no_quoted =
  852. this->Makefile->GetDefinition("CMAKE_NO_QUOTED_OBJECTS");
  853. const char* space = "";
  854. for(std::vector<std::string>::const_iterator i = this->Objects.begin();
  855. i != this->Objects.end(); ++i)
  856. {
  857. if ( this->ExtraContent.find(i->c_str()) != this->ExtraContent.end() )
  858. {
  859. continue;
  860. }
  861. buildObjs += space;
  862. space = " ";
  863. if(no_quoted)
  864. {
  865. buildObjs +=
  866. this->Convert(i->c_str(), cmLocalGenerator::START_OUTPUT,
  867. cmLocalGenerator::SHELL);
  868. }
  869. else
  870. {
  871. buildObjs +=
  872. this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str());
  873. }
  874. }
  875. for(std::vector<std::string>::const_iterator i =
  876. this->ExternalObjects.begin();
  877. i != this->ExternalObjects.end(); ++i)
  878. {
  879. buildObjs += space;
  880. space = " ";
  881. if(no_quoted)
  882. {
  883. buildObjs +=
  884. this->Convert(i->c_str(), cmLocalGenerator::START_OUTPUT,
  885. cmLocalGenerator::SHELL);
  886. }
  887. else
  888. {
  889. buildObjs +=
  890. this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str());
  891. }
  892. }
  893. }
  894. //----------------------------------------------------------------------------
  895. void cmMakefileTargetGenerator::WriteTargetDriverRule(const char* main_output,
  896. bool relink)
  897. {
  898. // Compute the name of the driver target.
  899. std::string dir = this->Makefile->GetStartOutputDirectory();
  900. dir += "/";
  901. dir += this->LocalGenerator->GetTargetDirectory(*this->Target);
  902. std::string buildTargetRuleName = dir;
  903. buildTargetRuleName += relink?"/preinstall":"/build";
  904. buildTargetRuleName = this->Convert(buildTargetRuleName.c_str(),
  905. cmLocalGenerator::HOME_OUTPUT,
  906. cmLocalGenerator::MAKEFILE);
  907. // Build the list of target outputs to drive.
  908. std::vector<std::string> depends;
  909. if(main_output)
  910. {
  911. depends.push_back(main_output);
  912. }
  913. const char* comment = 0;
  914. if(relink)
  915. {
  916. // Setup the comment for the preinstall driver.
  917. comment = "Rule to relink during preinstall.";
  918. }
  919. else
  920. {
  921. // Setup the comment for the main build driver.
  922. comment = "Rule to build all files generated by this target.";
  923. // Make sure all custom command outputs in this target are built.
  924. const std::vector<cmSourceFile*>& sources =
  925. this->Target->GetSourceFiles();
  926. for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
  927. source != sources.end(); ++source)
  928. {
  929. if(cmCustomCommand* cc = (*source)->GetCustomCommand())
  930. {
  931. const std::vector<std::string>& outputs = cc->GetOutputs();
  932. for(std::vector<std::string>::const_iterator o = outputs.begin();
  933. o != outputs.end(); ++o)
  934. {
  935. depends.push_back(*o);
  936. }
  937. }
  938. }
  939. }
  940. // Write the driver rule.
  941. std::vector<std::string> no_commands;
  942. this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, comment,
  943. buildTargetRuleName.c_str(),
  944. depends, no_commands, true);
  945. }
  946. //----------------------------------------------------------------------------
  947. std::string cmMakefileTargetGenerator::GetFrameworkFlags()
  948. {
  949. #ifndef __APPLE__
  950. return std::string();
  951. #else
  952. std::set<cmStdString> emitted;
  953. std::vector<std::string> includes;
  954. this->LocalGenerator->GetIncludeDirectories(includes);
  955. std::vector<std::string>::iterator i;
  956. // check all include directories for frameworks as this
  957. // will already have added a -F for the framework
  958. for(i = includes.begin(); i != includes.end(); ++i)
  959. {
  960. if(cmSystemTools::IsPathToFramework(i->c_str()))
  961. {
  962. std::string frameworkDir = *i;
  963. frameworkDir += "/../";
  964. frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str());
  965. emitted.insert(frameworkDir);
  966. }
  967. }
  968. std::string flags;
  969. std::vector<std::string>& frameworks = this->Target->GetFrameworks();
  970. for(i = frameworks.begin();
  971. i != frameworks.end(); ++i)
  972. {
  973. if(emitted.insert(*i).second)
  974. {
  975. flags += "-F";
  976. flags += this->LocalGenerator->ConvertToOutputForExisting(i->c_str());
  977. flags += " ";
  978. }
  979. }
  980. return flags;
  981. #endif
  982. }
  983. //----------------------------------------------------------------------------
  984. void cmMakefileTargetGenerator
  985. ::AppendTargetDepends(std::vector<std::string>& depends)
  986. {
  987. // Static libraries never depend on anything for linking.
  988. if(this->Target->GetType() == cmTarget::STATIC_LIBRARY)
  989. {
  990. return;
  991. }
  992. // Keep track of dependencies already listed.
  993. std::set<cmStdString> emitted;
  994. // A target should not depend on itself.
  995. emitted.insert(this->Target->GetName());
  996. // Loop over all library dependencies.
  997. const cmTarget::LinkLibraryVectorType& tlibs =
  998. this->Target->GetLinkLibraries();
  999. for(cmTarget::LinkLibraryVectorType::const_iterator lib = tlibs.begin();
  1000. lib != tlibs.end(); ++lib)
  1001. {
  1002. // Don't emit the same library twice for this target.
  1003. if(emitted.insert(lib->first).second)
  1004. {
  1005. // Depend only on other CMake targets.
  1006. if(cmTarget* tgt =
  1007. this->GlobalGenerator->FindTarget(0, lib->first.c_str()))
  1008. {
  1009. if(const char* location =
  1010. tgt->GetLocation(this->LocalGenerator->ConfigurationName.c_str()))
  1011. {
  1012. depends.push_back(location);
  1013. }
  1014. }
  1015. }
  1016. }
  1017. }
  1018. //----------------------------------------------------------------------------
  1019. void cmMakefileTargetGenerator
  1020. ::CloseFileStreams()
  1021. {
  1022. delete this->BuildFileStream;
  1023. delete this->InfoFileStream;
  1024. delete this->FlagFileStream;
  1025. }
  1026. void cmMakefileTargetGenerator::RemoveForbiddenFlags(const char* flagVar,
  1027. const char* linkLang,
  1028. std::string& linkFlags)
  1029. {
  1030. // check for language flags that are not allowed at link time, and
  1031. // remove them, -w on darwin for gcc -w -dynamiclib sends -w to libtool
  1032. // which fails, there may be more]
  1033. std::string removeFlags = "CMAKE_";
  1034. removeFlags += linkLang;
  1035. removeFlags += flagVar;
  1036. std::string removeflags =
  1037. this->Makefile->GetSafeDefinition(removeFlags.c_str());
  1038. std::vector<std::string> removeList;
  1039. cmSystemTools::ExpandListArgument(removeflags, removeList);
  1040. for(std::vector<std::string>::iterator i = removeList.begin();
  1041. i != removeList.end(); ++i)
  1042. {
  1043. cmSystemTools::ReplaceString(linkFlags, i->c_str(), "");
  1044. }
  1045. }
  1046. void cmMakefileTargetGenerator::WriteProgressVariables(unsigned long total,
  1047. unsigned long &current)
  1048. {
  1049. cmGeneratedFileStream *progressFileStream =
  1050. new cmGeneratedFileStream(this->ProgressFileNameFull.c_str());
  1051. if(!progressFileStream)
  1052. {
  1053. return;
  1054. }
  1055. unsigned long num;
  1056. unsigned long i;
  1057. for (i = 1; i <= this->NumberOfProgressActions; ++i)
  1058. {
  1059. *progressFileStream
  1060. << "CMAKE_PROGRESS_" << i << " = ";
  1061. if (total <= 100)
  1062. {
  1063. num = i + current;
  1064. *progressFileStream << num;
  1065. this->LocalGenerator->ProgressFiles[this->Target->GetName()]
  1066. .push_back(num);
  1067. }
  1068. else if (((i+current)*100)/total > ((i-1+current)*100)/total)
  1069. {
  1070. num = ((i+current)*100)/total;
  1071. *progressFileStream << num;
  1072. this->LocalGenerator->ProgressFiles[this->Target->GetName()]
  1073. .push_back(num);
  1074. }
  1075. *progressFileStream << "\n";
  1076. }
  1077. current += this->NumberOfProgressActions;
  1078. delete progressFileStream;
  1079. }