summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeTestCompilerCommon.cmake
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2010-02-12 19:32:20 (GMT)
committerDavid Cole <david.cole@kitware.com>2010-02-12 19:32:20 (GMT)
commitf48660fa8533a1e00217048372a3ebbfac52f8e5 (patch)
treec7a079ccf5b86be5f1b8a07434eccf18ee863d12 /Modules/CMakeTestCompilerCommon.cmake
parente3293f8e4656589493b6921aac592170d884881d (diff)
downloadCMake-f48660fa8533a1e00217048372a3ebbfac52f8e5.zip
CMake-f48660fa8533a1e00217048372a3ebbfac52f8e5.tar.gz
CMake-f48660fa8533a1e00217048372a3ebbfac52f8e5.tar.bz2
Make a common function that prints the status during the checks for working compilers. Call it from all of the CMakeTesten_US.UTF-8Compiler.cmake files. In the message, print the full path to the tested compiler only for the Makefile generators. For Xcode and Visual Studio generators, print the generator instead so that users are not misled with the full path to a compiler that the generator may not even use. Xcode and Visual Studio have their own mechanisms for choosing the compiler to use during try_compile and build...
Diffstat (limited to 'Modules/CMakeTestCompilerCommon.cmake')
-rw-r--r--Modules/CMakeTestCompilerCommon.cmake21
1 files changed, 21 insertions, 0 deletions
diff --git a/Modules/CMakeTestCompilerCommon.cmake b/Modules/CMakeTestCompilerCommon.cmake
new file mode 100644
index 0000000..4307627
--- /dev/null
+++ b/Modules/CMakeTestCompilerCommon.cmake
@@ -0,0 +1,21 @@
+
+#=============================================================================
+# Copyright 2010 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 distributed this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+function(PrintTestCompilerStatus LANG MSG)
+ IF(CMAKE_GENERATOR MATCHES Make)
+ MESSAGE(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
+ ELSE()
+ MESSAGE(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
+ ENDIF()
+endfunction()