cmMSDotNETGenerator.cxx 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181
  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/CMakeWindowsSystemConfig.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\"/>\n";
  683. fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n";
  684. this->OutputBuildTool(fout, configName, libName, target);
  685. fout << "\t\t</Configuration>\n";
  686. }
  687. void cmMSDotNETGenerator::OutputBuildTool(std::ostream& fout,
  688. const char* configName,
  689. const char *libName,
  690. const cmTarget &target)
  691. {
  692. switch(target.GetType())
  693. {
  694. case cmTarget::STATIC_LIBRARY:
  695. fout << "\t\t\t<Tool\n"
  696. << "\t\t\t\tName=\"VCLibrarianTool\"\n"
  697. << "\t\t\t\t\tOutputFile=\"" << m_LibraryOutputPath << configName
  698. << "/" << libName << ".lib\"/>\n";
  699. break;
  700. case cmTarget::SHARED_LIBRARY:
  701. case cmTarget::MODULE_LIBRARY:
  702. break;
  703. case cmTarget::EXECUTABLE:
  704. fout << "\t\t\t<Tool\n"
  705. << "\t\t\t\tName=\"VCLinkerTool\"\n"
  706. << "\t\t\t\tAdditionalOptions=\"/MACHINE:I386\"\n"
  707. << "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";
  708. this->OutputLibraries(fout, configName, libName, target);
  709. fout << "\"\n";
  710. fout << "\t\t\t\tOutputFile=\"" << m_ExecutableOutputPath <<
  711. configName << "/" << libName << ".exe\"\n";
  712. fout << "\t\t\t\tLinkIncremental=\"1\"\n";
  713. fout << "\t\t\t\tSuppressStartupBanner=\"TRUE\"\n";
  714. fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
  715. this->OutputLibraryDirectories(fout, configName, libName, target);
  716. fout << "\"\n";
  717. fout << "\t\t\t\tProgramDatabaseFile=\"" << m_LibraryOutputPath << libName << ".pdb\"\n";
  718. fout << "\t\t\t\tSubSystem=\"1\"\n";
  719. fout << "\t\t\t\tStackReserveSize=\"10000000\"/>\n";
  720. break;
  721. case cmTarget::WIN32_EXECUTABLE:
  722. fout << "\t\t\t<Tool\n"
  723. << "\t\t\t\tName=\"VCLinkerTool\"\n"
  724. << "\t\t\t\tAdditionalOptions=\"/MACHINE:I386\"\n"
  725. << "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";
  726. this->OutputLibraries(fout, configName, libName, target);
  727. fout << "\"\n";
  728. fout << "\t\t\t\tOutputFile=\"" << m_ExecutableOutputPath <<
  729. configName << "/" << libName << ".exe\"\n";
  730. fout << "\t\t\t\tLinkIncremental=\"1\"\n";
  731. fout << "\t\t\t\tSuppressStartupBanner=\"TRUE\"\n";
  732. fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
  733. this->OutputLibraryDirectories(fout, configName, libName, target);
  734. fout << "\"\n";
  735. fout << "\t\t\t\tProgramDatabaseFile=\"" << m_LibraryOutputPath << libName << ".pdb\"\n";
  736. fout << "\t\t\t\tSubSystem=\"2\"\n";
  737. fout << "\t\t\t\tStackReserveSize=\"10000000\"/>\n";
  738. break;
  739. case cmTarget::UTILITY:
  740. break;
  741. }
  742. }
  743. void cmMSDotNETGenerator::OutputLibraryDirectories(std::ostream& fout,
  744. const char* configName,
  745. const char* libName,
  746. const cmTarget &target)
  747. {
  748. bool hasone = false;
  749. if(m_LibraryOutputPath.size())
  750. {
  751. hasone = true;
  752. fout << m_LibraryOutputPath << "$(INTDIR)," << m_LibraryOutputPath;
  753. }
  754. if(m_ExecutableOutputPath.size())
  755. {
  756. hasone = true;
  757. fout << m_ExecutableOutputPath << "$(INTDIR)," << m_ExecutableOutputPath;
  758. }
  759. std::set<std::string> pathEmitted;
  760. std::vector<std::string>::iterator i;
  761. std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories();
  762. for(i = libdirs.begin(); i != libdirs.end(); ++i)
  763. {
  764. std::string lpath = cmSystemTools::ConvertToOutputPath(i->c_str());
  765. if(lpath[lpath.size()-1] != '/')
  766. {
  767. lpath += "/";
  768. }
  769. if(pathEmitted.insert(lpath).second)
  770. {
  771. if(hasone)
  772. {
  773. fout << ",";
  774. }
  775. fout << lpath;
  776. hasone = true;
  777. }
  778. }
  779. }
  780. void cmMSDotNETGenerator::OutputLibraries(std::ostream& fout,
  781. const char* configName,
  782. const char* libName,
  783. const cmTarget &target)
  784. {
  785. const cmTarget::LinkLibraries& libs = target.GetLinkLibraries();
  786. cmTarget::LinkLibraries::const_iterator j;
  787. for(j = libs.begin(); j != libs.end(); ++j)
  788. {
  789. std::string lib = j->first;
  790. if(j->first.find(".lib") == std::string::npos)
  791. {
  792. lib += ".lib";
  793. }
  794. lib = cmSystemTools::ConvertToOutputPath(lib.c_str());
  795. if (j->second == cmTarget::GENERAL
  796. || (j->second == cmTarget::DEBUG && strcmp(configName, "DEBUG") == 0)
  797. || (j->second == cmTarget::OPTIMIZED && strcmp(configName, "DEBUG") != 0))
  798. {
  799. fout << lib << " ";
  800. }
  801. }
  802. }
  803. void cmMSDotNETGenerator::OutputDefineFlags(std::ostream& fout)
  804. {
  805. std::string defs = m_Makefile->GetDefineFlags();
  806. std::string::size_type pos = defs.find("-D");
  807. bool done = pos == std::string::npos;
  808. while(!done)
  809. {
  810. std::string::size_type nextpos = defs.find("-D", pos+2);
  811. std::string define;
  812. if(nextpos != std::string::npos)
  813. {
  814. define = defs.substr(pos+2, nextpos - pos -2);
  815. }
  816. else
  817. {
  818. define = defs.substr(pos+2);
  819. done = true;
  820. }
  821. fout << define << ",";
  822. if(!done)
  823. {
  824. pos = defs.find("-D", nextpos);
  825. }
  826. }
  827. }
  828. void cmMSDotNETGenerator::WriteVCProjFile(std::ostream& fout,
  829. const char *libName,
  830. cmTarget &target)
  831. {
  832. // We may be modifying the source groups temporarily, so make a copy.
  833. std::vector<cmSourceGroup> sourceGroups = m_Makefile->GetSourceGroups();
  834. // get the classes from the source lists then add them to the groups
  835. std::vector<cmSourceFile> classes = target.GetSourceFiles();
  836. for(std::vector<cmSourceFile>::iterator i = classes.begin();
  837. i != classes.end(); i++)
  838. {
  839. // Add the file to the list of sources.
  840. std::string source = i->GetFullPath();
  841. cmSourceGroup& sourceGroup = m_Makefile->FindSourceGroup(source.c_str(),
  842. sourceGroups);
  843. sourceGroup.AddSource(source.c_str());
  844. }
  845. // add any custom rules to the source groups
  846. for (std::vector<cmCustomCommand>::const_iterator cr =
  847. target.GetCustomCommands().begin();
  848. cr != target.GetCustomCommands().end(); ++cr)
  849. {
  850. cmSourceGroup& sourceGroup =
  851. m_Makefile->FindSourceGroup(cr->GetSourceName().c_str(),
  852. sourceGroups);
  853. cmCustomCommand cc(*cr);
  854. cc.ExpandVariables(*m_Makefile);
  855. sourceGroup.AddCustomCommand(cc);
  856. }
  857. // open the project
  858. this->WriteProjectStart(fout, libName, target, sourceGroups);
  859. // write the configuration information
  860. this->WriteConfigurations(fout, libName, target);
  861. fout << "\t<Files>\n";
  862. // Find the group in which the CMakeLists.txt source belongs, and add
  863. // the rule to generate this VCProj file.
  864. for(std::vector<cmSourceGroup>::reverse_iterator sg = sourceGroups.rbegin();
  865. sg != sourceGroups.rend(); ++sg)
  866. {
  867. if(sg->Matches("CMakeLists.txt"))
  868. {
  869. this->AddVCProjBuildRule(*sg);
  870. break;
  871. }
  872. }
  873. // Loop through every source group.
  874. for(std::vector<cmSourceGroup>::const_iterator sg = sourceGroups.begin();
  875. sg != sourceGroups.end(); ++sg)
  876. {
  877. const cmSourceGroup::BuildRules& buildRules = sg->GetBuildRules();
  878. // If the group is empty, don't write it at all.
  879. if(buildRules.empty())
  880. { continue; }
  881. // If the group has a name, write the header.
  882. std::string name = sg->GetName();
  883. if(name != "")
  884. {
  885. this->WriteVCProjBeginGroup(fout, name.c_str(), "");
  886. }
  887. // Loop through each build rule in the source group.
  888. for(cmSourceGroup::BuildRules::const_iterator cc =
  889. buildRules.begin(); cc != buildRules.end(); ++ cc)
  890. {
  891. std::string source = cc->first;
  892. const cmSourceGroup::Commands& commands = cc->second;
  893. if (source != libName || target.GetType() == cmTarget::UTILITY)
  894. {
  895. fout << "\t\t\t<File\n";
  896. std::string d = cmSystemTools::ConvertToOutputPath(source.c_str());
  897. // Tell MS-Dev what the source is. If the compiler knows how to
  898. // build it, then it will.
  899. fout << "\t\t\t\tRelativePath=\"" << d << "\">\n";
  900. if (!commands.empty())
  901. {
  902. cmSourceGroup::CommandFiles totalCommand;
  903. std::string totalCommandStr;
  904. totalCommandStr = this->CombineCommands(commands, totalCommand,
  905. source.c_str());
  906. this->WriteCustomRule(fout, source.c_str(), totalCommandStr.c_str(),
  907. totalCommand.m_Depends,
  908. totalCommand.m_Outputs);
  909. }
  910. fout << "\t\t\t</File>\n";
  911. }
  912. }
  913. // If the group has a name, write the footer.
  914. if(name != "")
  915. {
  916. this->WriteVCProjEndGroup(fout);
  917. }
  918. }
  919. fout << "\t</Files>\n";
  920. // Write the VCProj file's footer.
  921. this->WriteVCProjFooter(fout);
  922. }
  923. void cmMSDotNETGenerator::WriteCustomRule(std::ostream& fout,
  924. const char* source,
  925. const char* command,
  926. const std::set<std::string>& depends,
  927. const std::set<std::string>& outputs)
  928. {
  929. std::string cmd = command;
  930. cmSystemTools::ReplaceString(cmd, "\"", "&quot;");
  931. std::vector<std::string>::iterator i;
  932. for(i = m_Configurations.begin(); i != m_Configurations.end(); ++i)
  933. {
  934. fout << "\t\t\t\t<FileConfiguration\n";
  935. fout << "\t\t\t\t\tName=\"" << *i << "|Win32\">\n";
  936. fout << "\t\t\t\t\t<Tool\n"
  937. << "\t\t\t\t\tName=\"VCCustomBuildTool\"\n"
  938. << "\t\t\t\t\tCommandLine=\"" << cmd << "\n\"\n"
  939. << "\t\t\t\t\tAdditionalDependencies=\"";
  940. // Write out the dependencies for the rule.
  941. std::string temp;
  942. for(std::set<std::string>::const_iterator d = depends.begin();
  943. d != depends.end(); ++d)
  944. {
  945. fout << cmSystemTools::ConvertToOutputPath(d->c_str())
  946. << ";";
  947. }
  948. fout << "\"\n";
  949. fout << "\t\t\t\t\tOutputs=\"";
  950. if(outputs.size() == 0)
  951. {
  952. fout << source << "_force";
  953. }
  954. bool first = true;
  955. // Write a rule for every output generated by this command.
  956. for(std::set<std::string>::const_iterator output = outputs.begin();
  957. output != outputs.end(); ++output)
  958. {
  959. if(!first)
  960. {
  961. fout << ";";
  962. }
  963. else
  964. {
  965. first = true;
  966. }
  967. fout << output->c_str();
  968. }
  969. fout << "\"/>\n";
  970. fout << "\t\t\t\t</FileConfiguration>\n";
  971. }
  972. }
  973. void cmMSDotNETGenerator::WriteVCProjBeginGroup(std::ostream& fout,
  974. const char* group,
  975. const char* filter)
  976. {
  977. fout << "\t\t<Filter\n"
  978. << "\t\t\tName=\"" << group << "\"\n"
  979. << "\t\t\tFilter=\"\">\n";
  980. }
  981. void cmMSDotNETGenerator::WriteVCProjEndGroup(std::ostream& fout)
  982. {
  983. fout << "\t\t</Filter>\n";
  984. }
  985. std::string
  986. cmMSDotNETGenerator::CombineCommands(const cmSourceGroup::Commands &commands,
  987. cmSourceGroup::CommandFiles &totalCommand,
  988. const char *source)
  989. {
  990. // Loop through every custom command generating code from the
  991. // current source.
  992. // build up the depends and outputs and commands
  993. std::string totalCommandStr = "";
  994. std::string temp;
  995. for(cmSourceGroup::Commands::const_iterator c = commands.begin();
  996. c != commands.end(); ++c)
  997. {
  998. temp=
  999. cmSystemTools::ConvertToOutputPath(c->second.m_Command.c_str());
  1000. totalCommandStr += temp;
  1001. totalCommandStr += " ";
  1002. totalCommandStr += c->second.m_Arguments;
  1003. totalCommand.Merge(c->second);
  1004. }
  1005. // Create a dummy file with the name of the source if it does
  1006. // not exist
  1007. if(totalCommand.m_Outputs.empty())
  1008. {
  1009. std::string dummyFile = m_Makefile->GetStartOutputDirectory();
  1010. dummyFile += "/";
  1011. dummyFile += source;
  1012. if(!cmSystemTools::FileExists(dummyFile.c_str()))
  1013. {
  1014. std::ofstream fout(dummyFile.c_str());
  1015. fout << "Dummy file created by cmake as unused source for utility command.\n";
  1016. }
  1017. }
  1018. return totalCommandStr;
  1019. }
  1020. // look for custom rules on a target and collect them together
  1021. std::string
  1022. cmMSDotNETGenerator::CreateTargetRules(const cmTarget &target,
  1023. const char *libName)
  1024. {
  1025. std::string customRuleCode = "";
  1026. if (target.GetType() >= cmTarget::UTILITY)
  1027. {
  1028. return customRuleCode;
  1029. }
  1030. // Find the group in which the lix exe custom rules belong
  1031. bool init = false;
  1032. for (std::vector<cmCustomCommand>::const_iterator cr =
  1033. target.GetCustomCommands().begin();
  1034. cr != target.GetCustomCommands().end(); ++cr)
  1035. {
  1036. cmCustomCommand cc(*cr);
  1037. cc.ExpandVariables(*m_Makefile);
  1038. if (cc.GetSourceName() == libName)
  1039. {
  1040. if (!init)
  1041. {
  1042. // header stuff
  1043. customRuleCode = "# Begin Special Build Tool\nPostBuild_Cmds=";
  1044. init = true;
  1045. }
  1046. else
  1047. {
  1048. customRuleCode += "\t";
  1049. }
  1050. customRuleCode += cc.GetCommand() + " " + cc.GetArguments();
  1051. }
  1052. }
  1053. if (init)
  1054. {
  1055. customRuleCode += "\n# End Special Build Tool\n";
  1056. }
  1057. return customRuleCode;
  1058. }
  1059. void cmMSDotNETGenerator::WriteProjectStart(std::ostream& fout, const char *libName,
  1060. const cmTarget &target,
  1061. std::vector<cmSourceGroup> &)
  1062. {
  1063. fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"
  1064. << "<VisualStudioProject\n"
  1065. << "\tProjectType=\"Visual C++\"\n"
  1066. << "\tVersion=\"7.00\"\n"
  1067. << "\tName=\"" << libName << "\"\n"
  1068. << "\tSccProjectName=\"\"\n"
  1069. << "\tSccLocalPath=\"\"\n"
  1070. << "\tKeyword=\"Win32Proj\">\n"
  1071. << "\t<Platforms>\n"
  1072. << "\t\t<Platform\n\t\t\tName=\"Win32\"/>\n"
  1073. << "\t</Platforms>\n";
  1074. }
  1075. void cmMSDotNETGenerator::WriteVCProjFooter(std::ostream& fout)
  1076. {
  1077. fout << "\t<Globals>\n"
  1078. << "\t</Globals>\n"
  1079. << "</VisualStudioProject>\n";
  1080. }