[Cmake-commits] CMake branch, next, updated. v2.8.9-281-g7cf38c8

Brad King brad.king at kitware.com
Fri Aug 24 15:02:07 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  7cf38c892120874285383f1f58ac6b3e0d3fd5fb (commit)
       via  851f14fe5751bfde234e66d658f619bddd31ba35 (commit)
       via  2b06daba3844845a71f26dcdd46e7d634d76a888 (commit)
       via  2eef09805f55e1ad6e98e78c950e5da4c52f6c10 (commit)
       via  ee89573b1a0abf5c8c3daf59c8a3fe18f5df6dbf (commit)
       via  32db033b2713d40899865a06f03d83373078eaa3 (commit)
      from  f84d7b95ebcfa32c02f8b9651b3729be2e936c77 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7cf38c892120874285383f1f58ac6b3e0d3fd5fb
commit 7cf38c892120874285383f1f58ac6b3e0d3fd5fb
Merge: f84d7b9 851f14f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Aug 24 15:02:04 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Aug 24 15:02:04 2012 -0400

    Merge topic 'resolve/msvc-compiler-info/vs-link-rsp' into next
    
    851f14f Merge branch 'vs-link-rsp' into msvc-compiler-info
    2b06dab Merge branch 'cmake-platform-info-version' into msvc-compiler-info
    2eef098 Modernize MSVC compiler information files
    ee89573 VS: Simplify MSVC version reporting
    32db033 VS: Remove support for "free" version 2003 tools


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=851f14fe5751bfde234e66d658f619bddd31ba35
commit 851f14fe5751bfde234e66d658f619bddd31ba35
Merge: 2b06dab f50f3cb
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Aug 24 15:00:03 2012 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Aug 24 15:00:03 2012 -0400

    Merge branch 'vs-link-rsp' into msvc-compiler-info
    
    Conflicts:
    	Modules/Platform/Windows-cl.cmake

diff --cc Modules/Platform/Windows-MSVC.cmake
index ac31dd6,0000000..d7b5bf6
mode 100644,000000..100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@@ -1,204 -1,0 +1,207 @@@
 +
 +#=============================================================================
 +# Copyright 2001-2012 Kitware, Inc.
 +#
 +# Distributed under the OSI-approved BSD License (the "License");
 +# see accompanying file Copyright.txt for details.
 +#
 +# This software is distributed WITHOUT ANY WARRANTY; without even the
 +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 +# See the License for more information.
 +#=============================================================================
 +# (To distribute this file outside of CMake, substitute the full
 +#  License text for the above reference.)
 +
 +# This module is shared by multiple languages; use include blocker.
 +if(__WINDOWS_MSVC)
 +  return()
 +endif()
 +set(__WINDOWS_MSVC 1)
 +
 +set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
 +set(CMAKE_LINK_LIBRARY_FLAG "")
 +set(MSVC 1)
 +
 +# hack: if a new cmake (which uses CMAKE__LINKER) runs on an old build tree
 +# (where link was hardcoded) and where CMAKE_LINKER isn't in the cache
 +# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
 +# hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex
 +if(NOT DEFINED CMAKE_LINKER)
 +   set(CMAKE_LINKER link)
 +endif()
 +
 +if(CMAKE_VERBOSE_MAKEFILE)
 +  set(CMAKE_CL_NOLOGO)
 +else()
 +  set(CMAKE_CL_NOLOGO "/nologo")
 +endif()
 +
 +set(WIN32 1)
 +
 +set(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
 +set(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
 +
 +if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
 +   set (CMAKE_NO_BUILD_TYPE 1)
 +endif()
 +if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
 +  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.")
 +  mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
 +endif()
 +
 +# make sure to enable languages after setting configuration types
 +enable_language(RC)
 +set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
 +
 +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
 +  set(MSVC_IDE 0)
 +else()
 +  set(MSVC_IDE 1)
 +endif()
 +
 +if(NOT MSVC_VERSION)
 +  if(CMAKE_C_COMPILER_VERSION)
 +    set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
 +  else()
 +    set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
 +  endif()
 +  if("${_compiler_version}" MATCHES "^([0-9]+)\\.([0-9]+)")
 +    set(MSVC_VERSION "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
 +  else()
 +    message(FATAL_ERROR "MSVC compiler version not detected properly: ${_compiler_version}")
 +  endif()
 +
 +  set(MSVC10)
 +  set(MSVC11)
 +  set(MSVC60)
 +  set(MSVC70)
 +  set(MSVC71)
 +  set(MSVC80)
 +  set(MSVC90)
 +  set(CMAKE_COMPILER_2005)
 +  set(CMAKE_COMPILER_SUPPORTS_PDBTYPE)
 +  if(NOT "${_compiler_version}" VERSION_LESS 17)
 +    set(MSVC11 1)
 +  elseif(NOT  "${_compiler_version}" VERSION_LESS 16)
 +    set(MSVC10 1)
 +  elseif(NOT  "${_compiler_version}" VERSION_LESS 15)
 +    set(MSVC90 1)
 +  elseif(NOT  "${_compiler_version}" VERSION_LESS 14)
 +    set(MSVC80 1)
 +    set(CMAKE_COMPILER_2005 1)
 +  elseif(NOT  "${_compiler_version}" VERSION_LESS 13.10)
 +    set(MSVC71 1)
 +  elseif(NOT  "${_compiler_version}" VERSION_LESS 13)
 +    set(MSVC70 1)
 +  else()
 +    set(MSVC60 1)
 +    set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
 +  endif()
 +endif()
 +
 +if(MSVC_C_ARCHITECTURE_ID MATCHES 64)
 +  set(CMAKE_CL_64 1)
 +else()
 +  set(CMAKE_CL_64 0)
 +endif()
 +if(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
 +  set(CMAKE_CL_64 1)
 +endif()
 +
 +if("${MSVC_VERSION}" GREATER 1599)
 +  set(MSVC_INCREMENTAL_DEFAULT ON)
 +endif()
 +
 +# default to Debug builds
 +set(CMAKE_BUILD_TYPE_INIT Debug)
 +
 +if(MSVC_VERSION GREATER 1310)
 +  set(_RTC1 "/RTC1")
 +  set(_FLAGS_CXX " /GR /EHsc")
 +  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")
 +else()
 +  set(_RTC1 "/GZ")
 +  set(_FLAGS_CXX " /GR /GX")
 +  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()
 +
 +set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
 +
 +# executable linker flags
 +set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
 +# set the stack size and the machine type
 +set(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID})
 +if(NOT _MACHINE_ARCH_FLAG)
 +  set(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID})
 +endif()
 +set (CMAKE_EXE_LINKER_FLAGS_INIT
 +    "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:${_MACHINE_ARCH_FLAG}")
 +
 +# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype
 +# on versions that support it
 +set( MSVC_INCREMENTAL_YES_FLAG "")
 +if(NOT MSVC_INCREMENTAL_DEFAULT)
 +  set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
 +else()
 +  set(  MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL" )
 +endif()
 +
 +if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
 +  set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
 +  set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
 +else ()
 +  set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
 +  set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
 +endif ()
 +# for release and minsize release default to no incremental linking
 +set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO")
 +set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO")
 +
 +# copy the EXE_LINKER flags to SHARED and MODULE linker flags
 +# shared linker flags
 +set (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
 +set (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
 +set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
 +set (CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
 +set (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
 +# module linker flags
 +set (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
 +set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
 +set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
 +set (CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
 +set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
 +
 +macro(__windows_compiler_msvc lang)
 +  if(NOT "${CMAKE_${lang}_COMPILER_VERSION}" VERSION_LESS 14)
 +    # for 2005 make sure the manifest is put in the dll with mt
-     set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll ")
-     set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe ")
++    if(CMAKE_GENERATOR MATCHES "Ninja")
++      set(NO_RSP_EXPAND _no_rsp_expand)
++    endif()
++    set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll${NO_RSP_EXPAND} ")
++    set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe${NO_RSP_EXPAND} ")
 +  endif()
 +  set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
 +    "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
 +
 +  set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
 +  set(CMAKE_${lang}_CREATE_STATIC_LIBRARY  "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
 +
 +  set(CMAKE_${lang}_COMPILE_OBJECT
 +    "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
 +  set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
 +    "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
 +  set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
 +    "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
 +
 +  set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
 +  set(CMAKE_${lang}_LINK_EXECUTABLE
 +    "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> -link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
 +
 +  set(CMAKE_${lang}_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}")
 +  set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}")
 +  set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
 +  set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
 +  set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
 +endmacro()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2b06daba3844845a71f26dcdd46e7d634d76a888
commit 2b06daba3844845a71f26dcdd46e7d634d76a888
Merge: 2eef098 3df81b4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Aug 24 10:03:44 2012 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Aug 24 14:57:36 2012 -0400

    Merge branch 'cmake-platform-info-version' into msvc-compiler-info
    
    Conflicts:
    	Modules/CMakeTestCCompiler.cmake
    	Modules/CMakeTestCXXCompiler.cmake
    	Modules/Platform/Windows-cl.cmake


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2eef09805f55e1ad6e98e78c950e5da4c52f6c10
commit 2eef09805f55e1ad6e98e78c950e5da4c52f6c10
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Aug 23 12:00:55 2012 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Aug 24 14:55:35 2012 -0400

    Modernize MSVC compiler information files
    
    Remove the old-style "Windows-cl.cmake" and its helper "cl.cmake".  Load
    the information through new-style "Platform/Windows-MSVC-<lang>.cmake"
    files.  Factor information common to C and CXX into a helper file
    "Platform/Windows-MSVC.cmake" loaded from the per-language files.

diff --git a/Modules/Platform/Windows-MSVC-C.cmake b/Modules/Platform/Windows-MSVC-C.cmake
new file mode 100644
index 0000000..e81df9f
--- /dev/null
+++ b/Modules/Platform/Windows-MSVC-C.cmake
@@ -0,0 +1,2 @@
+include(Platform/Windows-MSVC)
+__windows_compiler_msvc(C)
diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake
new file mode 100644
index 0000000..fdd1dae
--- /dev/null
+++ b/Modules/Platform/Windows-MSVC-CXX.cmake
@@ -0,0 +1,3 @@
+include(Platform/Windows-MSVC)
+set(_COMPILE_CXX " /TP")
+__windows_compiler_msvc(CXX)
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-MSVC.cmake
similarity index 53%
rename from Modules/Platform/Windows-cl.cmake
rename to Modules/Platform/Windows-MSVC.cmake
index 92fc9c8..ac31dd6 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -1,6 +1,42 @@
-set(WIN32 1)
 
-include(Platform/cl)
+#=============================================================================
+# Copyright 2001-2012 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+# This module is shared by multiple languages; use include blocker.
+if(__WINDOWS_MSVC)
+  return()
+endif()
+set(__WINDOWS_MSVC 1)
+
+set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
+set(CMAKE_LINK_LIBRARY_FLAG "")
+set(MSVC 1)
+
+# hack: if a new cmake (which uses CMAKE__LINKER) runs on an old build tree
+# (where link was hardcoded) and where CMAKE_LINKER isn't in the cache
+# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
+# hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex
+if(NOT DEFINED CMAKE_LINKER)
+   set(CMAKE_LINKER link)
+endif()
+
+if(CMAKE_VERBOSE_MAKEFILE)
+  set(CMAKE_CL_NOLOGO)
+else()
+  set(CMAKE_CL_NOLOGO "/nologo")
+endif()
+
+set(WIN32 1)
 
 set(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
 set(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
@@ -79,43 +115,16 @@ if("${MSVC_VERSION}" GREATER 1599)
 endif()
 
 # default to Debug builds
+set(CMAKE_BUILD_TYPE_INIT Debug)
+
 if(MSVC_VERSION GREATER 1310)
-  # for 2005 make sure the manifest is put in the dll with mt
-  set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
-  set(CMAKE_CXX_CREATE_SHARED_MODULE "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_MODULE}")
-  # create a C shared library
-  set(CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
-  # create a C shared module just copy the shared library rule
-  set(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}")
-  set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_CXX_LINK_EXECUTABLE}")
-  set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_C_LINK_EXECUTABLE}")
-
-  set(CMAKE_BUILD_TYPE_INIT Debug)
-  set (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")
-  set (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1")
-  set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
-  set (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
-  set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
-  set (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
-  set (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi  /Ob0 /Od /RTC1")
-  set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
-  set (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /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_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT}")
+  set(_RTC1 "/RTC1")
+  set(_FLAGS_CXX " /GR /EHsc")
+  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")
 else()
-  set(CMAKE_BUILD_TYPE_INIT Debug)
-  set (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")
-  set (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi  /Ob0 /Od /GZ")
-  set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
-  set (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
-  set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
-  set (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
-  set (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /GZ")
-  set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
-  set (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /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(_RTC1 "/GZ")
+  set(_FLAGS_CXX " /GR /GX")
+  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()
 
 set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
@@ -163,3 +172,33 @@ set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT
 set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
 set (CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
 set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
+
+macro(__windows_compiler_msvc lang)
+  if(NOT "${CMAKE_${lang}_COMPILER_VERSION}" VERSION_LESS 14)
+    # for 2005 make sure the manifest is put in the dll with mt
+    set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll ")
+    set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe ")
+  endif()
+  set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
+    "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+
+  set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
+  set(CMAKE_${lang}_CREATE_STATIC_LIBRARY  "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+
+  set(CMAKE_${lang}_COMPILE_OBJECT
+    "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
+  set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
+    "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
+  set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
+    "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
+
+  set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+  set(CMAKE_${lang}_LINK_EXECUTABLE
+    "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> -link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+
+  set(CMAKE_${lang}_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}")
+  set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}")
+  set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
+  set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
+  set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+endmacro()
diff --git a/Modules/Platform/cl.cmake b/Modules/Platform/cl.cmake
deleted file mode 100644
index 9e4d607..0000000
--- a/Modules/Platform/cl.cmake
+++ /dev/null
@@ -1,62 +0,0 @@
-set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
-set(CMAKE_LINK_LIBRARY_FLAG "")
-set(MSVC 1)
-
-# hack: if a new cmake (which uses CMAKE__LINKER) runs on an old build tree
-# (where link was hardcoded) and where CMAKE_LINKER isn't in the cache
-# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
-# hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex
-if(NOT DEFINED CMAKE_LINKER)
-   set(CMAKE_LINKER link)
-endif()
-
-if(CMAKE_VERBOSE_MAKEFILE)
-  set(CMAKE_CL_NOLOGO)
-else()
-  set(CMAKE_CL_NOLOGO "/nologo")
-endif()
-# create a shared C++ library
-set(CMAKE_CXX_CREATE_SHARED_LIBRARY
-  "<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
-set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
-
-# create a C shared library
-set(CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
-
-# create a C shared module
-set(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_MODULE}")
-
-# create a C++ static library
-set(CMAKE_CXX_CREATE_STATIC_LIBRARY  "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
-
-# create a C static library
-set(CMAKE_C_CREATE_STATIC_LIBRARY "${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
-
-# compile a C++ file into an object file
-set(CMAKE_CXX_COMPILE_OBJECT
-    "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /TP /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-# compile a C file into an object file
-set(CMAKE_C_COMPILE_OBJECT
-    "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-set(CMAKE_C_LINK_EXECUTABLE
-    "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> -link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
-
-set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
-set(CMAKE_CXX_LINK_EXECUTABLE
-    "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> -link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
-
-set(CMAKE_C_CREATE_PREPROCESSED_SOURCE
-    "<CMAKE_C_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
-    "<CMAKE_CXX_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /TP -E <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-set(CMAKE_C_CREATE_ASSEMBLY_SOURCE
-    "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /FAs /FoNUL /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
-
-set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
-    "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /TP /FAs /FoNUL /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
-

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ee89573b1a0abf5c8c3daf59c8a3fe18f5df6dbf
commit ee89573b1a0abf5c8c3daf59c8a3fe18f5df6dbf
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Aug 23 11:20:48 2012 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Aug 23 11:23:18 2012 -0400

    VS: Simplify MSVC version reporting
    
    Teach Windows-cl.cmake to use CMAKE_(C|CXX)_COMPILER_VERSION to set the
    "MSVC##" and MSVC_VERSION variables.  It no longer needs the IDE generator
    to dictate the version or to detect the version by running the
    command-line tool for NMake and Ninja generators.  Drop configuration of
    CMakeCPlatform.cmake and CMakeCXXPlatform.cmake from Windows-cl.cmake.in
    because all the results it saved are now cheap to compute every time.

diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index 14291a7..c8f4d49 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -44,11 +44,6 @@ if(NOT CMAKE_C_COMPILER_WORKS)
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the C compiler works failed with "
     "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
-  # if the compiler is broken make sure to remove the platform file
-  # since Windows-cl configures both c/cxx files both need to be removed
-  # when c or c++ fails
-  file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
-  file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
   message(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
     "is not able to compile a simple test program.\nIt fails "
     "with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n"
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index 5ed826b..3aa2075 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -34,11 +34,6 @@ endif()
 
 if(NOT CMAKE_CXX_COMPILER_WORKS)
   PrintTestCompilerStatus("CXX" " -- broken")
-  # if the compiler is broken make sure to remove the platform file
-  # since Windows-cl configures both c/cxx files both need to be removed
-  # when c or c++ fails
-  file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
-  file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
   file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
     "Determining if the CXX compiler works failed with "
     "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
diff --git a/Modules/CMakeTestNMakeCLVersion.c b/Modules/CMakeTestNMakeCLVersion.c
deleted file mode 100644
index 3cece2a..0000000
--- a/Modules/CMakeTestNMakeCLVersion.c
+++ /dev/null
@@ -1,2 +0,0 @@
-VERSION=_MSC_VER
-
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index 265f555..92fc9c8 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -1,8 +1,3 @@
-# try to load any previously computed information for C on this platform
-include( ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake OPTIONAL)
-# try to load any previously computed information for CXX on this platform
-include( ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake OPTIONAL)
-
 set(WIN32 1)
 
 include(Platform/cl)
@@ -19,81 +14,54 @@ if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
      "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)
 endif()
-# does the compiler support pdbtype and is it the newer compiler
-if(CMAKE_GENERATOR MATCHES  "Visual Studio 8")
-  set(CMAKE_COMPILER_2005 1)
-endif()
 
 # make sure to enable languages after setting configuration types
 enable_language(RC)
 set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
 
-# for nmake we need to compute some information about the compiler
-# that is being used.
-# to avoid running these tests with each cmake run, the
-# test results are saved in CMakeCPlatform.cmake, a file
-# that is automatically copied into try_compile directories
-# by the global generator.
-set(MSVC_IDE 1)
-if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
+if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
   set(MSVC_IDE 0)
-  if(NOT CMAKE_VC_COMPILER_TESTS_RUN)
-    set(CMAKE_VC_COMPILER_TESTS 1)
-    set(testNmakeCLVersionFile
-      "${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c")
-    string(REGEX REPLACE "/" "\\\\" testNmakeCLVersionFile "${testNmakeCLVersionFile}")
-    message(STATUS "Check for CL compiler version")
-    set(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER})
-    if (NOT CMAKE_C_COMPILER)
-      set(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER})
-    endif()
-    exec_program(${CMAKE_TEST_COMPILER}
-      ARGS /nologo -EP \"${testNmakeCLVersionFile}\"
-      OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
-      RETURN_VALUE CMAKE_COMPILER_RETURN
-      )
-    if(NOT CMAKE_COMPILER_RETURN)
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
-        "Determining the version of compiler passed with the following output:\n"
-        "${CMAKE_COMPILER_OUTPUT}\n\n")
-      string(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}")
-      string(REGEX REPLACE ".*VERSION=(.*)" "\\1"
-        compilerVersion "${compilerVersion}")
-      message(STATUS "Check for CL compiler version - ${compilerVersion}")
-      set(MSVC60)
-      set(MSVC70)
-      set(MSVC71)
-      set(MSVC80)
-      set(CMAKE_COMPILER_2005)
-      if("${compilerVersion}" LESS 1300)
-        set(MSVC60 1)
-        set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
-      endif()
-      if("${compilerVersion}" EQUAL 1300)
-        set(MSVC70 1)
-        set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
-      endif()
-      if("${compilerVersion}" EQUAL 1310)
-        set(MSVC71 1)
-        set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
-      endif()
-      if("${compilerVersion}" EQUAL 1400)
-        set(MSVC80 1)
-        set(CMAKE_COMPILER_2005 1)
-      endif()
-      if("${compilerVersion}" EQUAL 1500)
-        set(MSVC90 1)
-      endif()
-      if("${compilerVersion}" EQUAL 1600)
-        set(MSVC10 1)
-      endif()
-      set(MSVC_VERSION "${compilerVersion}")
-    else()
-      message(STATUS "Check for CL compiler version - failed")
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-        "Determining the version of compiler failed with the following output:\n"
-        "${CMAKE_COMPILER_OUTPUT}\n\n")
-    endif()
+else()
+  set(MSVC_IDE 1)
+endif()
+
+if(NOT MSVC_VERSION)
+  if(CMAKE_C_COMPILER_VERSION)
+    set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
+  else()
+    set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
+  endif()
+  if("${_compiler_version}" MATCHES "^([0-9]+)\\.([0-9]+)")
+    set(MSVC_VERSION "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
+  else()
+    message(FATAL_ERROR "MSVC compiler version not detected properly: ${_compiler_version}")
+  endif()
+
+  set(MSVC10)
+  set(MSVC11)
+  set(MSVC60)
+  set(MSVC70)
+  set(MSVC71)
+  set(MSVC80)
+  set(MSVC90)
+  set(CMAKE_COMPILER_2005)
+  set(CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+  if(NOT "${_compiler_version}" VERSION_LESS 17)
+    set(MSVC11 1)
+  elseif(NOT  "${_compiler_version}" VERSION_LESS 16)
+    set(MSVC10 1)
+  elseif(NOT  "${_compiler_version}" VERSION_LESS 15)
+    set(MSVC90 1)
+  elseif(NOT  "${_compiler_version}" VERSION_LESS 14)
+    set(MSVC80 1)
+    set(CMAKE_COMPILER_2005 1)
+  elseif(NOT  "${_compiler_version}" VERSION_LESS 13.10)
+    set(MSVC71 1)
+  elseif(NOT  "${_compiler_version}" VERSION_LESS 13)
+    set(MSVC70 1)
+  else()
+    set(MSVC60 1)
+    set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
   endif()
 endif()
 
@@ -195,14 +163,3 @@ set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT
 set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
 set (CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
 set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
-
-# save computed information for this platform
-if(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake")
-  configure_file(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
-    ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCPlatform.cmake IMMEDIATE)
-endif()
-
-if(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake")
-  configure_file(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake.in
-               ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXPlatform.cmake IMMEDIATE)
-endif()
diff --git a/Modules/Platform/Windows-cl.cmake.in b/Modules/Platform/Windows-cl.cmake.in
deleted file mode 100644
index 1a65004..0000000
--- a/Modules/Platform/Windows-cl.cmake.in
+++ /dev/null
@@ -1,13 +0,0 @@
-set(CMAKE_VC_COMPILER_TESTS_RUN 1)
-set(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@)
-set(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@)
-set(CMAKE_CL_64 @CMAKE_CL_64@)
-set(MSVC60 @MSVC60@)
-set(MSVC70 @MSVC70@)
-set(MSVC71 @MSVC71@)
-set(MSVC80 @MSVC80@)
-set(MSVC90 @MSVC90@)
-set(MSVC10 @MSVC10@)
-set(MSVC_IDE @MSVC_IDE@)
-set(MSVC_VERSION @MSVC_VERSION@)
-set(WIN32 1)
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 39c9ae1..d188980 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -19,7 +19,6 @@
 
 cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator()
 {
-  this->VersionId = "MSVC10";
   this->FindMakeProgramFile = "CMakeVS10FindMake.cmake";
   std::string vc10Express;
   this->ExpressEdition = cmSystemTools::ReadRegistryValue(
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index ab1187d..7bb4d0c 100644
--- a/Source/cmGlobalVisualStudio11Generator.cxx
+++ b/Source/cmGlobalVisualStudio11Generator.cxx
@@ -16,7 +16,6 @@
 //----------------------------------------------------------------------------
 cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator()
 {
-  this->VersionId = "MSVC11";
   this->FindMakeProgramFile = "CMakeVS11FindMake.cmake";
   this->ExpressEdition = false; // TODO: VS 11 Express support
   this->PlatformToolset = "v110";
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index ca06b66..e8ca788 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -32,7 +32,6 @@ std::string GetVS6TargetName(const std::string& targetName)
 
 cmGlobalVisualStudio6Generator::cmGlobalVisualStudio6Generator()
 {
-  this->VersionId = "MSVC60";
   this->FindMakeProgramFile = "CMakeVS6FindMake.cmake";
 }
 
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index d99fa03..ab2308f 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -18,7 +18,6 @@
 //----------------------------------------------------------------------------
 cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator()
 {
-  this->VersionId = "MSVC71";
   this->FindMakeProgramFile = "CMakeVS71FindMake.cmake";
   this->ProjectConfigurationSectionName = "ProjectConfiguration";
 }
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 0567d55..b6eea5d 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -18,7 +18,6 @@
 
 cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator()
 {
-  this->VersionId = "MSVC70";
   this->FindMakeProgramFile = "CMakeVS7FindMake.cmake";
 }
 
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index f469188..2e3b530 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -19,7 +19,6 @@
 //----------------------------------------------------------------------------
 cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator()
 {
-  this->VersionId = "MSVC80";
   this->FindMakeProgramFile = "CMakeVS8FindMake.cmake";
   this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
 }
diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx
index 531395b..70af50d 100644
--- a/Source/cmGlobalVisualStudio9Generator.cxx
+++ b/Source/cmGlobalVisualStudio9Generator.cxx
@@ -19,7 +19,6 @@
 
 cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator()
 {
-  this->VersionId = "MSVC90";
   this->FindMakeProgramFile = "CMakeVS9FindMake.cmake";
 }
 
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index feb3ac9..0968b77 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -22,7 +22,6 @@
 cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator()
 {
   this->ArchitectureId = "X86";
-  this->VersionId = 0;
 }
 
 //----------------------------------------------------------------------------
@@ -495,11 +494,6 @@ void cmGlobalVisualStudioGenerator::AddPlatformDefinitions(cmMakefile* mf)
 {
   mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", this->ArchitectureId);
   mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", this->ArchitectureId);
-
-  if (this->VersionId)
-    {
-    mf->AddDefinition(this->VersionId, "1");
-    }
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index a042dc0..cebf7d7 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -99,7 +99,6 @@ protected:
   typedef std::map<cmTarget*, cmStdString> UtilityDependsMap;
   UtilityDependsMap UtilityDepends;
   const char* ArchitectureId;
-  const char* VersionId;
 
 private:
   void ComputeTargetObjects(cmGeneratorTarget* gt) const;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32db033b2713d40899865a06f03d83373078eaa3
commit 32db033b2713d40899865a06f03d83373078eaa3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Aug 23 10:48:16 2012 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Aug 23 10:51:27 2012 -0400

    VS: Remove support for "free" version 2003 tools
    
    Several more recent Visual Studio Express editions are now available and
    they support debug builds.  Simplify our VS platform files by removing
    support for these old tools.  If anyone still uses them we can restore
    support with a more modern way to test for them.

diff --git a/Modules/CMakeTestForFreeVC.cxx b/Modules/CMakeTestForFreeVC.cxx
deleted file mode 100644
index e580c1f..0000000
--- a/Modules/CMakeTestForFreeVC.cxx
+++ /dev/null
@@ -1,3 +0,0 @@
-#include<iostream>
-
-int main(){return 0;}
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index 05df946..265f555 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -30,8 +30,6 @@ set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
 
 # for nmake we need to compute some information about the compiler
 # that is being used.
-# the compiler may be free command line, 6, 7, or 71, and
-# each have properties that must be determined.
 # to avoid running these tests with each cmake run, the
 # test results are saved in CMakeCPlatform.cmake, a file
 # that is automatically copied into try_compile directories
@@ -96,34 +94,6 @@ if(CMAKE_GENERATOR MATCHES "Makefiles" OR CMAKE_GENERATOR MATCHES "Ninja")
         "Determining the version of compiler failed with the following output:\n"
         "${CMAKE_COMPILER_OUTPUT}\n\n")
     endif()
-    # try to figure out if we are running the free command line
-    # tools from Microsoft.  These tools do not provide debug libraries,
-    # so the link flags used have to be different.
-    make_directory("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp2")
-    set(testForFreeVCFile
-      "${CMAKE_ROOT}/Modules/CMakeTestForFreeVC.cxx")
-    string(REGEX REPLACE "/" "\\\\" testForFreeVCFile "${testForFreeVCFile}")
-    message(STATUS "Check if this is a free VC compiler")
-    exec_program(${CMAKE_TEST_COMPILER} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp2
-      ARGS /nologo /MD /EHsc
-      \"${testForFreeVCFile}\"
-      OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
-      RETURN_VALUE CMAKE_COMPILER_RETURN
-      )
-    if(CMAKE_COMPILER_RETURN)
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-        "Determining if this is a free VC compiler failed with the following output:\n"
-        "${CMAKE_COMPILER_OUTPUT}\n\n")
-      message(STATUS "Check if this is a free VC compiler - yes")
-      set(CMAKE_USING_VC_FREE_TOOLS 1)
-    else()
-      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
-        "Determining if this is a free VC compiler passed with the following output:\n"
-        "${CMAKE_COMPILER_OUTPUT}\n\n")
-      message(STATUS "Check if this is a free VC compiler - no")
-      set(CMAKE_USING_VC_FREE_TOOLS 0)
-    endif()
-    make_directory("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp3")
   endif()
 endif()
 
@@ -166,32 +136,17 @@ if(MSVC_VERSION GREATER 1310)
   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}")
 else()
-  if(CMAKE_USING_VC_FREE_TOOLS)
-    message(STATUS "Using FREE VC TOOLS, NO DEBUG available")
-    set(CMAKE_BUILD_TYPE_INIT Release)
-    set (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")
-    set (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi  /Ob0 /Od /GZ")
-    set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
-    set (CMAKE_CXX_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
-    set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
-    set (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
-    set (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi  /Ob0 /Od /GZ")
-    set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
-    set (CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
-    set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
-  else()
-    set(CMAKE_BUILD_TYPE_INIT Debug)
-    set (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")
-    set (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi  /Ob0 /Od /GZ")
-    set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
-    set (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
-    set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
-    set (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
-    set (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /GZ")
-    set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
-    set (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
-    set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
-  endif()
+  set(CMAKE_BUILD_TYPE_INIT Debug)
+  set (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR")
+  set (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi  /Ob0 /Od /GZ")
+  set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+  set (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
+  set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
+  set (CMAKE_C_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000")
+  set (CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /GZ")
+  set (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+  set (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /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")
 endif()
 
diff --git a/Modules/Platform/Windows-cl.cmake.in b/Modules/Platform/Windows-cl.cmake.in
index 4f3ec3e..1a65004 100644
--- a/Modules/Platform/Windows-cl.cmake.in
+++ b/Modules/Platform/Windows-cl.cmake.in
@@ -1,7 +1,6 @@
 set(CMAKE_VC_COMPILER_TESTS_RUN 1)
 set(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@)
 set(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@)
-set(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@)
 set(CMAKE_CL_64 @CMAKE_CL_64@)
 set(MSVC60 @MSVC60@)
 set(MSVC70 @MSVC70@)
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index ade35e6..601ca7f 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -383,12 +383,6 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
      "into all executables and libraries.",false,
      "Variables that Provide Information");
   cm->DefineProperty
-    ("CMAKE_USING_VC_FREE_TOOLS", cmProperty::VARIABLE,
-     "True if free visual studio tools being used.",
-     "This is set to true if the compiler is Visual "
-     "Studio free tools.",false,
-     "Variables that Provide Information");
-  cm->DefineProperty
     ("CMAKE_VERBOSE_MAKEFILE", cmProperty::VARIABLE,
      "Create verbose makefiles if on.",
      "This variable defaults to false. You can set "

-----------------------------------------------------------------------

Summary of changes:
 Modules/CMakeTestCCompiler.cmake           |    5 -
 Modules/CMakeTestCXXCompiler.cmake         |    5 -
 Modules/CMakeTestForFreeVC.cxx             |    3 -
 Modules/CMakeTestNMakeCLVersion.c          |    2 -
 Modules/Platform/Windows-MSVC-C.cmake      |    2 +
 Modules/Platform/Windows-MSVC-CXX.cmake    |    3 +
 Modules/Platform/Windows-MSVC.cmake        |  207 ++++++++++++++++++++++
 Modules/Platform/Windows-cl.cmake          |  256 ----------------------------
 Modules/Platform/Windows-cl.cmake.in       |   14 --
 Modules/Platform/cl.cmake                  |   62 -------
 Source/cmDocumentVariables.cxx             |    6 -
 Source/cmGlobalVisualStudio10Generator.cxx |    1 -
 Source/cmGlobalVisualStudio11Generator.cxx |    1 -
 Source/cmGlobalVisualStudio6Generator.cxx  |    1 -
 Source/cmGlobalVisualStudio71Generator.cxx |    1 -
 Source/cmGlobalVisualStudio7Generator.cxx  |    1 -
 Source/cmGlobalVisualStudio8Generator.cxx  |    1 -
 Source/cmGlobalVisualStudio9Generator.cxx  |    1 -
 Source/cmGlobalVisualStudioGenerator.cxx   |    6 -
 Source/cmGlobalVisualStudioGenerator.h     |    1 -
 20 files changed, 212 insertions(+), 367 deletions(-)
 delete mode 100644 Modules/CMakeTestForFreeVC.cxx
 delete mode 100644 Modules/CMakeTestNMakeCLVersion.c
 create mode 100644 Modules/Platform/Windows-MSVC-C.cmake
 create mode 100644 Modules/Platform/Windows-MSVC-CXX.cmake
 create mode 100644 Modules/Platform/Windows-MSVC.cmake
 delete mode 100644 Modules/Platform/Windows-cl.cmake
 delete mode 100644 Modules/Platform/Windows-cl.cmake.in
 delete mode 100644 Modules/Platform/cl.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list