ENH: add support for vs 2008 beta 2

This commit is contained in:
Bill Hoffman 2007-09-17 15:21:47 -04:00
parent 1d81cf994a
commit 9cbb998737
13 changed files with 167 additions and 23 deletions

View File

@ -13,3 +13,4 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
) )
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC80 1) SET(MSVC80 1)
SET(MSVC_VERSION 1400)

View File

@ -0,0 +1,16 @@
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
NAMES VCExpress devenv
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup;Dbghelp_path]
"$ENV{ProgramFiles}/Microsoft Visual Studio .NET/Common7/IDE"
"$ENV{ProgramFiles}/Microsoft Visual Studio 9/Common7/IDE"
"$ENV{ProgramFiles}/Microsoft Visual Studio9/Common7/IDE"
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio .NET/Common7/IDE"
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 9/Common7/IDE"
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio9/Common7/IDE"
"/Program Files/Microsoft Visual Studio 9/Common7/IDE/"
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC90 1)
SET(MSVC_VERSION 1500)

View File

@ -13,16 +13,20 @@ SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
IF(CMAKE_GENERATOR MATCHES "Visual Studio 6") IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
SET (CMAKE_NO_BUILD_TYPE 1) SET (CMAKE_NO_BUILD_TYPE 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6") ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") IF(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
SET (CMAKE_NO_BUILD_TYPE 1) SET (CMAKE_NO_BUILD_TYPE 1)
SET (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING 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.") "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
MARK_AS_ADVANCED(CMAKE_CONFIGURATION_TYPES) MARK_AS_ADVANCED(CMAKE_CONFIGURATION_TYPES)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") ENDIF(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
# does the compiler support pdbtype and is it the newer compiler # does the compiler support pdbtype and is it the newer compiler
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8") IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
SET(CMAKE_COMPILER_2005 1) SET(CMAKE_COMPILER_2005 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8") ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
IF(CMAKE_GENERATOR MATCHES "Visual Studio 9")
SET(CMAKE_COMPILER_2005 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 9")
# make sure to enable languages after setting configuration types # make sure to enable languages after setting configuration types
ENABLE_LANGUAGE(RC) ENABLE_LANGUAGE(RC)
@ -87,6 +91,14 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles")
SET(MSVC80 1) SET(MSVC80 1)
SET(CMAKE_COMPILER_2005 1) SET(CMAKE_COMPILER_2005 1)
ENDIF("${compilerVersion}" GREATER 1400) ENDIF("${compilerVersion}" GREATER 1400)
IF("${compilerVersion}" GREATER 1400)
SET(MSVC80 1)
SET(CMAKE_COMPILER_2005 1)
ENDIF("${compilerVersion}" GREATER 1400)
IF("${compilerVersion}" GREATER 1500)
SET(MSVC90 1)
SET(MSVC80 0)
ENDIF("${compilerVersion}" GREATER 1500)
SET(MSVC_VERSION "${compilerVersion}") SET(MSVC_VERSION "${compilerVersion}")
ELSE(NOT CMAKE_COMPILER_RETURN) ELSE(NOT CMAKE_COMPILER_RETURN)
MESSAGE(STATUS "Check for CL compiler version - failed") MESSAGE(STATUS "Check for CL compiler version - failed")
@ -154,7 +166,7 @@ ENDIF(CMAKE_FORCE_WIN64)
# default to Debug builds # default to Debug builds
IF(MSVC80) IF(MSVC_VERSION GREATER 1310)
# Not used by generator directly but referenced below. # Not used by generator directly but referenced below.
SET(CMAKE_CREATE_LIB_MANIFEST SET(CMAKE_CREATE_LIB_MANIFEST
"$(CMAKE_COMMAND) -DTARGET=<TARGET> -DCMAKE_CL_NOLOGO=${CMAKE_CL_NOLOGO} -P \"${CMAKE_ROOT}/Modules/CMakeVCManifest.cmake\"") "$(CMAKE_COMMAND) -DTARGET=<TARGET> -DCMAKE_CL_NOLOGO=${CMAKE_CL_NOLOGO} -P \"${CMAKE_ROOT}/Modules/CMakeVCManifest.cmake\"")
@ -188,7 +200,7 @@ IF(MSVC80)
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG") SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ") SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ")
SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST") SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST")
ELSE(MSVC80) ELSE(MSVC_VERSION GREATER 1310)
IF(CMAKE_USING_VC_FREE_TOOLS) IF(CMAKE_USING_VC_FREE_TOOLS)
MESSAGE(STATUS "Using FREE VC TOOLS, NO DEBUG available") MESSAGE(STATUS "Using FREE VC TOOLS, NO DEBUG available")
SET(CMAKE_BUILD_TYPE_INIT Release) SET(CMAKE_BUILD_TYPE_INIT Release)
@ -217,7 +229,7 @@ ELSE(MSVC80)
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG") SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib") SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib")
ENDIF(CMAKE_USING_VC_FREE_TOOLS) ENDIF(CMAKE_USING_VC_FREE_TOOLS)
ENDIF(MSVC80) ENDIF(MSVC_VERSION GREATER 1310)
SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")

View File

@ -213,6 +213,8 @@ IF (WIN32)
cmGlobalVisualStudio7Generator.h cmGlobalVisualStudio7Generator.h
cmGlobalVisualStudio8Generator.cxx cmGlobalVisualStudio8Generator.cxx
cmGlobalVisualStudio8Generator.h cmGlobalVisualStudio8Generator.h
cmGlobalVisualStudio9Generator.cxx
cmGlobalVisualStudio9Generator.h
cmGlobalVisualStudio8Win64Generator.cxx cmGlobalVisualStudio8Win64Generator.cxx
cmGlobalVisualStudio8Win64Generator.h cmGlobalVisualStudio8Win64Generator.h
cmGlobalVisualStudioGenerator.cxx cmGlobalVisualStudioGenerator.cxx

View File

@ -21,7 +21,8 @@
#if !defined(AFX_STDAFX_H__AC17A6F8_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_) #if !defined(AFX_STDAFX_H__AC17A6F8_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_)
#define AFX_STDAFX_H__AC17A6F8_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_ #define AFX_STDAFX_H__AC17A6F8_4634_11D4_8F21_00A0CC33FCD3__INCLUDED_
#define WINVER 0x0400 #define _WIN32_WINNT 0x0400
#define _WIN32_IE 0x0400
#if _MSC_VER > 1000 #if _MSC_VER > 1000
#pragma once #pragma once

View File

@ -0,0 +1,61 @@
/*=========================================================================
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 "cmGlobalVisualStudio9Generator.h"
#include "cmLocalVisualStudio7Generator.h"
#include "cmMakefile.h"
#include "cmake.h"
cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator()
{
this->FindMakeProgramFile = "CMakeVS9FindMake.cmake";
}
void cmGlobalVisualStudio9Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n";
fout << "# Visual Studio 2008\n";
}
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion9();
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;
}
//----------------------------------------------------------------------------
void cmGlobalVisualStudio9Generator
::GetDocumentation(cmDocumentationEntry& entry) const
{
entry.name = this->GetName();
entry.brief = "Generates Visual Studio 9 2008 project files.";
entry.full = "";
}
void cmGlobalVisualStudio9Generator
::EnableLanguage(std::vector<std::string>const & lang,
cmMakefile *mf, bool optional)
{
cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional);
}

View File

@ -0,0 +1,55 @@
/*=========================================================================
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 cmGlobalVisualStudio9Generator_h
#define cmGlobalVisualStudio9Generator_h
#include "cmGlobalVisualStudio8Generator.h"
/** \class cmGlobalVisualStudio9Generator
* \brief Write a Unix makefiles.
*
* cmGlobalVisualStudio9Generator manages UNIX build process for a tree
*/
class cmGlobalVisualStudio9Generator :
public cmGlobalVisualStudio8Generator
{
public:
cmGlobalVisualStudio9Generator();
static cmGlobalGenerator* New() {
return new cmGlobalVisualStudio9Generator; }
///! Get the name for the generator.
virtual const char* GetName() const {
return cmGlobalVisualStudio9Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 9 2008";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
///! create the correct local generator
virtual cmLocalGenerator *CreateLocalGenerator();
/**
* Try to determine system infomation such as shared library
* extension, pthreads, byte order etc.
*/
virtual void EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *, bool optional);
virtual void WriteSLNHeader(std::ostream& fout);
};
#endif

View File

@ -609,7 +609,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
// manifest tool to use a workaround for FAT32 file systems, which can cause // manifest tool to use a workaround for FAT32 file systems, which can cause
// an empty manifest to be embedded into the resulting executable. // an empty manifest to be embedded into the resulting executable.
// See CMake bug #2617. // See CMake bug #2617.
if ( this->Version == 8 ) if ( this->Version > 8 )
{ {
fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n" fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n"
<< "\t\t\t\tUseFAT32Workaround=\"true\"\n" << "\t\t\t\tUseFAT32Workaround=\"true\"\n"
@ -1434,14 +1434,7 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
} }
else else
{ {
if (this->Version == 8) fout << "\tVersion=\"" << this->Version << ".00\"\n";
{
fout << "\tVersion=\"8.00\"\n";
}
else
{
fout << "\tVersion=\"7.00\"\n";
}
} }
const char* projLabel = target.GetProperty("PROJECT_LABEL"); const char* projLabel = target.GetProperty("PROJECT_LABEL");
if(!projLabel) if(!projLabel)
@ -1456,7 +1449,7 @@ cmLocalVisualStudio7Generator::WriteProjectStart(std::ostream& fout,
cmGlobalVisualStudio7Generator* gg = cmGlobalVisualStudio7Generator* gg =
static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator); static_cast<cmGlobalVisualStudio7Generator *>(this->GlobalGenerator);
fout << "\tName=\"" << projLabel << "\"\n"; fout << "\tName=\"" << projLabel << "\"\n";
if(this->Version == 8) if(this->Version > 8)
{ {
fout << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\"\n"; fout << "\tProjectGUID=\"{" << gg->GetGUID(libName) << "}\"\n";
} }

View File

@ -57,6 +57,7 @@ public:
void SetVersion71() {this->Version = 71;} void SetVersion71() {this->Version = 71;}
void SetVersion8() {this->Version = 8;} void SetVersion8() {this->Version = 8;}
void SetVersion9() {this->Version = 9;}
void SetPlatformName(const char* n) { this->PlatformName = n;} void SetPlatformName(const char* n) { this->PlatformName = n;}
virtual void ConfigureFinalPass(); virtual void ConfigureFinalPass();
void GetTargetObjectFileDirectories(cmTarget* target, void GetTargetObjectFileDirectories(cmTarget* target,

View File

@ -62,6 +62,7 @@
# include "cmGlobalVisualStudio7Generator.h" # include "cmGlobalVisualStudio7Generator.h"
# include "cmGlobalVisualStudio71Generator.h" # include "cmGlobalVisualStudio71Generator.h"
# include "cmGlobalVisualStudio8Generator.h" # include "cmGlobalVisualStudio8Generator.h"
# include "cmGlobalVisualStudio9Generator.h"
# include "cmGlobalVisualStudio8Win64Generator.h" # include "cmGlobalVisualStudio8Win64Generator.h"
# include "cmGlobalBorlandMakefileGenerator.h" # include "cmGlobalBorlandMakefileGenerator.h"
# include "cmGlobalNMakeMakefileGenerator.h" # include "cmGlobalNMakeMakefileGenerator.h"
@ -2153,6 +2154,8 @@ void cmake::AddDefaultGenerators()
&cmGlobalVisualStudio71Generator::New; &cmGlobalVisualStudio71Generator::New;
this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] = this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] =
&cmGlobalVisualStudio8Generator::New; &cmGlobalVisualStudio8Generator::New;
this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] =
&cmGlobalVisualStudio9Generator::New;
this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] = this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] =
&cmGlobalVisualStudio8Win64Generator::New; &cmGlobalVisualStudio8Win64Generator::New;
this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] = this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] =

View File

@ -306,9 +306,12 @@ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);
} }
#endif #endif
#ifdef HAVE_SOCKLEN_T #ifdef HAVE_SOCKLEN_T
#ifdef _WIN32
#include <ws2tcpip.h>
#else
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#endif
int int
main () main ()
{ {

View File

@ -106,7 +106,6 @@ IF(NOT UNIX)
SET(TIME_WITH_SYS_TIME 0) SET(TIME_WITH_SYS_TIME 0)
SET(HAVE_O_NONBLOCK 0) SET(HAVE_O_NONBLOCK 0)
SET(HAVE_IN_ADDR_T 0) SET(HAVE_IN_ADDR_T 0)
SET(HAVE_SOCKLEN_T 0)
SET(HAVE_INET_NTOA_R_DECL 0) SET(HAVE_INET_NTOA_R_DECL 0)
SET(HAVE_INET_NTOA_R_DECL_REENTRANT 0) SET(HAVE_INET_NTOA_R_DECL_REENTRANT 0)
SET(HAVE_GETADDRINFO 0) SET(HAVE_GETADDRINFO 0)

View File

@ -25,12 +25,8 @@
#ifdef HAVE_SYS_POLL_H #ifdef HAVE_SYS_POLL_H
#include <sys/poll.h> #include <sys/poll.h>
#elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0600)
/* for Vista, use WSAPoll(). */
#include <winsock2.h>
#define CURL_HAVE_WSAPOLL
#else #else
#ifndef POLLIN
#define POLLIN 0x01 #define POLLIN 0x01
#define POLLPRI 0x02 #define POLLPRI 0x02
#define POLLOUT 0x04 #define POLLOUT 0x04
@ -44,6 +40,7 @@ struct pollfd
short events; short events;
short revents; short revents;
}; };
#endif
#endif #endif