ENH: check in almost building VMS stuff with VMSBuild directory since the bootstrap...
[cmake.git] / Source / cmGlobalVisualStudio9Generator.cxx
blobfcf1de2bb96bc1175f165660e17c1b579dd81191
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmGlobalVisualStudio9Generator.cxx,v $
5 Language: C++
6 Date: $Date: 2008-02-15 16:49:58 $
7 Version: $Revision: 1.6 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "windows.h" // this must be first to define GetCurrentDirectory
18 #include "cmGlobalVisualStudio9Generator.h"
19 #include "cmLocalVisualStudio7Generator.h"
20 #include "cmMakefile.h"
21 #include "cmake.h"
25 cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator()
27 this->FindMakeProgramFile = "CMakeVS9FindMake.cmake";
30 //----------------------------------------------------------------------------
31 void cmGlobalVisualStudio9Generator::AddPlatformDefinitions(cmMakefile* mf)
33 mf->AddDefinition("MSVC90", "1");
36 //----------------------------------------------------------------------------
37 void cmGlobalVisualStudio9Generator::WriteSLNHeader(std::ostream& fout)
39 fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n";
40 fout << "# Visual Studio 2008\n";
43 ///! Create a local generator appropriate to this Global Generator
44 cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator()
46 cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
47 lg->SetVersion9();
48 lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
49 lg->SetGlobalGenerator(this);
50 return lg;
53 //----------------------------------------------------------------------------
54 void cmGlobalVisualStudio9Generator
55 ::GetDocumentation(cmDocumentationEntry& entry) const
57 entry.Name = this->GetName();
58 entry.Brief = "Generates Visual Studio 9 2008 project files.";
59 entry.Full = "";
62 //----------------------------------------------------------------------------
63 void cmGlobalVisualStudio9Generator
64 ::EnableLanguage(std::vector<std::string>const & lang,
65 cmMakefile *mf, bool optional)
67 cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional);
70 //----------------------------------------------------------------------------
71 std::string cmGlobalVisualStudio9Generator::GetUserMacrosDirectory()
73 std::string base;
74 std::string path;
76 // base begins with the VisualStudioProjectsLocation reg value...
77 if (cmSystemTools::ReadRegistryValue(
78 "HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\9.0;"
79 "VisualStudioProjectsLocation",
80 base))
82 cmSystemTools::ConvertToUnixSlashes(base);
84 // 9.0 macros folder:
85 path = base + "/VSMacros80";
86 // *NOT* a typo; right now in Visual Studio 2008 beta the macros
87 // folder is VSMacros80... They may change it to 90 before final
88 // release of 2008 or they may not... we'll have to keep our eyes
89 // on it
92 // path is (correctly) still empty if we did not read the base value from
93 // the Registry value
94 return path;
97 //----------------------------------------------------------------------------
98 std::string cmGlobalVisualStudio9Generator::GetUserMacrosRegKeyBase()
100 return "Software\\Microsoft\\VisualStudio\\9.0\\vsmacros";