[Cmake-commits] CMake branch, master, updated. 29382636364891a17fcf901d85125976b4332b2f

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Apr 30 00:48:08 EDT 2010


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, master has been updated
       via  29382636364891a17fcf901d85125976b4332b2f (commit)
      from  d4c95316eefa691eb566dab609c6ff9f4b3259bc (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=29382636364891a17fcf901d85125976b4332b2f
commit 29382636364891a17fcf901d85125976b4332b2f
Author: David Cole <david.cole at kitware.com>
Date:   Fri Apr 30 00:18:01 2010 -0400

    Fix missing set of MSVC10 and add CheckCompilerRelatedVariables test.

diff --git a/Modules/Platform/Windows-cl.cmake.in b/Modules/Platform/Windows-cl.cmake.in
index 1a889f2..82a0e59 100644
--- a/Modules/Platform/Windows-cl.cmake.in
+++ b/Modules/Platform/Windows-cl.cmake.in
@@ -8,6 +8,7 @@ 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/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 6e3e094..07f5e7d 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -980,6 +980,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     ADD_TEST_MACRO(ModuleDefinition example_exe)
   ENDIF(CMAKE_TEST_MSVC)
 
+  ADD_TEST_MACRO(CheckCompilerRelatedVariables CheckCompilerRelatedVariables)
+
   IF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile")
     ADD_TEST(MakeClean ${CMAKE_CTEST_COMMAND}
       --build-and-test
diff --git a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
new file mode 100644
index 0000000..7206f1d
--- /dev/null
+++ b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
@@ -0,0 +1,85 @@
+cmake_minimum_required(VERSION 2.8)
+project(CheckCompilerRelatedVariables)
+
+
+function(echo_var var)
+  if(DEFINED ${var})
+    message("${var}='${${var}}' is defined")
+  else()
+    message("${var}='${${var}}' is NOT defined")
+  endif()
+endfunction()
+
+
+#
+# Check that the correct number of MSVC** variables are defined...
+#
+set(msvc_total 0)
+
+if(DEFINED MSVC60)
+  math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+if(DEFINED MSVC70)
+  math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+if(DEFINED MSVC71)
+  math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+if(DEFINED MSVC80)
+  math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+if(DEFINED MSVC90)
+  math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+if(DEFINED MSVC10)
+  math(EXPR msvc_total "${msvc_total} + 1")
+endif()
+
+echo_var(MSVC)
+echo_var(MSVC60)
+echo_var(MSVC70)
+echo_var(MSVC71)
+echo_var(MSVC80)
+echo_var(MSVC90)
+echo_var(MSVC10)
+
+if(MSVC)
+  #
+  # MSVC is set in cl.cmake when cl is the compiler...
+  #
+  # Exactly one of the numbered variables should also be set
+  # indicating which version of the cl compiler / Visual Studio
+  # is in use...
+  #
+  if(msvc_total EQUAL 1)
+    message("test passes: exactly one MSVC** variable is defined...")
+  else()
+    message(FATAL_ERROR "error: ${msvc_total} MSVC** variables are defined -- exactly 1 expected")
+  endif()
+else()
+  #
+  # The compiler is something other than cl... None of the MSVC** variables
+  # should be defined...
+  #
+  if(msvc_total EQUAL 0)
+    message("test passes: no MSVC** variables are defined on non-MSVC build...")
+  else()
+    message(FATAL_ERROR "error: ${msvc_total} MSVC** variables are defined -- exactly 0 expected")
+  endif()
+endif()
+
+
+#
+# This is a no-op executable... If this test is going to fail, it fails during
+# the configure step while cmake is configuring this CMakeLists.txt file...
+#
+
+file(WRITE
+  "${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
+  "int main() { return 0; }"
+  )
+
+add_executable(
+  CheckCompilerRelatedVariables
+  "${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
+  )

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

Summary of changes:
 Modules/Platform/Windows-cl.cmake.in               |    1 +
 Tests/CMakeLists.txt                               |    2 +
 Tests/CheckCompilerRelatedVariables/CMakeLists.txt |   85 ++++++++++++++++++++
 3 files changed, 88 insertions(+), 0 deletions(-)
 create mode 100644 Tests/CheckCompilerRelatedVariables/CMakeLists.txt


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list