cmMSDotNETGenerator.cxx 38 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 = dir;
  288. cmSystemTools::ConvertToWindowsSlashes(d);
  289. fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\" = \""
  290. << dspname << "\", \""
  291. << d << "\\" << dspname << ".vcproj\", \"{"
  292. << this->CreateGUID(dspname) << "}\"\nEndProject\n";
  293. }
  294. // Write a dsp file into the SLN file,
  295. // Note, that dependencies from executables to
  296. // the libraries it uses are also done here
  297. void cmMSDotNETGenerator::WriteProjectDepends(std::ostream& fout,
  298. const char* dspname,
  299. const char* dir,
  300. cmMSDotNETGenerator*,
  301. const cmTarget& target
  302. )
  303. {
  304. int depcount = 0;
  305. // insert Begin Project Dependency Project_Dep_Name project stuff here
  306. if (target.GetType() != cmTarget::STATIC_LIBRARY)
  307. {
  308. cmTarget::LinkLibraries::const_iterator j, jend;
  309. j = target.GetLinkLibraries().begin();
  310. jend = target.GetLinkLibraries().end();
  311. for(;j!= jend; ++j)
  312. {
  313. if(j->first != dspname)
  314. {
  315. // is the library part of this SLN ? If so add dependency
  316. const char* cacheValue
  317. = m_Makefile->GetDefinition(j->first.c_str());
  318. if(cacheValue)
  319. {
  320. fout << "\t\t{" << this->CreateGUID(dspname) << "}." << depcount << " = {"
  321. << this->CreateGUID(j->first.c_str()) << "}\n";
  322. depcount++;
  323. }
  324. }
  325. }
  326. }
  327. std::set<std::string>::const_iterator i, end;
  328. // write utility dependencies.
  329. i = target.GetUtilities().begin();
  330. end = target.GetUtilities().end();
  331. for(;i!= end; ++i)
  332. {
  333. if(*i != dspname)
  334. {
  335. fout << "\t\t{" << this->CreateGUID(dspname) << "}." << depcount << " = {"
  336. << this->CreateGUID(i->c_str()) << "}\n";
  337. depcount++;
  338. }
  339. }
  340. }
  341. // Write a dsp file into the SLN file,
  342. // Note, that dependencies from executables to
  343. // the libraries it uses are also done here
  344. void cmMSDotNETGenerator::WriteProjectConfigurations(std::ostream& fout, const char* name)
  345. {
  346. std::string guid = this->CreateGUID(name);
  347. for(std::vector<std::string>::iterator i = m_Configurations.begin();
  348. i != m_Configurations.end(); ++i)
  349. {
  350. fout << "\t\t{" << guid << "}." << *i << ".ActiveCfg = " << *i << "|Win32\n"
  351. << "\t\t{" << guid << "}." << *i << ".Build.0 = " << *i << "|Win32\n";
  352. }
  353. }
  354. // Write a dsp file into the SLN file,
  355. // Note, that dependencies from executables to
  356. // the libraries it uses are also done here
  357. void cmMSDotNETGenerator::WriteExternalProject(std::ostream& fout,
  358. const char* name,
  359. const char* location,
  360. const std::vector<std::string>& dependencies)
  361. {
  362. cmSystemTools::Error("WriteExternalProject not implemented");
  363. // fout << "#########################################################"
  364. // "######################\n\n";
  365. // fout << "Project: \"" << name << "\"="
  366. // << location << " - Package Owner=<4>\n\n";
  367. // fout << "Package=<5>\n{{{\n}}}\n\n";
  368. // fout << "Package=<4>\n";
  369. // fout << "{{{\n";
  370. // std::vector<std::string>::const_iterator i, end;
  371. // // write dependencies.
  372. // i = dependencies.begin();
  373. // end = dependencies.end();
  374. // for(;i!= end; ++i)
  375. // {
  376. // fout << "Begin Project Dependency\n";
  377. // fout << "Project_Dep_Name " << *i << "\n";
  378. // fout << "End Project Dependency\n";
  379. // }
  380. // fout << "}}}\n\n";
  381. }
  382. // Standard end of dsw file
  383. void cmMSDotNETGenerator::WriteSLNFooter(std::ostream& fout)
  384. {
  385. fout << "\tGlobalSection(ExtensibilityGlobals) = postSolution\n"
  386. << "\tEndGlobalSection\n"
  387. << "\tGlobalSection(ExtensibilityAddIns) = postSolution\n"
  388. << "\tEndGlobalSection\n"
  389. << "EndGlobal\n";
  390. }
  391. // ouput standard header for dsw file
  392. void cmMSDotNETGenerator::WriteSLNHeader(std::ostream& fout)
  393. {
  394. fout << "Microsoft Visual Studio Solution File, Format Version 7.00\n";
  395. }
  396. std::string cmMSDotNETGenerator::CreateGUID(const char* name)
  397. {
  398. std::map<cmStdString, cmStdString>::iterator i = m_GUIDMap.find(name);
  399. if(i != m_GUIDMap.end())
  400. {
  401. return i->second;
  402. }
  403. std::string ret;
  404. UUID uid;
  405. unsigned char *uidstr;
  406. UuidCreate(&uid);
  407. UuidToString(&uid,&uidstr);
  408. ret = reinterpret_cast<char*>(uidstr);
  409. RpcStringFree(&uidstr);
  410. ret = cmSystemTools::UpperCase(ret);
  411. m_GUIDMap[name] = ret;
  412. return ret;
  413. }
  414. // TODO
  415. // for CommandLine= need to repleace quotes with &quot
  416. // write out configurations
  417. void cmMSDotNETGenerator::OutputVCProjFile()
  418. {
  419. // If not an in source build, then create the output directory
  420. if(strcmp(m_Makefile->GetStartOutputDirectory(),
  421. m_Makefile->GetHomeDirectory()) != 0)
  422. {
  423. if(!cmSystemTools::MakeDirectory(m_Makefile->GetStartOutputDirectory()))
  424. {
  425. cmSystemTools::Error("Error creating directory ",
  426. m_Makefile->GetStartOutputDirectory());
  427. }
  428. }
  429. m_LibraryOutputPath = "";
  430. if (m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH"))
  431. {
  432. m_LibraryOutputPath = m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH");
  433. }
  434. if(m_LibraryOutputPath.size())
  435. {
  436. // make sure there is a trailing slash
  437. if(m_LibraryOutputPath[m_LibraryOutputPath.size()-1] != '/')
  438. {
  439. m_LibraryOutputPath += "/";
  440. }
  441. m_LibraryOutputPath = cmSystemTools::HandleNetworkPaths(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 = cmSystemTools::HandleNetworkPaths(m_ExecutableOutputPath.c_str());
  457. std::vector<std::string>& includes = m_Makefile->GetIncludeDirectories();
  458. std::vector<std::string>::iterator i;
  459. for(i = includes.begin(); i != includes.end(); ++i)
  460. {
  461. std::string tmp = cmSystemTools::EscapeSpaces(i->c_str());
  462. cmSystemTools::ConvertToWindowsSlashesAndCleanUp(tmp);
  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::HandleNetworkPaths(makefileIn.c_str());
  528. makefileIn = cmSystemTools::EscapeSpaces(makefileIn.c_str());
  529. std::string dsprule = "${CMAKE_COMMAND}";
  530. m_Makefile->ExpandVariablesInString(dsprule);
  531. dsprule = cmSystemTools::HandleNetworkPaths(dsprule.c_str());
  532. std::string args = makefileIn;
  533. args += " -H\"";
  534. args += cmSystemTools::HandleNetworkPaths(m_Makefile->GetHomeDirectory());
  535. args += "\" -S\"";
  536. args += cmSystemTools::HandleNetworkPaths(m_Makefile->GetStartDirectory());
  537. args += "\" -O\"";
  538. args += cmSystemTools::HandleNetworkPaths(m_Makefile->GetStartOutputDirectory());
  539. args += "\" -B\"";
  540. args += cmSystemTools::HandleNetworkPaths(m_Makefile->GetHomeOutputDirectory());
  541. args += "\"";
  542. m_Makefile->ExpandVariablesInString(args);
  543. std::string configFile =
  544. m_Makefile->GetDefinition("CMAKE_ROOT");
  545. configFile += "/Templates/CMakeWindowsSystemConfig.cmake";
  546. std::vector<std::string> listFiles = m_Makefile->GetListFiles();
  547. bool found = false;
  548. for(std::vector<std::string>::iterator i = listFiles.begin();
  549. i != listFiles.end(); ++i)
  550. {
  551. if(*i == configFile)
  552. {
  553. found = true;
  554. }
  555. }
  556. if(!found)
  557. {
  558. listFiles.push_back(configFile);
  559. }
  560. std::vector<std::string> outputs;
  561. outputs.push_back(dspname);
  562. cmCustomCommand cc(makefileIn.c_str(), dsprule.c_str(),
  563. args.c_str(),
  564. listFiles,
  565. outputs);
  566. sourceGroup.AddCustomCommand(cc);
  567. }
  568. void cmMSDotNETGenerator::WriteConfigurations(std::ostream& fout,
  569. const char *libName,
  570. const cmTarget &target)
  571. {
  572. fout << "\t<Configurations>\n";
  573. for( std::vector<std::string>::iterator i = m_Configurations.begin();
  574. i != m_Configurations.end(); ++i)
  575. {
  576. this->WriteConfiguration(fout, i->c_str(), libName, target);
  577. }
  578. fout << "\t</Configurations>\n";
  579. }
  580. void cmMSDotNETGenerator::WriteConfiguration(std::ostream& fout,
  581. const char* configName,
  582. const char *libName,
  583. const cmTarget &target)
  584. {
  585. const char* mfcFlag = m_Makefile->GetDefinition("CMAKE_MFC_FLAG");
  586. if(!mfcFlag)
  587. {
  588. mfcFlag = "0";
  589. }
  590. fout << "\t\t<Configuration\n"
  591. << "\t\t\tName=\"" << configName << "|Win32\"\n"
  592. << "\t\t\tOutputDirectory=\"";
  593. // This is an internal type to Visual Studio, it seems that:
  594. // 4 == static library
  595. // 2 == dll
  596. // 1 == executable
  597. // 10 == utility
  598. const char* configType = "10";
  599. switch(target.GetType())
  600. {
  601. case cmTarget::STATIC_LIBRARY:
  602. configType = "4";
  603. fout << m_LibraryOutputPath << configName << "\"\n";
  604. break;
  605. case cmTarget::SHARED_LIBRARY:
  606. case cmTarget::MODULE_LIBRARY:
  607. fout << m_LibraryOutputPath << configName << "\"\n";
  608. configType = "2";
  609. break;
  610. case cmTarget::EXECUTABLE:
  611. case cmTarget::WIN32_EXECUTABLE:
  612. fout << m_ExecutableOutputPath << configName << "\"\n";
  613. configType = "1";
  614. break;
  615. case cmTarget::UTILITY:
  616. configType = "10";
  617. default:
  618. fout << configName << "\"\n";
  619. break;
  620. }
  621. fout << "\t\t\tIntermediateDirectory=\".\\" << configName << "\"\n"
  622. << "\t\t\tConfigurationType=\"" << configType << "\"\n"
  623. << "\t\t\tUseOfMFC=\"" << mfcFlag << "\"\n"
  624. << "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\"\n"
  625. << "\t\t\tCharacterSet=\"2\">\n";
  626. fout << "\t\t\t<Tool\n"
  627. << "\t\t\t\tName=\"VCCLCompilerTool\"\n"
  628. << "\t\t\t\tAdditionalOptions=\"" <<
  629. m_Makefile->GetDefinition("CMAKE_CXX_FLAGS") << "\"\n";
  630. fout << "\t\t\t\tAdditionalIncludeDirectories=\"";
  631. std::vector<std::string>& includes = m_Makefile->GetIncludeDirectories();
  632. std::vector<std::string>::iterator i = includes.begin();
  633. if(i != includes.end())
  634. {
  635. fout << "&quot;" << *i << "&quot;";
  636. }
  637. for(;i != includes.end(); ++i)
  638. {
  639. fout << ";&quot;" << *i << "&quot;";
  640. }
  641. fout << "\"\n";
  642. if(strcmp(configName, "Debug") == 0)
  643. {
  644. fout << "\t\t\t\tOptimization=\"0\"\n"
  645. << "\t\t\t\tRuntimeLibrary=\"3\"\n"
  646. << "\t\t\t\tPreprocessorDefinitions=\"WIN32,_DEBUG,_WINDOWS";
  647. }
  648. else if(strcmp(configName, "Release") == 0)
  649. {
  650. fout << "\t\t\t\tOptimization=\"2\"\n"
  651. << "\t\t\t\tRuntimeLibrary=\"0\"\n"
  652. << "\t\t\t\tInlineFunctionExpansion=\"1\"\n"
  653. << "\t\t\t\tPreprocessorDefinitions=\"WIN32,NDEBUG,_WINDOWS";
  654. }
  655. else if(strcmp(configName, "MinSizeRel") == 0)
  656. {
  657. fout << "\t\t\t\tOptimization=\"1\"\n"
  658. << "\t\t\t\tRuntimeLibrary=\"0\"\n"
  659. << "\t\t\t\tInlineFunctionExpansion=\"1\"\n"
  660. << "\t\t\t\tPreprocessorDefinitions=\"WIN32,NDEBUG,_WINDOWS";
  661. }
  662. else if(strcmp(configName, "RelWithDebInfo") == 0)
  663. {
  664. fout << "\t\t\t\tOptimization=\"2\"\n"
  665. << "\t\t\t\tInlineFunctionExpansion=\"1\"\n"
  666. << "\t\t\t\tPreprocessorDefinitions=\"WIN32,NDEBUG,_WINDOWS";
  667. }
  668. this->OutputDefineFlags(fout);
  669. fout << "\"\n";
  670. fout << "\t\t\t\tAssemblerListingLocation=\"" << configName << "\"\n";
  671. fout << "\t\t\t\tObjectFile=\"" << configName << "\\\"\n";
  672. fout << "\t\t\t\tProgramDataBaseFileName=\"" << configName << "\"\n";
  673. fout << "\t\t\t\tWarningLevel=\"3\"\n";
  674. fout << "\t\t\t\tDetect64BitPortabilityProblems=\"TRUE\"\n"
  675. << "\t\t\t\tDebugInformationFormat=\"3\"";
  676. fout << "/>\n"; // end of <Tool Name=VCCLCompilerTool
  677. fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n";
  678. fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n";
  679. fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"/>\n";
  680. fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n";
  681. this->OutputBuildTool(fout, configName, libName, target);
  682. fout << "\t\t</Configuration>\n";
  683. }
  684. void cmMSDotNETGenerator::OutputBuildTool(std::ostream& fout,
  685. const char* configName,
  686. const char *libName,
  687. const cmTarget &target)
  688. {
  689. switch(target.GetType())
  690. {
  691. case cmTarget::STATIC_LIBRARY:
  692. fout << "\t\t\t<Tool\n"
  693. << "\t\t\t\tName=\"VCLibrarianTool\"\n"
  694. << "\t\t\t\t\tOutputFile=\"" << m_LibraryOutputPath << configName
  695. << "/" << libName << ".lib\"/>\n";
  696. break;
  697. case cmTarget::SHARED_LIBRARY:
  698. case cmTarget::MODULE_LIBRARY:
  699. break;
  700. case cmTarget::EXECUTABLE:
  701. fout << "\t\t\t<Tool\n"
  702. << "\t\t\t\tName=\"VCLinkerTool\"\n"
  703. << "\t\t\t\tAdditionalOptions=\"/MACHINE:I386\"\n"
  704. << "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";
  705. this->OutputLibraries(fout, configName, libName, target);
  706. fout << "\"\n";
  707. fout << "\t\t\t\tOutputFile=\"" << m_ExecutableOutputPath <<
  708. configName << "/" << libName << ".exe\"\n";
  709. fout << "\t\t\t\tLinkIncremental=\"1\"\n";
  710. fout << "\t\t\t\tSuppressStartupBanner=\"TRUE\"\n";
  711. fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
  712. this->OutputLibraryDirectories(fout, configName, libName, target);
  713. fout << "\"\n";
  714. fout << "\t\t\t\tProgramDatabaseFile=\"" << m_LibraryOutputPath << libName << ".pdb\"\n";
  715. fout << "\t\t\t\tSubSystem=\"1\"\n";
  716. fout << "\t\t\t\tStackReserveSize=\"10000000\"/>\n";
  717. break;
  718. case cmTarget::WIN32_EXECUTABLE:
  719. fout << "\t\t\t<Tool\n"
  720. << "\t\t\t\tName=\"VCLinkerTool\"\n"
  721. << "\t\t\t\tAdditionalOptions=\"/MACHINE:I386\"\n"
  722. << "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";
  723. this->OutputLibraries(fout, configName, libName, target);
  724. fout << "\"\n";
  725. fout << "\t\t\t\tOutputFile=\"" << m_ExecutableOutputPath <<
  726. configName << "/" << libName << ".exe\"\n";
  727. fout << "\t\t\t\tLinkIncremental=\"1\"\n";
  728. fout << "\t\t\t\tSuppressStartupBanner=\"TRUE\"\n";
  729. fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
  730. this->OutputLibraryDirectories(fout, configName, libName, target);
  731. fout << "\"\n";
  732. fout << "\t\t\t\tProgramDatabaseFile=\"" << m_LibraryOutputPath << libName << ".pdb\"\n";
  733. fout << "\t\t\t\tSubSystem=\"2\"\n";
  734. fout << "\t\t\t\tStackReserveSize=\"10000000\"/>\n";
  735. break;
  736. case cmTarget::UTILITY:
  737. break;
  738. }
  739. }
  740. void cmMSDotNETGenerator::OutputLibraryDirectories(std::ostream& fout,
  741. const char* configName,
  742. const char* libName,
  743. const cmTarget &target)
  744. {
  745. bool hasone = false;
  746. if(m_LibraryOutputPath.size())
  747. {
  748. hasone = true;
  749. fout << m_LibraryOutputPath << "$(INTDIR)," << m_LibraryOutputPath;
  750. }
  751. if(m_ExecutableOutputPath.size())
  752. {
  753. hasone = true;
  754. fout << m_ExecutableOutputPath << "$(INTDIR)," << m_ExecutableOutputPath;
  755. }
  756. std::set<std::string> pathEmitted;
  757. std::vector<std::string>::iterator i;
  758. std::vector<std::string>& libdirs = m_Makefile->GetLinkDirectories();
  759. for(i = libdirs.begin(); i != libdirs.end(); ++i)
  760. {
  761. std::string lpath = cmSystemTools::HandleNetworkPaths(i->c_str());
  762. if(lpath[lpath.size()-1] != '/')
  763. {
  764. lpath += "/";
  765. }
  766. if(pathEmitted.insert(lpath).second)
  767. {
  768. if(hasone)
  769. {
  770. fout << ",";
  771. }
  772. fout << lpath;
  773. hasone = true;
  774. }
  775. }
  776. }
  777. void cmMSDotNETGenerator::OutputLibraries(std::ostream& fout,
  778. const char* configName,
  779. const char* libName,
  780. const cmTarget &target)
  781. {
  782. const cmTarget::LinkLibraries& libs = target.GetLinkLibraries();
  783. cmTarget::LinkLibraries::const_iterator j;
  784. for(j = libs.begin(); j != libs.end(); ++j)
  785. {
  786. std::string lib = j->first;
  787. if(j->first.find(".lib") == std::string::npos)
  788. {
  789. lib += ".lib";
  790. }
  791. lib = cmSystemTools::EscapeSpaces(lib.c_str());
  792. if (j->second == cmTarget::GENERAL
  793. || (j->second == cmTarget::DEBUG && strcmp(configName, "DEBUG") == 0)
  794. || (j->second == cmTarget::OPTIMIZED && strcmp(configName, "DEBUG") != 0))
  795. {
  796. fout << lib << " ";
  797. }
  798. }
  799. }
  800. void cmMSDotNETGenerator::OutputDefineFlags(std::ostream& fout)
  801. {
  802. std::string defs = m_Makefile->GetDefineFlags();
  803. std::string::size_type pos = defs.find("-D");
  804. bool done = pos == std::string::npos;
  805. while(!done)
  806. {
  807. std::string::size_type nextpos = defs.find("-D", pos+2);
  808. std::string define;
  809. if(nextpos != std::string::npos)
  810. {
  811. define = defs.substr(pos+2, nextpos - pos -2);
  812. }
  813. else
  814. {
  815. define = defs.substr(pos+2);
  816. done = true;
  817. }
  818. fout << define << ",";
  819. if(!done)
  820. {
  821. pos = defs.find("-D", nextpos);
  822. }
  823. }
  824. }
  825. void cmMSDotNETGenerator::WriteVCProjFile(std::ostream& fout,
  826. const char *libName,
  827. cmTarget &target)
  828. {
  829. // We may be modifying the source groups temporarily, so make a copy.
  830. std::vector<cmSourceGroup> sourceGroups = m_Makefile->GetSourceGroups();
  831. // get the classes from the source lists then add them to the groups
  832. std::vector<cmSourceFile> classes = target.GetSourceFiles();
  833. for(std::vector<cmSourceFile>::iterator i = classes.begin();
  834. i != classes.end(); i++)
  835. {
  836. // Add the file to the list of sources.
  837. std::string source = i->GetFullPath();
  838. cmSourceGroup& sourceGroup = m_Makefile->FindSourceGroup(source.c_str(),
  839. sourceGroups);
  840. sourceGroup.AddSource(source.c_str());
  841. }
  842. // add any custom rules to the source groups
  843. for (std::vector<cmCustomCommand>::const_iterator cr =
  844. target.GetCustomCommands().begin();
  845. cr != target.GetCustomCommands().end(); ++cr)
  846. {
  847. cmSourceGroup& sourceGroup =
  848. m_Makefile->FindSourceGroup(cr->GetSourceName().c_str(),
  849. sourceGroups);
  850. cmCustomCommand cc(*cr);
  851. cc.ExpandVariables(*m_Makefile);
  852. sourceGroup.AddCustomCommand(cc);
  853. }
  854. // open the project
  855. this->WriteProjectStart(fout, libName, target, sourceGroups);
  856. // write the configuration information
  857. this->WriteConfigurations(fout, libName, target);
  858. fout << "\t<Files>\n";
  859. // Find the group in which the CMakeLists.txt source belongs, and add
  860. // the rule to generate this VCProj file.
  861. for(std::vector<cmSourceGroup>::reverse_iterator sg = sourceGroups.rbegin();
  862. sg != sourceGroups.rend(); ++sg)
  863. {
  864. if(sg->Matches("CMakeLists.txt"))
  865. {
  866. this->AddVCProjBuildRule(*sg);
  867. break;
  868. }
  869. }
  870. // Loop through every source group.
  871. for(std::vector<cmSourceGroup>::const_iterator sg = sourceGroups.begin();
  872. sg != sourceGroups.end(); ++sg)
  873. {
  874. const cmSourceGroup::BuildRules& buildRules = sg->GetBuildRules();
  875. // If the group is empty, don't write it at all.
  876. if(buildRules.empty())
  877. { continue; }
  878. // If the group has a name, write the header.
  879. std::string name = sg->GetName();
  880. if(name != "")
  881. {
  882. this->WriteVCProjBeginGroup(fout, name.c_str(), "");
  883. }
  884. // Loop through each build rule in the source group.
  885. for(cmSourceGroup::BuildRules::const_iterator cc =
  886. buildRules.begin(); cc != buildRules.end(); ++ cc)
  887. {
  888. std::string source = cc->first;
  889. const cmSourceGroup::Commands& commands = cc->second;
  890. if (source != libName || target.GetType() == cmTarget::UTILITY)
  891. {
  892. fout << "\t\t\t<File\n";
  893. std::string d = source;
  894. cmSystemTools::ConvertToWindowsSlashes(d);
  895. // Tell MS-Dev what the source is. If the compiler knows how to
  896. // build it, then it will.
  897. fout << "\t\t\t\tRelativePath=\"" << cmSystemTools::EscapeSpaces(d.c_str()) << "\">\n";
  898. if (!commands.empty())
  899. {
  900. cmSourceGroup::CommandFiles totalCommand;
  901. std::string totalCommandStr;
  902. totalCommandStr = this->CombineCommands(commands, totalCommand,
  903. source.c_str());
  904. this->WriteCustomRule(fout, source.c_str(), totalCommandStr.c_str(),
  905. totalCommand.m_Depends,
  906. totalCommand.m_Outputs);
  907. }
  908. fout << "\t\t\t</File>\n";
  909. }
  910. }
  911. // If the group has a name, write the footer.
  912. if(name != "")
  913. {
  914. this->WriteVCProjEndGroup(fout);
  915. }
  916. }
  917. fout << "\t</Files>\n";
  918. // Write the VCProj file's footer.
  919. this->WriteVCProjFooter(fout);
  920. }
  921. void cmMSDotNETGenerator::WriteCustomRule(std::ostream& fout,
  922. const char* source,
  923. const char* command,
  924. const std::set<std::string>& depends,
  925. const std::set<std::string>& outputs)
  926. {
  927. std::string cmd = command;
  928. cmSystemTools::ReplaceString(cmd, "\"", "&quot;");
  929. std::vector<std::string>::iterator i;
  930. for(i = m_Configurations.begin(); i != m_Configurations.end(); ++i)
  931. {
  932. fout << "\t\t\t\t<FileConfiguration\n";
  933. fout << "\t\t\t\t\tName=\"" << *i << "|Win32\">\n";
  934. fout << "\t\t\t\t\t<Tool\n"
  935. << "\t\t\t\t\tName=\"VCCustomBuildTool\"\n"
  936. << "\t\t\t\t\tCommandLine=\"" << cmd << "\n\"\n"
  937. << "\t\t\t\t\tAdditionalDependencies=\"";
  938. // Write out the dependencies for the rule.
  939. std::string temp;
  940. for(std::set<std::string>::const_iterator d = depends.begin();
  941. d != depends.end(); ++d)
  942. {
  943. temp = *d;
  944. fout << cmSystemTools::EscapeSpaces(cmSystemTools::ConvertToWindowsSlashes(temp))
  945. << ";";
  946. }
  947. fout << "\"\n";
  948. fout << "\t\t\t\t\tOutputs=\"";
  949. if(outputs.size() == 0)
  950. {
  951. fout << source << "_force";
  952. }
  953. bool first = true;
  954. // Write a rule for every output generated by this command.
  955. for(std::set<std::string>::const_iterator output = outputs.begin();
  956. output != outputs.end(); ++output)
  957. {
  958. if(!first)
  959. {
  960. fout << ";";
  961. }
  962. else
  963. {
  964. first = true;
  965. }
  966. fout << output->c_str();
  967. }
  968. fout << "\"/>\n";
  969. fout << "\t\t\t\t</FileConfiguration>\n";
  970. }
  971. }
  972. void cmMSDotNETGenerator::WriteVCProjBeginGroup(std::ostream& fout,
  973. const char* group,
  974. const char* filter)
  975. {
  976. fout << "\t\t<Filter\n"
  977. << "\t\t\tName=\"" << group << "\"\n"
  978. << "\t\t\tFilter=\"\">\n";
  979. }
  980. void cmMSDotNETGenerator::WriteVCProjEndGroup(std::ostream& fout)
  981. {
  982. fout << "\t\t</Filter>\n";
  983. }
  984. std::string
  985. cmMSDotNETGenerator::CombineCommands(const cmSourceGroup::Commands &commands,
  986. cmSourceGroup::CommandFiles &totalCommand,
  987. const char *source)
  988. {
  989. // Loop through every custom command generating code from the
  990. // current source.
  991. // build up the depends and outputs and commands
  992. std::string totalCommandStr = "";
  993. std::string temp;
  994. for(cmSourceGroup::Commands::const_iterator c = commands.begin();
  995. c != commands.end(); ++c)
  996. {
  997. temp= c->second.m_Command;
  998. cmSystemTools::ConvertToWindowsSlashes(temp);
  999. temp = cmSystemTools::EscapeSpaces(temp.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. }