summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeVS8FindMake.cmake10
-rw-r--r--Modules/Platform/Windows-cl.cmake68
-rw-r--r--Source/CMakeLists.txt3
-rw-r--r--Source/MFCDialog/CMakeSetupDialog.cpp22
-rw-r--r--Source/cmGlobalGenerator.cxx13
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx54
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h48
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx15
-rw-r--r--Source/cmLocalVisualStudio7Generator.h5
-rw-r--r--Source/cmake.cxx3
10 files changed, 207 insertions, 34 deletions
diff --git a/Modules/CMakeVS8FindMake.cmake b/Modules/CMakeVS8FindMake.cmake
new file mode 100644
index 0000000..ec3a3ca
--- /dev/null
+++ b/Modules/CMakeVS8FindMake.cmake
@@ -0,0 +1,10 @@
+FIND_PROGRAM(CMAKE_MAKE_PROGRAM
+ NAMES VCExpress
+ PATHS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup;Dbghelp_path]
+ "c:/Program Files/Microsoft Visual Studio 8/Common7/IDE"
+ "c:/Program Files/Microsoft Visual Studio8/Common7/IDE"
+ "/Program Files/Microsoft Visual Studio 8/Common7/IDE/"
+ )
+MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index d047aba..c8ee0fa 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -40,28 +40,10 @@ SET(CMAKE_CXX_LINK_EXECUTABLE
SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
-# default to Debug builds
-SET(CMAKE_BUILD_TYPE_INIT Debug)
-SET (CMAKE_CXX_FLAGS_INIT "/W3 /Zm1000 /GX /GR")
-SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/MDd /Zi /Od /GZ")
-SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /D NDEBUG")
-SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /D NDEBUG")
-SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /D NDEBUG")
-SET (CMAKE_C_FLAGS_INIT "/W3 /Zm1000")
-SET (CMAKE_C_FLAGS_DEBUG_INIT "/MDd /Zi /Od /GZ")
-SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /D NDEBUG")
-SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /D NDEBUG")
-SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /D NDEBUG")
-
-
-SET (CMAKE_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib" CACHE STRING
- "Libraries linked by defalut with all applications.")
-MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES)
-
IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
SET (CMAKE_NO_BUILD_TYPE 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
-IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
+IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
SET (CMAKE_NO_BUILD_TYPE 1)
SET (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
"Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
@@ -70,10 +52,13 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
SET (CMAKE_CXX_STACK_SIZE "10000000" CACHE STRING
"Size of stack for programs.")
MARK_AS_ADVANCED(CMAKE_CONFIGURATION_TYPES CMAKE_CXX_STACK_SIZE CMAKE_CXX_WARNING_LEVEL)
-ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
-
-# does the compiler support pdbtype
+ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8")
+# does the compiler support pdbtype and is it the newer compiler
SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
+SET(CMAKE_COMPILER_2005 0)
+IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
+ SET(CMAKE_COMPILER_2005 1)
+ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
IF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
EXEC_PROGRAM(${CMAKE_C_COMPILER}
ARGS /nologo -EP \"${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c\"
@@ -84,10 +69,49 @@ IF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[3-9][0-9][0-9].*" )
SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[3-9][0-9][0-9].*" )
+ IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[4-9][0-9][0-9].*" )
+ SET(CMAKE_COMPILER_2005 1)
+ ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[4-9][0-9][0-9].*" )
ENDIF(NOT CMAKE_COMPILER_RETURN)
ENDIF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
+# default to Debug builds
+IF(CMAKE_COMPILER_2005)
+ SET(CMAKE_BUILD_TYPE_INIT Debug)
+ SET (CMAKE_CXX_FLAGS_INIT "/W3 /Zm1000 /EHsc /GR")
+ SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/MDd /Zi /Od /RTC1")
+ SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /D NDEBUG")
+ SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /D NDEBUG")
+ SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /D NDEBUG")
+ SET (CMAKE_C_FLAGS_INIT "/W3 /Zm1000")
+ SET (CMAKE_C_FLAGS_DEBUG_INIT "/MDd /Zi /Od /GZ")
+ SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /D NDEBUG")
+ SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /D NDEBUG")
+ SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /D NDEBUG")
+ SET (CMAKE_STANDARD_LIBRARIES "kernel32.lib" CACHE STRING
+ "Libraries linked by defalut with all applications.")
+ELSE(CMAKE_COMPILER_2005)
+ SET(CMAKE_BUILD_TYPE_INIT Debug)
+ SET (CMAKE_CXX_FLAGS_INIT "/W3 /Zm1000 /GX /GR")
+ SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/MDd /Zi /Od /GZ")
+ SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /D NDEBUG")
+ SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /D NDEBUG")
+ SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /D NDEBUG")
+ SET (CMAKE_C_FLAGS_INIT "/W3 /Zm1000")
+ SET (CMAKE_C_FLAGS_DEBUG_INIT "/MDd /Zi /Od /GZ")
+ SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /D NDEBUG")
+ SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /D NDEBUG")
+ SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /D NDEBUG")
+ SET (CMAKE_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib" CACHE STRING
+ "Libraries linked by defalut with all applications.")
+ENDIF(CMAKE_COMPILER_2005)
+
+
+MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES)
+
+
+
# executable linker flags
SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:I386 /INCREMENTAL:YES")
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 96422c6..4f59aed 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 e3c00e8..c8b8612 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 14c78e8..907e111 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 0000000..4f20eb0
--- /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 0000000..07a359a
--- /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 3ab48d3..f62e228 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 3ac9a8f..275bbd7 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 e262fe4..e13c872 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;