cmGlobalVisualStudio10Generator.cxx 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #include "windows.h" // this must be first to define GetCurrentDirectory
  11. #include "cmGlobalVisualStudio10Generator.h"
  12. #include "cmLocalVisualStudio10Generator.h"
  13. #include "cmMakefile.h"
  14. #include "cmSourceFile.h"
  15. #include "cmVisualStudioSlnData.h"
  16. #include "cmVisualStudioSlnParser.h"
  17. #include "cmake.h"
  18. #include "cmAlgorithms.h"
  19. static const char vs10generatorName[] = "Visual Studio 10 2010";
  20. // Map generator name without year to name with year.
  21. static const char* cmVS10GenName(const std::string& name, std::string& genName)
  22. {
  23. if(strncmp(name.c_str(), vs10generatorName,
  24. sizeof(vs10generatorName)-6) != 0)
  25. {
  26. return 0;
  27. }
  28. const char* p = name.c_str() + sizeof(vs10generatorName) - 6;
  29. if(cmHasLiteralPrefix(p, " 2010"))
  30. {
  31. p += 5;
  32. }
  33. genName = std::string(vs10generatorName) + p;
  34. return p;
  35. }
  36. class cmGlobalVisualStudio10Generator::Factory
  37. : public cmGlobalGeneratorFactory
  38. {
  39. public:
  40. virtual cmGlobalGenerator*
  41. CreateGlobalGenerator(const std::string& name, cmake* cm) const
  42. {
  43. std::string genName;
  44. const char* p = cmVS10GenName(name, genName);
  45. if(!p)
  46. { return 0; }
  47. if(!*p)
  48. {
  49. return new cmGlobalVisualStudio10Generator(cm, genName, "");
  50. }
  51. if(*p++ != ' ')
  52. { return 0; }
  53. if(strcmp(p, "Win64") == 0)
  54. {
  55. return new cmGlobalVisualStudio10Generator(cm, genName, "x64");
  56. }
  57. if(strcmp(p, "IA64") == 0)
  58. {
  59. return new cmGlobalVisualStudio10Generator(cm, genName, "Itanium");
  60. }
  61. return 0;
  62. }
  63. virtual void GetDocumentation(cmDocumentationEntry& entry) const
  64. {
  65. entry.Name = std::string(vs10generatorName) + " [arch]";
  66. entry.Brief =
  67. "Generates Visual Studio 2010 project files. "
  68. "Optional [arch] can be \"Win64\" or \"IA64\"."
  69. ;
  70. }
  71. virtual void GetGenerators(std::vector<std::string>& names) const
  72. {
  73. names.push_back(vs10generatorName);
  74. names.push_back(vs10generatorName + std::string(" IA64"));
  75. names.push_back(vs10generatorName + std::string(" Win64"));
  76. }
  77. };
  78. //----------------------------------------------------------------------------
  79. cmGlobalGeneratorFactory* cmGlobalVisualStudio10Generator::NewFactory()
  80. {
  81. return new Factory;
  82. }
  83. //----------------------------------------------------------------------------
  84. cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(cmake* cm,
  85. const std::string& name, const std::string& platformName)
  86. : cmGlobalVisualStudio8Generator(cm, name, platformName)
  87. {
  88. std::string vc10Express;
  89. this->ExpressEdition = cmSystemTools::ReadRegistryValue(
  90. "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0\\Setup\\VC;"
  91. "ProductDir", vc10Express, cmSystemTools::KeyWOW64_32);
  92. this->SystemIsWindowsCE = false;
  93. this->SystemIsWindowsPhone = false;
  94. this->SystemIsWindowsStore = false;
  95. this->MSBuildCommandInitialized = false;
  96. this->Version = VS10;
  97. }
  98. //----------------------------------------------------------------------------
  99. bool
  100. cmGlobalVisualStudio10Generator::MatchesGeneratorName(
  101. const std::string& name) const
  102. {
  103. std::string genName;
  104. if(cmVS10GenName(name, genName))
  105. {
  106. return genName == this->GetName();
  107. }
  108. return false;
  109. }
  110. //----------------------------------------------------------------------------
  111. bool cmGlobalVisualStudio10Generator::SetSystemName(std::string const& s,
  112. cmMakefile* mf)
  113. {
  114. this->SystemName = s;
  115. this->SystemVersion = mf->GetSafeDefinition("CMAKE_SYSTEM_VERSION");
  116. if(!this->InitializeSystem(mf))
  117. {
  118. return false;
  119. }
  120. return this->cmGlobalVisualStudio8Generator::SetSystemName(s, mf);
  121. }
  122. //----------------------------------------------------------------------------
  123. bool
  124. cmGlobalVisualStudio10Generator::SetGeneratorPlatform(std::string const& p,
  125. cmMakefile* mf)
  126. {
  127. if(!this->cmGlobalVisualStudio8Generator::SetGeneratorPlatform(p, mf))
  128. {
  129. return false;
  130. }
  131. if(this->GetPlatformName() == "Itanium" || this->GetPlatformName() == "x64")
  132. {
  133. if(this->IsExpressEdition() && !this->Find64BitTools(mf))
  134. {
  135. return false;
  136. }
  137. }
  138. return true;
  139. }
  140. //----------------------------------------------------------------------------
  141. bool
  142. cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts,
  143. cmMakefile* mf)
  144. {
  145. if (this->SystemIsWindowsCE && ts.empty() &&
  146. this->DefaultPlatformToolset.empty())
  147. {
  148. std::ostringstream e;
  149. e << this->GetName() << " Windows CE version '" << this->SystemVersion
  150. << "' requires CMAKE_GENERATOR_TOOLSET to be set.";
  151. mf->IssueMessage(cmake::FATAL_ERROR, e.str());
  152. return false;
  153. }
  154. this->GeneratorToolset = ts;
  155. if(const char* toolset = this->GetPlatformToolset())
  156. {
  157. mf->AddDefinition("CMAKE_VS_PLATFORM_TOOLSET", toolset);
  158. }
  159. return true;
  160. }
  161. //----------------------------------------------------------------------------
  162. bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
  163. {
  164. if (this->SystemName == "WindowsCE")
  165. {
  166. this->SystemIsWindowsCE = true;
  167. if (!this->InitializeWindowsCE(mf))
  168. {
  169. return false;
  170. }
  171. }
  172. else if(this->SystemName == "WindowsPhone")
  173. {
  174. this->SystemIsWindowsPhone = true;
  175. if(!this->InitializeWindowsPhone(mf))
  176. {
  177. return false;
  178. }
  179. }
  180. else if(this->SystemName == "WindowsStore")
  181. {
  182. this->SystemIsWindowsStore = true;
  183. if(!this->InitializeWindowsStore(mf))
  184. {
  185. return false;
  186. }
  187. }
  188. else if(this->SystemName == "Android")
  189. {
  190. if(this->DefaultPlatformName != "Win32")
  191. {
  192. std::ostringstream e;
  193. e << "CMAKE_SYSTEM_NAME is 'Android' but CMAKE_GENERATOR "
  194. << "specifies a platform too: '" << this->GetName() << "'";
  195. mf->IssueMessage(cmake::FATAL_ERROR, e.str());
  196. return false;
  197. }
  198. std::string v = this->GetInstalledNsightTegraVersion();
  199. if(v.empty())
  200. {
  201. mf->IssueMessage(cmake::FATAL_ERROR,
  202. "CMAKE_SYSTEM_NAME is 'Android' but "
  203. "'NVIDIA Nsight Tegra Visual Studio Edition' "
  204. "is not installed.");
  205. return false;
  206. }
  207. this->DefaultPlatformName = "Tegra-Android";
  208. this->DefaultPlatformToolset = "Default";
  209. this->NsightTegraVersion = v;
  210. mf->AddDefinition("CMAKE_VS_NsightTegra_VERSION", v.c_str());
  211. }
  212. return true;
  213. }
  214. //----------------------------------------------------------------------------
  215. bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf)
  216. {
  217. if (this->DefaultPlatformName != "Win32")
  218. {
  219. std::ostringstream e;
  220. e << "CMAKE_SYSTEM_NAME is 'WindowsCE' but CMAKE_GENERATOR "
  221. << "specifies a platform too: '" << this->GetName() << "'";
  222. mf->IssueMessage(cmake::FATAL_ERROR, e.str());
  223. return false;
  224. }
  225. this->DefaultPlatformToolset = this->SelectWindowsCEToolset();
  226. return true;
  227. }
  228. //----------------------------------------------------------------------------
  229. bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf)
  230. {
  231. std::ostringstream e;
  232. e << this->GetName() << " does not support Windows Phone.";
  233. mf->IssueMessage(cmake::FATAL_ERROR, e.str());
  234. return false;
  235. }
  236. //----------------------------------------------------------------------------
  237. bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf)
  238. {
  239. std::ostringstream e;
  240. e << this->GetName() << " does not support Windows Store.";
  241. mf->IssueMessage(cmake::FATAL_ERROR, e.str());
  242. return false;
  243. }
  244. //----------------------------------------------------------------------------
  245. bool
  246. cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset(
  247. std::string& toolset) const
  248. {
  249. toolset = "";
  250. return false;
  251. }
  252. //----------------------------------------------------------------------------
  253. bool
  254. cmGlobalVisualStudio10Generator::SelectWindowsStoreToolset(
  255. std::string& toolset) const
  256. {
  257. toolset = "";
  258. return false;
  259. }
  260. //----------------------------------------------------------------------------
  261. std::string cmGlobalVisualStudio10Generator::SelectWindowsCEToolset() const
  262. {
  263. if (this->SystemVersion == "8.0")
  264. {
  265. return "CE800";
  266. }
  267. return "";
  268. }
  269. //----------------------------------------------------------------------------
  270. void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
  271. {
  272. fout << "Microsoft Visual Studio Solution File, Format Version 11.00\n";
  273. if (this->ExpressEdition)
  274. {
  275. fout << "# Visual C++ Express 2010\n";
  276. }
  277. else
  278. {
  279. fout << "# Visual Studio 2010\n";
  280. }
  281. }
  282. ///! Create a local generator appropriate to this Global Generator
  283. cmLocalGenerator* cmGlobalVisualStudio10Generator::CreateLocalGenerator(
  284. cmMakefile* mf)
  285. {
  286. return new cmLocalVisualStudio10Generator(this, mf);
  287. }
  288. //----------------------------------------------------------------------------
  289. bool cmGlobalVisualStudio10Generator::Compute()
  290. {
  291. if (!cmGlobalVisualStudio8Generator::Compute())
  292. {
  293. return false;
  294. }
  295. this->LongestSource = LongestSourcePath();
  296. return true;
  297. }
  298. void cmGlobalVisualStudio10Generator::Generate()
  299. {
  300. this->cmGlobalVisualStudio8Generator::Generate();
  301. if(this->LongestSource.Length > 0)
  302. {
  303. cmMakefile* mf = this->LongestSource.Target->GetMakefile();
  304. std::ostringstream e;
  305. e <<
  306. "The binary and/or source directory paths may be too long to generate "
  307. "Visual Studio 10 files for this project. "
  308. "Consider choosing shorter directory names to build this project with "
  309. "Visual Studio 10. "
  310. "A more detailed explanation follows."
  311. "\n"
  312. "There is a bug in the VS 10 IDE that renders property dialog fields "
  313. "blank for files referenced by full path in the project file. "
  314. "However, CMake must reference at least one file by full path:\n"
  315. " " << this->LongestSource.SourceFile->GetFullPath() << "\n"
  316. "This is because some Visual Studio tools would append the relative "
  317. "path to the end of the referencing directory path, as in:\n"
  318. " " << mf->GetCurrentBinaryDirectory() << "/"
  319. << this->LongestSource.SourceRel << "\n"
  320. "and then incorrectly complain that the file does not exist because "
  321. "the path length is too long for some internal buffer or API. "
  322. "To avoid this problem CMake must use a full path for this file "
  323. "which then triggers the VS 10 property dialog bug.";
  324. mf->IssueMessage(cmake::WARNING, e.str().c_str());
  325. }
  326. }
  327. //----------------------------------------------------------------------------
  328. void cmGlobalVisualStudio10Generator
  329. ::EnableLanguage(std::vector<std::string>const & lang,
  330. cmMakefile *mf, bool optional)
  331. {
  332. cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional);
  333. }
  334. //----------------------------------------------------------------------------
  335. const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const
  336. {
  337. if(!this->GeneratorToolset.empty())
  338. {
  339. return this->GeneratorToolset.c_str();
  340. }
  341. if(!this->DefaultPlatformToolset.empty())
  342. {
  343. return this->DefaultPlatformToolset.c_str();
  344. }
  345. return 0;
  346. }
  347. //----------------------------------------------------------------------------
  348. void cmGlobalVisualStudio10Generator::FindMakeProgram(cmMakefile* mf)
  349. {
  350. this->cmGlobalVisualStudio8Generator::FindMakeProgram(mf);
  351. mf->AddDefinition("CMAKE_VS_MSBUILD_COMMAND",
  352. this->GetMSBuildCommand().c_str());
  353. }
  354. //----------------------------------------------------------------------------
  355. std::string const& cmGlobalVisualStudio10Generator::GetMSBuildCommand()
  356. {
  357. if(!this->MSBuildCommandInitialized)
  358. {
  359. this->MSBuildCommandInitialized = true;
  360. this->MSBuildCommand = this->FindMSBuildCommand();
  361. }
  362. return this->MSBuildCommand;
  363. }
  364. //----------------------------------------------------------------------------
  365. std::string cmGlobalVisualStudio10Generator::FindMSBuildCommand()
  366. {
  367. std::string msbuild;
  368. std::string mskey =
  369. "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\";
  370. mskey += this->GetToolsVersion();
  371. mskey += ";MSBuildToolsPath";
  372. if(cmSystemTools::ReadRegistryValue(mskey.c_str(), msbuild,
  373. cmSystemTools::KeyWOW64_32))
  374. {
  375. cmSystemTools::ConvertToUnixSlashes(msbuild);
  376. msbuild += "/";
  377. }
  378. msbuild += "MSBuild.exe";
  379. return msbuild;
  380. }
  381. //----------------------------------------------------------------------------
  382. std::string cmGlobalVisualStudio10Generator::FindDevEnvCommand()
  383. {
  384. if(this->ExpressEdition)
  385. {
  386. // Visual Studio Express >= 10 do not have "devenv.com" or
  387. // "VCExpress.exe" that we can use to build reliably.
  388. // Tell the caller it needs to use MSBuild instead.
  389. return "";
  390. }
  391. // Skip over the cmGlobalVisualStudio8Generator implementation because
  392. // we expect a real devenv and do not want to look for VCExpress.
  393. return this->cmGlobalVisualStudio71Generator::FindDevEnvCommand();
  394. }
  395. //----------------------------------------------------------------------------
  396. void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
  397. std::vector<std::string>& makeCommand,
  398. const std::string& makeProgram,
  399. const std::string& projectName,
  400. const std::string& projectDir,
  401. const std::string& targetName,
  402. const std::string& config,
  403. bool fast, bool verbose,
  404. std::vector<std::string> const& makeOptions)
  405. {
  406. // Select the caller- or user-preferred make program, else MSBuild.
  407. std::string makeProgramSelected =
  408. this->SelectMakeProgram(makeProgram, this->GetMSBuildCommand());
  409. // Check if the caller explicitly requested a devenv tool.
  410. std::string makeProgramLower = makeProgramSelected;
  411. cmSystemTools::LowerCase(makeProgramLower);
  412. bool useDevEnv =
  413. (makeProgramLower.find("devenv") != std::string::npos ||
  414. makeProgramLower.find("vcexpress") != std::string::npos);
  415. // MSBuild is preferred (and required for VS Express), but if the .sln has
  416. // an Intel Fortran .vfproj then we have to use devenv. Parse it to find out.
  417. cmSlnData slnData;
  418. {
  419. std::string slnFile;
  420. if(!projectDir.empty())
  421. {
  422. slnFile = projectDir;
  423. slnFile += "/";
  424. }
  425. slnFile += projectName;
  426. slnFile += ".sln";
  427. cmVisualStudioSlnParser parser;
  428. if(parser.ParseFile(slnFile, slnData,
  429. cmVisualStudioSlnParser::DataGroupProjects))
  430. {
  431. std::vector<cmSlnProjectEntry> slnProjects = slnData.GetProjects();
  432. for(std::vector<cmSlnProjectEntry>::iterator i = slnProjects.begin();
  433. !useDevEnv && i != slnProjects.end(); ++i)
  434. {
  435. std::string proj = i->GetRelativePath();
  436. if(proj.size() > 7 &&
  437. proj.substr(proj.size()-7) == ".vfproj")
  438. {
  439. useDevEnv = true;
  440. }
  441. }
  442. }
  443. }
  444. if(useDevEnv)
  445. {
  446. // Use devenv to build solutions containing Intel Fortran projects.
  447. cmGlobalVisualStudio7Generator::GenerateBuildCommand(
  448. makeCommand, makeProgram, projectName, projectDir,
  449. targetName, config, fast, verbose, makeOptions);
  450. return;
  451. }
  452. makeCommand.push_back(makeProgramSelected);
  453. std::string realTarget = targetName;
  454. // msbuild.exe CxxOnly.sln /t:Build /p:Configuration=Debug /target:ALL_BUILD
  455. if(realTarget.empty())
  456. {
  457. realTarget = "ALL_BUILD";
  458. }
  459. if ( realTarget == "clean" )
  460. {
  461. makeCommand.push_back(std::string(projectName)+".sln");
  462. makeCommand.push_back("/t:Clean");
  463. }
  464. else
  465. {
  466. std::string targetProject(realTarget);
  467. targetProject += ".vcxproj";
  468. if (targetProject.find('/') == std::string::npos)
  469. {
  470. // it might be in a subdir
  471. if (cmSlnProjectEntry const* proj =
  472. slnData.GetProjectByName(realTarget))
  473. {
  474. targetProject = proj->GetRelativePath();
  475. cmSystemTools::ConvertToUnixSlashes(targetProject);
  476. }
  477. }
  478. makeCommand.push_back(targetProject);
  479. }
  480. std::string configArg = "/p:Configuration=";
  481. if(!config.empty())
  482. {
  483. configArg += config;
  484. }
  485. else
  486. {
  487. configArg += "Debug";
  488. }
  489. makeCommand.push_back(configArg);
  490. makeCommand.push_back(std::string("/p:VisualStudioVersion=")+
  491. this->GetIDEVersion());
  492. makeCommand.insert(makeCommand.end(),
  493. makeOptions.begin(), makeOptions.end());
  494. }
  495. //----------------------------------------------------------------------------
  496. bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf)
  497. {
  498. if(this->GetPlatformToolset())
  499. {
  500. return true;
  501. }
  502. // This edition does not come with 64-bit tools. Look for them.
  503. //
  504. // TODO: Detect available tools? x64\v100 exists but does not work?
  505. // HKLM\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\4.0;VCTargetsPath
  506. // c:/Program Files (x86)/MSBuild/Microsoft.Cpp/v4.0/Platforms/
  507. // {Itanium,Win32,x64}/PlatformToolsets/{v100,v90,Windows7.1SDK}
  508. std::string winSDK_7_1;
  509. if(cmSystemTools::ReadRegistryValue(
  510. "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\"
  511. "Windows\\v7.1;InstallationFolder", winSDK_7_1))
  512. {
  513. std::ostringstream m;
  514. m << "Found Windows SDK v7.1: " << winSDK_7_1;
  515. mf->DisplayStatus(m.str().c_str(), -1);
  516. this->DefaultPlatformToolset = "Windows7.1SDK";
  517. return true;
  518. }
  519. else
  520. {
  521. std::ostringstream e;
  522. e << "Cannot enable 64-bit tools with Visual Studio 2010 Express.\n"
  523. << "Install the Microsoft Windows SDK v7.1 to get 64-bit tools:\n"
  524. << " http://msdn.microsoft.com/en-us/windows/bb980924.aspx";
  525. mf->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
  526. cmSystemTools::SetFatalErrorOccured();
  527. return false;
  528. }
  529. }
  530. //----------------------------------------------------------------------------
  531. std::string
  532. cmGlobalVisualStudio10Generator
  533. ::GenerateRuleFile(std::string const& output) const
  534. {
  535. // The VS 10 generator needs to create the .rule files on disk.
  536. // Hide them away under the CMakeFiles directory.
  537. std::string ruleDir = this->GetCMakeInstance()->GetHomeOutputDirectory();
  538. ruleDir += cmake::GetCMakeFilesDirectory();
  539. ruleDir += "/";
  540. ruleDir += cmSystemTools::ComputeStringMD5(
  541. cmSystemTools::GetFilenamePath(output).c_str());
  542. std::string ruleFile = ruleDir + "/";
  543. ruleFile += cmSystemTools::GetFilenameName(output);
  544. ruleFile += ".rule";
  545. return ruleFile;
  546. }
  547. //----------------------------------------------------------------------------
  548. void cmGlobalVisualStudio10Generator::PathTooLong(
  549. cmTarget* target, cmSourceFile const* sf, std::string const& sfRel)
  550. {
  551. size_t len = (strlen(target->GetMakefile()->GetCurrentBinaryDirectory()) +
  552. 1 + sfRel.length());
  553. if(len > this->LongestSource.Length)
  554. {
  555. this->LongestSource.Length = len;
  556. this->LongestSource.Target = target;
  557. this->LongestSource.SourceFile = sf;
  558. this->LongestSource.SourceRel = sfRel;
  559. }
  560. }
  561. //----------------------------------------------------------------------------
  562. bool cmGlobalVisualStudio10Generator::UseFolderProperty()
  563. {
  564. return IsExpressEdition() ? false : cmGlobalGenerator::UseFolderProperty();
  565. }
  566. //----------------------------------------------------------------------------
  567. bool cmGlobalVisualStudio10Generator::IsNsightTegra() const
  568. {
  569. return !this->NsightTegraVersion.empty();
  570. }
  571. //----------------------------------------------------------------------------
  572. std::string cmGlobalVisualStudio10Generator::GetNsightTegraVersion() const
  573. {
  574. return this->NsightTegraVersion;
  575. }
  576. //----------------------------------------------------------------------------
  577. std::string cmGlobalVisualStudio10Generator::GetInstalledNsightTegraVersion()
  578. {
  579. std::string version;
  580. cmSystemTools::ReadRegistryValue(
  581. "HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;"
  582. "Version", version, cmSystemTools::KeyWOW64_32);
  583. return version;
  584. }