cmMSDotNETGenerator.cxx 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 "cmMSDotNETGenerator.h"
  14. #include "cmStandardIncludes.h"
  15. #include "cmMakefile.h"
  16. #include "cmCacheManager.h"
  17. #include "windows.h"
  18. #include "cmSystemTools.h"
  19. #include "cmRegularExpression.h"
  20. #include "cmSourceGroup.h"
  21. cmMSDotNETGenerator::cmMSDotNETGenerator()
  22. {
  23. m_Configurations.push_back("Debug");
  24. m_Configurations.push_back("Release");
  25. // m_Configurations.push_back("MinSizeRel");
  26. // m_Configurations.push_back("RelWithDebInfo");
  27. // default to building a sln project file
  28. BuildProjOn();
  29. }
  30. void cmMSDotNETGenerator::GenerateMakefile()
  31. {
  32. if(m_BuildSLN)
  33. {
  34. this->OutputSLNFile();
  35. }
  36. else
  37. {
  38. this->OutputVCProjFile();
  39. }
  40. }
  41. cmMSDotNETGenerator::~cmMSDotNETGenerator()
  42. {
  43. }
  44. void cmMSDotNETGenerator::SetLocal(bool local)
  45. {
  46. m_BuildSLN = !local;
  47. }
  48. void cmMSDotNETGenerator::ComputeSystemInfo()
  49. {
  50. // now load the settings
  51. if(!m_Makefile->GetDefinition("CMAKE_ROOT"))
  52. {
  53. cmSystemTools::Error(
  54. "CMAKE_ROOT has not been defined, bad GUI or driver program");
  55. return;
  56. }
  57. std::string fpath =
  58. m_Makefile->GetDefinition("CMAKE_ROOT");
  59. fpath += "/Templates/CMakeDotNetSystemConfig.cmake";
  60. m_Makefile->ReadListFile(NULL,fpath.c_str());
  61. }
  62. // output the SLN file
  63. void cmMSDotNETGenerator::OutputSLNFile()
  64. {
  65. // if this is an out of source build, create the output directory
  66. if(strcmp(m_Makefile->GetStartOutputDirectory(),
  67. m_Makefile->GetHomeDirectory()) != 0)
  68. {
  69. if(!cmSystemTools::MakeDirectory(m_Makefile->GetStartOutputDirectory()))
  70. {
  71. cmSystemTools::Error("Error creating output directory for SLN file",
  72. m_Makefile->GetStartOutputDirectory());
  73. }
  74. }
  75. // create the dsw file name
  76. std::string fname;
  77. fname = m_Makefile->GetStartOutputDirectory();
  78. fname += "/";
  79. if(strlen(m_Makefile->GetProjectName()) == 0)
  80. {
  81. m_Makefile->SetProjectName("Project");
  82. }
  83. fname += m_Makefile->GetProjectName();
  84. fname += ".sln";
  85. std::ofstream fout(fname.c_str());
  86. if(!fout)
  87. {
  88. cmSystemTools::Error("Error can not open SLN file for write: "
  89. ,fname.c_str());
  90. return;
  91. }
  92. this->WriteSLNFile(fout);
  93. }
  94. // Write a SLN file to the stream
  95. void cmMSDotNETGenerator::WriteSLNFile(std::ostream& fout)
  96. {
  97. // Write out the header for a SLN file
  98. this->WriteSLNHeader(fout);
  99. // Create a list of cmMakefile created from all the
  100. // CMakeLists.txt files that are in sub directories of
  101. // this one.
  102. std::vector<cmMakefile*> allListFiles;
  103. // add this makefile to the list
  104. allListFiles.push_back(m_Makefile);
  105. // add a special target that depends on ALL projects for easy build
  106. // of Debug only
  107. m_Makefile->AddUtilityCommand("ALL_BUILD", "echo", "\"Build all projects\"",
  108. false);
  109. m_Makefile->FindSubDirectoryCMakeListsFiles(allListFiles);
  110. // For each cmMakefile, create a VCProj for it, and
  111. // add it to this SLN file
  112. std::vector<cmMakefile*>::iterator k;
  113. for(k = allListFiles.begin();
  114. k != allListFiles.end(); ++k)
  115. {
  116. cmMakefile* mf = *k;
  117. cmMSDotNETGenerator* pg = 0;
  118. // if not this makefile, then create a new generator
  119. if(m_Makefile != mf)
  120. {
  121. // Create an MS generator with SLN off, so it only creates dsp files
  122. pg = new cmMSDotNETGenerator;
  123. }
  124. else
  125. {
  126. pg = static_cast<cmMSDotNETGenerator*>(m_Makefile->GetMakefileGenerator());
  127. }
  128. // make sure the generator is building dsp files
  129. pg->BuildSLNOff();
  130. mf->SetMakefileGenerator(pg);
  131. mf->GenerateMakefile();
  132. // Get the source directory from the makefile
  133. std::string dir = mf->GetStartDirectory();
  134. // Get the home directory with the trailing slash
  135. std::string homedir = m_Makefile->GetHomeDirectory();
  136. homedir += "/";
  137. // remove the home directory and / from the source directory
  138. // this gives a relative path
  139. cmSystemTools::ReplaceString(dir, homedir.c_str(), "");
  140. // Get the list of create dsp files names from the cmVCProjWriter, more
  141. // than one dsp could have been created per input CMakeLists.txt file
  142. // for each target
  143. std::vector<std::string> dspnames =
  144. pg->GetCreatedProjectNames();
  145. cmTargets &tgts = pg->GetMakefile()->GetTargets();
  146. cmTargets::iterator l = tgts.begin();
  147. for(std::vector<std::string>::iterator si = dspnames.begin();
  148. l != tgts.end(); ++l)
  149. {
  150. // special handling for the current makefile
  151. if(mf == m_Makefile)
  152. {
  153. dir = "."; // no subdirectory for project generated
  154. // if this is the special ALL_BUILD utility, then
  155. // make it depend on every other non UTILITY project.
  156. // This is done by adding the names to the GetUtilities
  157. // vector on the makefile
  158. if(l->first == "ALL_BUILD")
  159. {
  160. for(std::vector<cmMakefile*>::iterator a = allListFiles.begin();
  161. a != allListFiles.end(); ++a)
  162. {
  163. const cmTargets &atgts = (*a)->GetTargets();
  164. for(cmTargets::const_iterator al = atgts.begin();
  165. al != atgts.end(); ++al)
  166. {
  167. if (al->second.IsInAll())
  168. {
  169. if (al->second.GetType() == cmTarget::UTILITY)
  170. {
  171. l->second.AddUtility(al->first.c_str());
  172. }
  173. else
  174. {
  175. l->second.GetLinkLibraries().push_back(
  176. cmTarget::LinkLibraries::value_type(al->first,
  177. cmTarget::GENERAL));
  178. }
  179. }
  180. }
  181. }
  182. }
  183. }
  184. // Write the project into the SLN file
  185. if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) == 0)
  186. {
  187. cmCustomCommand cc = l->second.GetCustomCommands()[0];
  188. // dodgy use of the cmCustomCommand's members to store the
  189. // arguments from the INCLUDE_EXTERNAL_MSPROJECT command
  190. std::vector<std::string> stuff = cc.GetDepends();
  191. std::vector<std::string> depends = cc.GetOutputs();
  192. this->WriteExternalProject(fout, stuff[0].c_str(), stuff[1].c_str(), depends);
  193. ++si;
  194. }
  195. else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
  196. && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
  197. {
  198. this->WriteProject(fout, si->c_str(), dir.c_str(),
  199. pg,l->second);
  200. ++si;
  201. }
  202. }
  203. }
  204. fout << "Global\n"
  205. << "\tGlobalSection(SolutionConfiguration) = preSolution\n";
  206. int c = 0;
  207. for(std::vector<std::string>::iterator i = m_Configurations.begin();
  208. i != m_Configurations.end(); ++i)
  209. {
  210. fout << "\t\tConfigName." << c << " = " << *i << "\n";
  211. c++;
  212. }
  213. fout << "\tEndGlobalSection\n"
  214. << "\tGlobalSection(ProjectDependencies) = postSolution\n";
  215. // loop over again and compute the depends
  216. for(k = allListFiles.begin(); k != allListFiles.end(); ++k)
  217. {
  218. cmMakefile* mf = *k;
  219. cmMSDotNETGenerator* pg =
  220. static_cast<cmMSDotNETGenerator*>(mf->GetMakefileGenerator());
  221. // Get the list of create dsp files names from the cmVCProjWriter, more
  222. // than one dsp could have been created per input CMakeLists.txt file
  223. // for each target
  224. std::vector<std::string> dspnames =
  225. pg->GetCreatedProjectNames();
  226. cmTargets &tgts = pg->GetMakefile()->GetTargets();
  227. cmTargets::iterator l = tgts.begin();
  228. std::string dir = mf->GetStartDirectory();
  229. for(std::vector<std::string>::iterator si = dspnames.begin();
  230. l != tgts.end(); ++l)
  231. {
  232. if ((l->second.GetType() != cmTarget::INSTALL_FILES)
  233. && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
  234. {
  235. this->WriteProjectDepends(fout, si->c_str(), dir.c_str(),
  236. pg,l->second);
  237. ++si;
  238. }
  239. }
  240. }
  241. fout << "\tEndGlobalSection\n";
  242. fout << "\tGlobalSection(ProjectConfiguration) = postSolution\n";
  243. // loop over again and compute the depends
  244. for(k = allListFiles.begin(); k != allListFiles.end(); ++k)
  245. {
  246. cmMakefile* mf = *k;
  247. cmMSDotNETGenerator* pg =
  248. static_cast<cmMSDotNETGenerator*>(mf->GetMakefileGenerator());
  249. // Get the list of create dsp files names from the cmVCProjWriter, more
  250. // than one dsp could have been created per input CMakeLists.txt file
  251. // for each target
  252. std::vector<std::string> dspnames =
  253. pg->GetCreatedProjectNames();
  254. cmTargets &tgts = pg->GetMakefile()->GetTargets();
  255. cmTargets::iterator l = tgts.begin();
  256. std::string dir = mf->GetStartDirectory();
  257. for(std::vector<std::string>::iterator si = dspnames.begin();
  258. l != tgts.end(); ++l)
  259. {
  260. if ((l->second.GetType() != cmTarget::INSTALL_FILES)
  261. && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
  262. {
  263. this->WriteProjectConfigurations(fout, si->c_str());
  264. ++si;
  265. }
  266. }
  267. // delete the cmMakefile which also deletes the cmMSProjectGenerator
  268. if(mf != m_Makefile)
  269. {
  270. delete mf;
  271. }
  272. }
  273. fout << "\tEndGlobalSection\n";
  274. // Write the footer for the SLN file
  275. this->WriteSLNFooter(fout);
  276. }
  277. // Write a dsp file into the SLN file,
  278. // Note, that dependencies from executables to
  279. // the libraries it uses are also done here
  280. void cmMSDotNETGenerator::WriteProject(std::ostream& fout,
  281. const char* dspname,
  282. const char* dir,
  283. cmMSDotNETGenerator*,
  284. const cmTarget& target
  285. )
  286. {
  287. std::string d = cmSystemTools::ConvertToOutputPath(dir);
  288. fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\" = \""
  289. << dspname << "\", \""
  290. << d << "\\" << dspname << ".vcproj\", \"{"
  291. << this->CreateGUID(dspname) << "}\"\nEndProject\n";
  292. }
  293. // Write a dsp file into the SLN file,
  294. // Note, that dependencies from executables to
  295. // the libraries it uses are also done here
  296. void cmMSDotNETGenerator::WriteProjectDepends(std::ostream& fout,
  297. const char* dspname,
  298. const char* dir,
  299. cmMSDotNETGenerator*,
  300. const cmTarget& target
  301. )
  302. {
  303. int depcount = 0;
  304. // insert Begin Project Dependency Project_Dep_Name project stuff here
  305. if (target.GetType() != cmTarget::STATIC_LIBRARY)
  306. {
  307. cmTarget::LinkLibraries::const_iterator j, jend;
  308. j = target.GetLinkLibraries().begin();
  309. jend = target.GetLinkLibraries().end();
  310. for(;j!= jend; ++j)
  311. {
  312. if(j->first != dspname)
  313. {
  314. // is the library part of this SLN ? If so add dependency
  315. const char* cacheValue
  316. = m_Makefile->GetDefinition(j->first.c_str());
  317. if(cacheValue)
  318. {
  319. fout << "\t\t{" << this->CreateGUID(dspname) << "}." << depcount << " = {"
  320. << this->CreateGUID(j->first.c_str()) << "}\n";
  321. depcount++;
  322. }
  323. }
  324. }
  325. }
  326. std::set<std::string>::const_iterator i, end;
  327. // write utility dependencies.
  328. i = target.GetUtilities().begin();
  329. end = target.GetUtilities().end();
  330. for(;i!= end; ++i)
  331. {
  332. if(*i != dspname)
  333. {
  334. fout << "\t\t{" << this->CreateGUID(dspname) << "}." << depcount << " = {"
  335. << this->CreateGUID(i->c_str()) << "}\n";
  336. depcount++;
  337. }
  338. }
  339. }
  340. // Write a dsp file into the SLN file,
  341. // Note, that dependencies from executables to
  342. // the libraries it uses are also done here
  343. void cmMSDotNETGenerator::WriteProjectConfigurations(std::ostream& fout, const char* name)
  344. {
  345. std::string guid = this->CreateGUID(name);
  346. for(std::vector<std::string>::iterator i = m_Configurations.begin();
  347. i != m_Configurations.end(); ++i)
  348. {
  349. fout << "\t\t{" << guid << "}." << *i << ".ActiveCfg = " << *i << "|Win32\n"
  350. << "\t\t{" << guid << "}." << *i << ".Build.0 = " << *i << "|Win32\n";
  351. }
  352. }
  353. // Write a dsp file into the SLN file,
  354. // Note, that dependencies from executables to
  355. // the libraries it uses are also done here
  356. void cmMSDotNETGenerator::WriteExternalProject(std::ostream& fout,
  357. const char* name,
  358. const char* location,
  359. const std::vector<std::string>& dependencies)
  360. {
  361. cmSystemTools::Error("WriteExternalProject not implemented");
  362. // fout << "#########################################################"
  363. // "######################\n\n";
  364. // fout << "Project: \"" << name << "\"="
  365. // << location << " - Package Owner=<4>\n\n";
  366. // fout << "Package=<5>\n{{{\n}}}\n\n";
  367. // fout << "Package=<4>\n";
  368. // fout << "{{{\n";
  369. // std::vector<std::string>::const_iterator i, end;
  370. // // write dependencies.
  371. // i = dependencies.begin();
  372. // end = dependencies.end();
  373. // for(;i!= end; ++i)
  374. // {
  375. // fout << "Begin Project Dependency\n";
  376. // fout << "Project_Dep_Name " << *i << "\n";
  377. // fout << "End Project Dependency\n";
  378. // }
  379. // fout << "}}}\n\n";
  380. }
  381. // Standard end of dsw file
  382. void cmMSDotNETGenerator::WriteSLNFooter(std::ostream& fout)
  383. {
  384. fout << "\tGlobalSection(ExtensibilityGlobals) = postSolution\n"
  385. << "\tEndGlobalSection\n"
  386. << "\tGlobalSection(ExtensibilityAddIns) = postSolution\n"
  387. << "\tEndGlobalSection\n"
  388. << "EndGlobal\n";
  389. }
  390. // ouput standard header for dsw file
  391. void cmMSDotNETGenerator::WriteSLNHeader(std::ostream& fout)
  392. {
  393. fout << "Microsoft Visual Studio Solution File, Format Version 7.00\n";
  394. }
  395. std::string cmMSDotNETGenerator::CreateGUID(const char* name)
  396. {
  397. std::map<cmStdString, cmStdString>::iterator i = m_GUIDMap.find(name);
  398. if(i != m_GUIDMap.end())
  399. {
  400. return i->second;
  401. }
  402. std::string ret;
  403. UUID uid;
  404. unsigned char *uidstr;
  405. UuidCreate(&uid);
  406. UuidToString(&uid,&uidstr);
  407. ret = reinterpret_cast<char*>(uidstr);
  408. RpcStringFree(&uidstr);
  409. ret = cmSystemTools::UpperCase(ret);
  410. m_GUIDMap[name] = ret;
  411. return ret;
  412. }
  413. // TODO
  414. // for CommandLine= need to repleace quotes with &quot
  415. // write out configurations
  416. void cmMSDotNETGenerator::OutputVCProjFile()
  417. {
  418. // If not an in source build, then create the output directory
  419. if(strcmp(m_Makefile->GetStartOutputDirectory(),
  420. m_Makefile->GetHomeDirectory()) != 0)
  421. {
  422. if(!cmSystemTools::MakeDirectory(m_Makefile->GetStartOutputDirectory()))
  423. {
  424. cmSystemTools::Error("Error creating directory ",
  425. m_Makefile->GetStartOutputDirectory());
  426. }
  427. }
  428. m_LibraryOutputPath = "";
  429. if (m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH"))
  430. {
  431. m_LibraryOutputPath = m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH");
  432. }
  433. if(m_LibraryOutputPath.size())
  434. {
  435. // make sure there is a trailing slash
  436. if(m_LibraryOutputPath[m_LibraryOutputPath.size()-1] != '/')
  437. {
  438. m_LibraryOutputPath += "/";
  439. }
  440. m_LibraryOutputPath =
  441. cmSystemTools::ConvertToOutputPath(m_LibraryOutputPath.c_str());
  442. }
  443. m_ExecutableOutputPath = "";
  444. if (m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"))
  445. {
  446. m_ExecutableOutputPath = m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH");
  447. }
  448. if(m_ExecutableOutputPath.size())
  449. {
  450. // make sure there is a trailing slash
  451. if(m_ExecutableOutputPath[m_ExecutableOutputPath.size()-1] != '/')
  452. {
  453. m_ExecutableOutputPath += "/";
  454. }
  455. }
  456. m_ExecutableOutputPath =
  457. cmSystemTools::ConvertToOutputPath(m_ExecutableOutputPath.c_str());
  458. std::vector<std::string>& includes = m_Makefile->GetIncludeDirectories();
  459. std::vector<std::string>::iterator i;
  460. for(i = includes.begin(); i != includes.end(); ++i)
  461. {
  462. std::string tmp = cmSystemTools::ConvertToOutputPath(i->c_str());
  463. m_IncludeOptions += ",";
  464. // quote if not already quoted
  465. if (tmp[0] != '"')
  466. {
  467. m_IncludeOptions += tmp;
  468. }
  469. else
  470. {
  471. m_IncludeOptions += tmp;
  472. }
  473. }
  474. // Create the VCProj or set of VCProj's for libraries and executables
  475. // clear project names
  476. m_CreatedProjectNames.clear();
  477. // build any targets
  478. cmTargets &tgts = m_Makefile->GetTargets();
  479. for(cmTargets::iterator l = tgts.begin();
  480. l != tgts.end(); l++)
  481. {
  482. // INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
  483. // so don't build a projectfile for it
  484. if ((l->second.GetType() != cmTarget::INSTALL_FILES)
  485. && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
  486. && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0))
  487. {
  488. this->CreateSingleVCProj(l->first.c_str(),l->second);
  489. }
  490. }
  491. }
  492. void cmMSDotNETGenerator::CreateSingleVCProj(const char *lname, cmTarget &target)
  493. {
  494. // add to the list of projects
  495. std::string pname = lname;
  496. m_CreatedProjectNames.push_back(pname);
  497. // create the dsp.cmake file
  498. std::string fname;
  499. fname = m_Makefile->GetStartOutputDirectory();
  500. fname += "/";
  501. fname += lname;
  502. fname += ".vcproj";
  503. // save the name of the real dsp file
  504. std::string realVCProj = fname;
  505. fname += ".cmake";
  506. std::ofstream fout(fname.c_str());
  507. if(!fout)
  508. {
  509. cmSystemTools::Error("Error Writing ", fname.c_str());
  510. }
  511. this->WriteVCProjFile(fout,lname,target);
  512. fout.close();
  513. // if the dsp file has changed, then write it.
  514. cmSystemTools::CopyFileIfDifferent(fname.c_str(), realVCProj.c_str());
  515. }
  516. void cmMSDotNETGenerator::AddVCProjBuildRule(cmSourceGroup& sourceGroup)
  517. {
  518. std::string dspname = *(m_CreatedProjectNames.end()-1);
  519. if(dspname == "ALL_BUILD")
  520. {
  521. return;
  522. }
  523. dspname += ".vcproj.cmake";
  524. std::string makefileIn = m_Makefile->GetStartDirectory();
  525. makefileIn += "/";
  526. makefileIn += "CMakeLists.txt";
  527. makefileIn = cmSystemTools::ConvertToOutputPath(makefileIn.c_str());
  528. std::string dsprule = "${CMAKE_COMMAND}";
  529. m_Makefile->ExpandVariablesInString(dsprule);
  530. dsprule = cmSystemTools::ConvertToOutputPath(dsprule.c_str());
  531. std::string args = makefileIn;
  532. args += " -H\"";
  533. args +=
  534. cmSystemTools::ConvertToOutputPath(m_Makefile->GetHomeDirectory());
  535. args += "\" -S\"";
  536. args +=
  537. cmSystemTools::ConvertToOutputPath(m_Makefile->GetStartDirectory());
  538. args += "\" -O\"";
  539. args +=
  540. cmSystemTools::ConvertToOutputPath(m_Makefile->GetStartOutputDirectory());
  541. args += "\" -B\"";
  542. args +=
  543. cmSystemTools::ConvertToOutputPath(m_Makefile->GetHomeOutputDirectory());
  544. args += "\"";
  545. m_Makefile->ExpandVariablesInString(args);
  546. std::string configFile =
  547. m_Makefile->GetDefinition("CMAKE_ROOT");
  548. configFile += "/Templates/CMakeWindowsSystemConfig.cmake";
  549. std::vector<std::string> listFiles = m_Makefile->GetListFiles();
  550. bool found = false;
  551. for(std::vector<std::string>::iterator i = listFiles.begin();
  552. i != listFiles.end(); ++i)
  553. {
  554. if(*i == configFile)
  555. {
  556. found = true;
  557. }
  558. }
  559. if(!found)
  560. {
  561. listFiles.push_back(configFile);
  562. }
  563. std::vector<std::string> outputs;
  564. outputs.push_back(dspname);
  565. cmCustomCommand cc(makefileIn.c_str(), dsprule.c_str(),
  566. args.c_str(),
  567. listFiles,
  568. outputs);
  569. sourceGroup.AddCustomCommand(cc);
  570. }
  571. void cmMSDotNETGenerator::WriteConfigurations(std::ostream& fout,
  572. const char *libName,
  573. const cmTarget &target)
  574. {
  575. fout << "\t<Configurations>\n";
  576. for( std::vector<std::string>::iterator i = m_Configurations.begin();
  577. i != m_Configurations.end(); ++i)
  578. {
  579. this->WriteConfiguration(fout, i->c_str(), libName, target);
  580. }
  581. fout << "\t</Configurations>\n";
  582. }
  583. void cmMSDotNETGenerator::WriteConfiguration(std::ostream& fout,
  584. const char* configName,
  585. const char *libName,
  586. const cmTarget &target)
  587. {
  588. const char* mfcFlag = m_Makefile->GetDefinition("CMAKE_MFC_FLAG");
  589. if(!mfcFlag)
  590. {
  591. mfcFlag = "0";
  592. }
  593. fout << "\t\t<Configuration\n"
  594. << "\t\t\tName=\"" << configName << "|Win32\"\n"
  595. << "\t\t\tOutputDirectory=\"";
  596. // This is an internal type to Visual Studio, it seems that:
  597. // 4 == static library
  598. // 2 == dll
  599. // 1 == executable
  600. // 10 == utility
  601. const char* configType = "10";
  602. switch(target.GetType())
  603. {
  604. case cmTarget::STATIC_LIBRARY:
  605. configType = "4";
  606. fout << m_LibraryOutputPath << configName << "\"\n";
  607. break;
  608. case cmTarget::SHARED_LIBRARY:
  609. case cmTarget::MODULE_LIBRARY:
  610. fout << m_LibraryOutputPath << configName << "\"\n";
  611. configType = "2";
  612. break;
  613. case cmTarget::EXECUTABLE:
  614. case cmTarget::WIN32_EXECUTABLE:
  615. fout << m_ExecutableOutputPath << configName << "\"\n";
  616. configType = "1";
  617. break;
  618. case cmTarget::UTILITY:
  619. configType = "10";
  620. default:
  621. fout << configName << "\"\n";
  622. break;
  623. }
  624. fout << "\t\t\tIntermediateDirectory=\".\\" << configName << "\"\n"
  625. << "\t\t\tConfigurationType=\"" << configType << "\"\n"
  626. << "\t\t\tUseOfMFC=\"" << mfcFlag << "\"\n"
  627. << "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\"\n"
  628. << "\t\t\tCharacterSet=\"2\">\n";
  629. fout << "\t\t\t<Tool\n"
  630. << "\t\t\t\tName=\"VCCLCompilerTool\"\n"
  631. << "\t\t\t\tAdditionalOptions=\"" <<
  632. m_Makefile->GetDefinition("CMAKE_CXX_FLAGS") << "\"\n";
  633. fout << "\t\t\t\tAdditionalIncludeDirectories=\"";
  634. std::vector<std::string>& includes = m_Makefile->GetIncludeDirectories();
  635. std::vector<std::string>::iterator i = includes.begin();
  636. if(i != includes.end())
  637. {
  638. fout << "&quot;" << *i << "&quot;";
  639. }
  640. for(;i != includes.end(); ++i)
  641. {
  642. fout << ";&quot;" << *i << "&quot;";
  643. }
  644. fout << "\"\n";
  645. if(strcmp(configName, "Debug") == 0)
  646. {
  647. fout << "\t\t\t\tOptimization=\"0\"\n"
  648. << "\t\t\t\tRuntimeLibrary=\"3\"\n"
  649. << "\t\t\t\tPreprocessorDefinitions=\"WIN32,_DEBUG,_WINDOWS";
  650. }
  651. else if(strcmp(configName, "Release") == 0)
  652. {
  653. fout << "\t\t\t\tOptimization=\"2\"\n"
  654. << "\t\t\t\tRuntimeLibrary=\"0\"\n"
  655. << "\t\t\t\tInlineFunctionExpansion=\"1\"\n"
  656. << "\t\t\t\tPreprocessorDefinitions=\"WIN32,NDEBUG,_WINDOWS";
  657. }
  658. else if(strcmp(configName, "MinSizeRel") == 0)
  659. {
  660. fout << "\t\t\t\tOptimization=\"1\"\n"
  661. << "\t\t\t\tRuntimeLibrary=\"0\"\n"
  662. << "\t\t\t\tInlineFunctionExpansion=\"1\"\n"
  663. << "\t\t\t\tPreprocessorDefinitions=\"WIN32,NDEBUG,_WINDOWS";
  664. }
  665. else if(strcmp(configName, "RelWithDebInfo") == 0)
  666. {
  667. fout << "\t\t\t\tOptimization=\"2\"\n"
  668. << "\t\t\t\tInlineFunctionExpansion=\"1\"\n"
  669. << "\t\t\t\tPreprocessorDefinitions=\"WIN32,NDEBUG,_WINDOWS";
  670. }
  671. this->OutputDefineFlags(fout);
  672. fout << "\"\n";
  673. fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n";
  674. fout << "\t\t\t\tObjectFile=\"" << configName << "\\\"\n";
  675. fout << "\t\t\t\tProgramDataBaseFileName=\"" << configName << "\"\n";
  676. fout << "\t\t\t\tWarningLevel=\"3\"\n";
  677. fout << "\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n"
  678. << "\t\t\t\tDebugInformationFormat=\"3\"";
  679. fout << "/>\n"; // end of <Tool Name=VCCLCompilerTool
  680. fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n";
  681. fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n";
  682. fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"";
  683. this->OutputTargetRules(fout, target, libName);
  684. fout << "/>\n";
  685. fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n";
  686. this->OutputBuildTool(fout, configName, libName, target);
  687. fout << "\t\t</Configuration>\n";
  688. }
  689. void cmMSDotNETGenerator::OutputBuildTool(std::ostream& fout,
  690. const char* configName,
  691. const char *libName,
  692. const cmTarget &target)
  693. {
  694. switch(target.GetType())
  695. {
  696. case cmTarget::STATIC_LIBRARY:
  697. fout << "\t\t\t<Tool\n"
  698. << "\t\t\t\tName=\"VCLibrarianTool\"\n"
  699. << "\t\t\t\t\tOutputFile=\"" << m_LibraryOutputPath << configName
  700. << "/" << libName << ".lib\"/>\n";
  701. break;
  702. case cmTarget::SHARED_LIBRARY:
  703. case cmTarget::MODULE_LIBRARY:
  704. break;
  705. case cmTarget::EXECUTABLE:
  706. fout << "\t\t\t<Tool\n"
  707. << "\t\t\t\tName=\"VCLinkerTool\"\n"
  708. << "\t\t\t\tAdditionalOptions=\"/MACHINE:I386\"\n"
  709. << "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";
  710. this->OutputLibraries(fout, configName, libName, target);
  711. fout << "\"\n";
  712. fout << "\t\t\t\tOutputFile=\"" << m_ExecutableOutputPath <<
  713. configName << "/" << libName << ".exe\"\n";
  714. fout << "\t\t\t\tLinkIncremental=\"1\"\n";
  715. fout << "\t\t\t\tSuppressStartupBanner=\"TRUE\"\n";
  716. fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
  717. this->OutputLibraryDirectories(fout, configName, libName, target);
  718. fout << "\"\n";
  719. fout << "\t\t\t\tProgramDatabaseFile=\"" << m_LibraryOutputPath << libName << ".pdb\"\n";
  720. fout << "\t\t\t\tSubSystem=\"1\"\n";
  721. fout << "\t\t\t\tStackReserveSize=\"10000000\"/>\n";
  722. break;
  723. case cmTarget::WIN32_EXECUTABLE:
  724. fout << "\t\t\t<Tool\n"
  725. << "\t\t\t\tName=\"VCLinkerTool\"\n"
  726. << "\t\t\t\tAdditionalOptions=\"/MACHINE:I386\"\n"
  727. << "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";
  728. this->OutputLibraries(fout, configName, libName, target);
  729. fout << "\"\n";
  730. fout << "\t\t\t\tOutputFile=\"" << m_ExecutableOutputPath <<
  731. configName << "/" << libName << ".exe\"\n";
  732. fout << "\t\t\t\tLinkIncremental=\"1\"\n";
  733. fout << "\t\t\t\tSuppressStartupBanner=\"TRUE\"\n";
  734. fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
  735. this->OutputLibraryDirectories(fout, configName, libName, target);
  736. fout << "\"\n";
  737. fout << "\t\t\t\tProgramDatabaseFile=\"" << m_LibraryOutputPath << libName << ".pdb\"\n";
  738. fout << "\t\t\t\tSubSystem=\"2\"\n";
  739. fout << "\t\t\t\tStackReserveSize=\"10000000\"/>\n";
  740. break;
  741. case cmTarget::UTILITY:
  742. break;
  743. }
  744. }
  745. void cmMSDotNETGenerator::OutputLibraryDirectories(std::ostream& fout,
  746. const char* configName,
  747. const char* libName,
  748. const cmTarget &target)
  749. {
  750. bool hasone = false;
  751. if(m_LibraryOutputPath.size())
  752. {
  753. hasone = true;
  754. fout << m_LibraryOutputPath << "$(INTDIR)," << m_LibraryOutputPath;
  755. }
  756. if(m_ExecutableOutputPath.size())
  757. {
  758. hasone = true;
  759. fout << m_ExecutableOutputPath << "$(INTDIR)," << m_ExecutableOutputPath;
  760. }
  761. std::set<std::string> pathEmitted;
  762. std::vector<std::string>::iterator i;
  763. std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories();
  764. for(i = libdirs.begin(); i != libdirs.end(); ++i)
  765. {
  766. std::string lpath = cmSystemTools::ConvertToOutputPath(i->c_str());
  767. if(lpath[lpath.size()-1] != '/')
  768. {
  769. lpath += "/";
  770. }
  771. if(pathEmitted.insert(lpath).second)
  772. {
  773. if(hasone)
  774. {
  775. fout << ",";
  776. }
  777. fout << lpath << "\\$(INTDIR)," << lpath;
  778. hasone = true;
  779. }
  780. }
  781. }
  782. void cmMSDotNETGenerator::OutputLibraries(std::ostream& fout,
  783. const char* configName,
  784. const char* libName,
  785. const cmTarget &target)
  786. {
  787. const cmTarget::LinkLibraries& libs = target.GetLinkLibraries();
  788. cmTarget::LinkLibraries::const_iterator j;
  789. for(j = libs.begin(); j != libs.end(); ++j)
  790. {
  791. std::string lib = j->first;
  792. if(j->first.find(".lib") == std::string::npos)
  793. {
  794. lib += ".lib";
  795. }
  796. lib = cmSystemTools::ConvertToOutputPath(lib.c_str());
  797. if (j->second == cmTarget::GENERAL
  798. || (j->second == cmTarget::DEBUG && strcmp(configName, "DEBUG") == 0)
  799. || (j->second == cmTarget::OPTIMIZED && strcmp(configName, "DEBUG") != 0))
  800. {
  801. fout << lib << " ";
  802. }
  803. }
  804. }
  805. void cmMSDotNETGenerator::OutputDefineFlags(std::ostream& fout)
  806. {
  807. std::string defs = m_Makefile->GetDefineFlags();
  808. std::string::size_type pos = defs.find("-D");
  809. bool done = pos == std::string::npos;
  810. if(!done)
  811. {
  812. fout << ",";
  813. }
  814. while(!done)
  815. {
  816. std::string::size_type nextpos = defs.find("-D", pos+2);
  817. std::string define;
  818. if(nextpos != std::string::npos)
  819. {
  820. define = defs.substr(pos+2, nextpos - pos -3);
  821. }
  822. else
  823. {
  824. define = defs.substr(pos+2);
  825. done = true;
  826. }
  827. fout << define << ",";
  828. if(!done)
  829. {
  830. pos = defs.find("-D", nextpos);
  831. }
  832. }
  833. }
  834. void cmMSDotNETGenerator::WriteVCProjFile(std::ostream& fout,
  835. const char *libName,
  836. cmTarget &target)
  837. {
  838. // We may be modifying the source groups temporarily, so make a copy.
  839. std::vector<cmSourceGroup> sourceGroups = m_Makefile->GetSourceGroups();
  840. // get the classes from the source lists then add them to the groups
  841. std::vector<cmSourceFile> classes = target.GetSourceFiles();
  842. for(std::vector<cmSourceFile>::iterator i = classes.begin();
  843. i != classes.end(); i++)
  844. {
  845. // Add the file to the list of sources.
  846. std::string source = i->GetFullPath();
  847. cmSourceGroup& sourceGroup = m_Makefile->FindSourceGroup(source.c_str(),
  848. sourceGroups);
  849. sourceGroup.AddSource(source.c_str());
  850. }
  851. // add any custom rules to the source groups
  852. for (std::vector<cmCustomCommand>::const_iterator cr =
  853. target.GetCustomCommands().begin();
  854. cr != target.GetCustomCommands().end(); ++cr)
  855. {
  856. cmSourceGroup& sourceGroup =
  857. m_Makefile->FindSourceGroup(cr->GetSourceName().c_str(),
  858. sourceGroups);
  859. cmCustomCommand cc(*cr);
  860. cc.ExpandVariables(*m_Makefile);
  861. sourceGroup.AddCustomCommand(cc);
  862. }
  863. // open the project
  864. this->WriteProjectStart(fout, libName, target, sourceGroups);
  865. // write the configuration information
  866. this->WriteConfigurations(fout, libName, target);
  867. fout << "\t<Files>\n";
  868. // Find the group in which the CMakeLists.txt source belongs, and add
  869. // the rule to generate this VCProj file.
  870. for(std::vector<cmSourceGroup>::reverse_iterator sg = sourceGroups.rbegin();
  871. sg != sourceGroups.rend(); ++sg)
  872. {
  873. if(sg->Matches("CMakeLists.txt"))
  874. {
  875. this->AddVCProjBuildRule(*sg);
  876. break;
  877. }
  878. }
  879. // Loop through every source group.
  880. for(std::vector<cmSourceGroup>::const_iterator sg = sourceGroups.begin();
  881. sg != sourceGroups.end(); ++sg)
  882. {
  883. const cmSourceGroup::BuildRules& buildRules = sg->GetBuildRules();
  884. // If the group is empty, don't write it at all.
  885. if(buildRules.empty())
  886. { continue; }
  887. // If the group has a name, write the header.
  888. std::string name = sg->GetName();
  889. if(name != "")
  890. {
  891. this->WriteVCProjBeginGroup(fout, name.c_str(), "");
  892. }
  893. // Loop through each build rule in the source group.
  894. for(cmSourceGroup::BuildRules::const_iterator cc =
  895. buildRules.begin(); cc != buildRules.end(); ++ cc)
  896. {
  897. std::string source = cc->first;
  898. const cmSourceGroup::Commands& commands = cc->second;
  899. if (source != libName || target.GetType() == cmTarget::UTILITY)
  900. {
  901. fout << "\t\t\t<File\n";
  902. std::string d = cmSystemTools::ConvertToOutputPath(source.c_str());
  903. // Tell MS-Dev what the source is. If the compiler knows how to
  904. // build it, then it will.
  905. fout << "\t\t\t\tRelativePath=\"" << d << "\">\n";
  906. if (!commands.empty())
  907. {
  908. cmSourceGroup::CommandFiles totalCommand;
  909. std::string totalCommandStr;
  910. totalCommandStr = this->CombineCommands(commands, totalCommand,
  911. source.c_str());
  912. this->WriteCustomRule(fout, source.c_str(), totalCommandStr.c_str(),
  913. totalCommand.m_Depends,
  914. totalCommand.m_Outputs);
  915. }
  916. fout << "\t\t\t</File>\n";
  917. }
  918. }
  919. // If the group has a name, write the footer.
  920. if(name != "")
  921. {
  922. this->WriteVCProjEndGroup(fout);
  923. }
  924. }
  925. fout << "\t</Files>\n";
  926. // Write the VCProj file's footer.
  927. this->WriteVCProjFooter(fout);
  928. }
  929. void cmMSDotNETGenerator::WriteCustomRule(std::ostream& fout,
  930. const char* source,
  931. const char* command,
  932. const std::set<std::string>& depends,
  933. const std::set<std::string>& outputs)
  934. {
  935. std::string cmd = command;
  936. cmSystemTools::ReplaceString(cmd, "\"", "&quot;");
  937. std::vector<std::string>::iterator i;
  938. for(i = m_Configurations.begin(); i != m_Configurations.end(); ++i)
  939. {
  940. fout << "\t\t\t\t<FileConfiguration\n";
  941. fout << "\t\t\t\t\tName=\"" << *i << "|Win32\">\n";
  942. fout << "\t\t\t\t\t<Tool\n"
  943. << "\t\t\t\t\tName=\"VCCustomBuildTool\"\n"
  944. << "\t\t\t\t\tCommandLine=\"" << cmd << "\n\"\n"
  945. << "\t\t\t\t\tAdditionalDependencies=\"";
  946. // Write out the dependencies for the rule.
  947. std::string temp;
  948. for(std::set<std::string>::const_iterator d = depends.begin();
  949. d != depends.end(); ++d)
  950. {
  951. fout << cmSystemTools::ConvertToOutputPath(d->c_str())
  952. << ";";
  953. }
  954. fout << "\"\n";
  955. fout << "\t\t\t\t\tOutputs=\"";
  956. if(outputs.size() == 0)
  957. {
  958. fout << source << "_force";
  959. }
  960. bool first = true;
  961. // Write a rule for every output generated by this command.
  962. for(std::set<std::string>::const_iterator output = outputs.begin();
  963. output != outputs.end(); ++output)
  964. {
  965. if(!first)
  966. {
  967. fout << ";";
  968. }
  969. else
  970. {
  971. first = true;
  972. }
  973. fout << output->c_str();
  974. }
  975. fout << "\"/>\n";
  976. fout << "\t\t\t\t</FileConfiguration>\n";
  977. }
  978. }
  979. void cmMSDotNETGenerator::WriteVCProjBeginGroup(std::ostream& fout,
  980. const char* group,
  981. const char* filter)
  982. {
  983. fout << "\t\t<Filter\n"
  984. << "\t\t\tName=\"" << group << "\"\n"
  985. << "\t\t\tFilter=\"\">\n";
  986. }
  987. void cmMSDotNETGenerator::WriteVCProjEndGroup(std::ostream& fout)
  988. {
  989. fout << "\t\t</Filter>\n";
  990. }
  991. std::string
  992. cmMSDotNETGenerator::CombineCommands(const cmSourceGroup::Commands &commands,
  993. cmSourceGroup::CommandFiles &totalCommand,
  994. const char *source)
  995. {
  996. // Loop through every custom command generating code from the
  997. // current source.
  998. // build up the depends and outputs and commands
  999. std::string totalCommandStr = "";
  1000. std::string temp;
  1001. for(cmSourceGroup::Commands::const_iterator c = commands.begin();
  1002. c != commands.end(); ++c)
  1003. {
  1004. temp=
  1005. cmSystemTools::ConvertToOutputPath(c->second.m_Command.c_str());
  1006. totalCommandStr += temp;
  1007. totalCommandStr += " ";
  1008. totalCommandStr += c->second.m_Arguments;
  1009. totalCommand.Merge(c->second);
  1010. }
  1011. // Create a dummy file with the name of the source if it does
  1012. // not exist
  1013. if(totalCommand.m_Outputs.empty())
  1014. {
  1015. std::string dummyFile = m_Makefile->GetStartOutputDirectory();
  1016. dummyFile += "/";
  1017. dummyFile += source;
  1018. if(!cmSystemTools::FileExists(dummyFile.c_str()))
  1019. {
  1020. std::ofstream fout(dummyFile.c_str());
  1021. fout << "Dummy file created by cmake as unused source for utility command.\n";
  1022. }
  1023. }
  1024. return totalCommandStr;
  1025. }
  1026. // look for custom rules on a target and collect them together
  1027. void cmMSDotNETGenerator::OutputTargetRules(std::ostream& fout,
  1028. const cmTarget &target,
  1029. const char *libName)
  1030. {
  1031. if (target.GetType() >= cmTarget::UTILITY)
  1032. {
  1033. return;
  1034. }
  1035. // Find the group in which the lix exe custom rules belong
  1036. bool init = false;
  1037. for (std::vector<cmCustomCommand>::const_iterator cr =
  1038. target.GetCustomCommands().begin();
  1039. cr != target.GetCustomCommands().end(); ++cr)
  1040. {
  1041. cmCustomCommand cc(*cr);
  1042. cc.ExpandVariables(*m_Makefile);
  1043. if (cc.GetSourceName() == libName)
  1044. {
  1045. if(!init)
  1046. {
  1047. fout << "\nCommandLine=\"";
  1048. init = true;
  1049. }
  1050. fout << cc.GetCommand() << " " << cc.GetArguments() << "\n";
  1051. }
  1052. }
  1053. if (init)
  1054. {
  1055. fout << "\"";
  1056. }
  1057. }
  1058. void cmMSDotNETGenerator::WriteProjectStart(std::ostream& fout, const char *libName,
  1059. const cmTarget &target,
  1060. std::vector<cmSourceGroup> &)
  1061. {
  1062. fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
  1063. << "<VisualStudioProject\n"
  1064. << "\tProjectType=\"Visual C++\"\n"
  1065. << "\tVersion=\"7.00\"\n"
  1066. << "\tName=\"" << libName << "\"\n"
  1067. << "\tSccProjectName=\"\"\n"
  1068. << "\tSccLocalPath=\"\"\n"
  1069. << "\tKeyword=\"Win32Proj\">\n"
  1070. << "\t<Platforms>\n"
  1071. << "\t\t<Platform\n\t\t\tName=\"Win32\"/>\n"
  1072. << "\t</Platforms>\n";
  1073. }
  1074. void cmMSDotNETGenerator::WriteVCProjFooter(std::ostream& fout)
  1075. {
  1076. fout << "\t<Globals>\n"
  1077. << "\t</Globals>\n"
  1078. << "</VisualStudioProject>\n";
  1079. }