diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-07-05 12:16:33 -0400 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-07-05 12:16:33 -0400 |
commit | 86195caf6ad23d6528748ad3879394b8709513c5 (patch) | |
tree | 2c48ed3825c1ad64ce0805d43a7cf2fb5e4b81e0 /Source | |
parent | bbc9e4a9dcbe293a5054cf8296fa4fce7e9cea35 (diff) | |
download | cmake-86195caf6ad23d6528748ad3879394b8709513c5.tar.gz |
ENH: add support for VCExpress 2005
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Source/MFCDialog/CMakeSetupDialog.cpp | 22 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 13 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 54 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.h | 48 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 15 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.h | 5 | ||||
-rw-r--r-- | Source/cmake.cxx | 3 |
8 files changed, 151 insertions, 12 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 96422c6289..4f59aed953 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -79,8 +79,11 @@ IF (WIN32) ) IF(NOT MINGW) SET(SRCS ${SRCS} + cmGlobalVisualStudio71Generator.h + cmGlobalVisualStudio8Generator.h cmGlobalVisualStudio7Generator.h cmLocalVisualStudio7Generator.h + cmGlobalVisualStudio8Generator.cxx cmGlobalVisualStudio71Generator.cxx cmGlobalVisualStudio7Generator.cxx cmLocalVisualStudio7Generator.cxx) diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp index e3c00e8d24..c8b8612ce1 100644 --- a/Source/MFCDialog/CMakeSetupDialog.cpp +++ b/Source/MFCDialog/CMakeSetupDialog.cpp @@ -322,26 +322,36 @@ BOOL CMakeSetupDialog::OnInitDialog() { // check for vs7 in registry then decide what default to use std::string mp; - mp = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1;InstallDir]"; + mp = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup;Dbghelp_path"; cmSystemTools::ExpandRegistryValues(mp); - if (mp != "/registry") + if(mp != "/registry") { - m_GeneratorChoiceString = "Visual Studio 7 .NET 2003"; + m_GeneratorChoiceString = "Visual Studio 8 2005"; } else { - mp = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.0;InstallDir]"; + mp = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1;InstallDir]"; cmSystemTools::ExpandRegistryValues(mp); if (mp != "/registry") { - m_GeneratorChoiceString = "Visual Studio 7"; + m_GeneratorChoiceString = "Visual Studio 7 .NET 2003"; } else { - m_GeneratorChoiceString = "Visual Studio 6"; + mp = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.0;InstallDir]"; + cmSystemTools::ExpandRegistryValues(mp); + if (mp != "/registry") + { + m_GeneratorChoiceString = "Visual Studio 7"; + } + else + { + m_GeneratorChoiceString = "Visual Studio 6"; + } } } } + // try to load the cmake cache from disk this->LoadCacheFromDiskToGUI(); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 14c78e8162..907e111035 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -74,9 +74,22 @@ void cmGlobalGenerator::EnableLanguage(const char* lang, return; } std::string makeProgram = mf->GetDefinition("CMAKE_MAKE_PROGRAM"); + // if there are spaces in the make program use short path + // but do not short path the actual program name, as + // this can cause trouble with VSExpress if(makeProgram.find(' ') != makeProgram.npos) { + std::string dir; + std::string file; + cmSystemTools::SplitProgramPath(makeProgram.c_str(), + dir, file); + std::string saveFile = file; cmSystemTools::GetShortPath(makeProgram.c_str(), makeProgram); + cmSystemTools::SplitProgramPath(makeProgram.c_str(), + dir, file); + makeProgram = dir; + makeProgram += "/"; + makeProgram += saveFile; this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", makeProgram.c_str(), "make program", cmCacheManager::FILEPATH); diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx new file mode 100644 index 0000000000..4f20eb077b --- /dev/null +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -0,0 +1,54 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#include "windows.h" // this must be first to define GetCurrentDirectory +#include "cmGlobalVisualStudio8Generator.h" +#include "cmLocalVisualStudio7Generator.h" +#include "cmMakefile.h" +#include "cmake.h" + + + +cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator() +{ + m_FindMakeProgramFile = "CMakeVS8FindMake.cmake"; +} + + + +///! Create a local generator appropriate to this Global Generator +cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator() +{ + cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; + lg->SetVersion8(); + lg->SetGlobalGenerator(this); + return lg; +} + + +// ouput standard header for dsw file +void cmGlobalVisualStudio8Generator::WriteSLNHeader(std::ostream& fout) +{ + fout << "Microsoft Visual Studio Solution File, Format Version 9.00\n"; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio8Generator::GetDocumentation(cmDocumentationEntry& entry) const +{ + entry.name = this->GetName(); + entry.brief = "Generates Visual Studio .NET 2005 project files."; + entry.full = ""; +} diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h new file mode 100644 index 0000000000..07a359aa57 --- /dev/null +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -0,0 +1,48 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmGlobalVisualStudio8Generator_h +#define cmGlobalVisualStudio8Generator_h + +#include "cmGlobalVisualStudio71Generator.h" + + +/** \class cmGlobalVisualStudio8Generator + * \brief Write a Unix makefiles. + * + * cmGlobalVisualStudio8Generator manages UNIX build process for a tree + */ +class cmGlobalVisualStudio8Generator : public cmGlobalVisualStudio71Generator +{ +public: + cmGlobalVisualStudio8Generator(); + static cmGlobalGenerator* New() { return new cmGlobalVisualStudio8Generator; } + + ///! Get the name for the generator. + virtual const char* GetName() const { + return cmGlobalVisualStudio8Generator::GetActualName();} + static const char* GetActualName() {return "Visual Studio 8 2005";} + + /** Get the documentation entry for this generator. */ + virtual void GetDocumentation(cmDocumentationEntry& entry) const; + + ///! Create a local generator appropriate to this Global Generator + virtual cmLocalGenerator *CreateLocalGenerator(); + +protected: + virtual void WriteSLNHeader(std::ostream& fout); +}; +#endif diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 3ab48d38ba..f62e228992 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -24,7 +24,7 @@ cmLocalVisualStudio7Generator::cmLocalVisualStudio7Generator() { - m_Version71 = false; + m_Version = 7; } cmLocalVisualStudio7Generator::~cmLocalVisualStudio7Generator() @@ -1172,13 +1172,20 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout, fout << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n" << "<VisualStudioProject\n" << "\tProjectType=\"Visual C++\"\n"; - if(m_Version71) + if(m_Version == 71) { fout << "\tVersion=\"7.10\"\n"; } - else + else { - fout << "\tVersion=\"7.00\"\n"; + if (m_Version == 8) + { + fout << "\tVersion=\"8.0\"\n"; + } + else + { + fout << "\tVersion=\"7.00\"\n"; + } } fout << "\tName=\"" << libName << "\"\n" diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index 3ac9a8fa8e..275bbd76d8 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -63,7 +63,8 @@ public: { return m_CreatedProjectNames; } - void SetVersion71() {m_Version71 = true;} + void SetVersion71() {m_Version = 71;} + void SetVersion8() {m_Version = 8;} virtual void ConfigureFinalPass(); private: void OutputVCProjFile(); @@ -118,7 +119,7 @@ private: std::string m_LibraryOutputPath; std::string m_ExecutableOutputPath; std::string m_ModuleDefinitionFile; - bool m_Version71; + int m_Version; }; #endif diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e262fe4361..e13c8720c1 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -29,6 +29,7 @@ #if !defined(__MINGW32__) #include "cmGlobalVisualStudio7Generator.h" #include "cmGlobalVisualStudio71Generator.h" +#include "cmGlobalVisualStudio8Generator.h" #endif #include "cmGlobalBorlandMakefileGenerator.h" #include "cmGlobalNMakeMakefileGenerator.h" @@ -1348,6 +1349,8 @@ void cmake::AddDefaultGenerators() &cmGlobalVisualStudio7Generator::New; m_Generators[cmGlobalVisualStudio71Generator::GetActualName()] = &cmGlobalVisualStudio71Generator::New; + m_Generators[cmGlobalVisualStudio8Generator::GetActualName()] = + &cmGlobalVisualStudio8Generator::New; #endif m_Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = &cmGlobalBorlandMakefileGenerator::New; |