summaryrefslogtreecommitdiff
path: root/Tests/CMakeOnly
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-08-21 13:30:50 -0400
committerBrad King <brad.king@kitware.com>2012-08-22 16:35:54 -0400
commit8be51f6694184fb9044389fb1e18ad1765f6476c (patch)
treef61c0eb17447a82f757616e97e2bd2d41fb6765b /Tests/CMakeOnly
parentec22a9b5217c2110db9af1791a61a7552144f028 (diff)
downloadcmake-8be51f6694184fb9044389fb1e18ad1765f6476c.tar.gz
Test variables CMAKE_(C|CXX|Fortran)_COMPILER(|_ID|_VERSION)
Add tests CMakeOnly.CompilerId(C|CXX|Fortran) to check that the basic compiler tool path, vendor, and version variables have been set as expected.
Diffstat (limited to 'Tests/CMakeOnly')
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt6
-rw-r--r--Tests/CMakeOnly/CompilerIdC/CMakeLists.txt14
-rw-r--r--Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt14
-rw-r--r--Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt22
4 files changed, 56 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index 6fe91c7810..ba681d8acb 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -19,6 +19,12 @@ add_CMakeOnly_test(CheckCXXCompilerFlag)
add_CMakeOnly_test(CheckLanguage)
+add_CMakeOnly_test(CompilerIdC)
+add_CMakeOnly_test(CompilerIdCXX)
+if(CMAKE_Fortran_COMPILER)
+ add_CMakeOnly_test(CompilerIdFortran)
+endif()
+
add_CMakeOnly_test(AllFindModules)
add_CMakeOnly_test(TargetScope)
diff --git a/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt
new file mode 100644
index 0000000000..848ffdd36c
--- /dev/null
+++ b/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CompilerIdC C)
+
+foreach(v
+ CMAKE_C_COMPILER
+ CMAKE_C_COMPILER_ID
+ CMAKE_C_COMPILER_VERSION
+ )
+ if(${v})
+ message(STATUS "${v}=[${${v}}]")
+ else()
+ message(SEND_ERROR "${v} not set!")
+ endif()
+endforeach()
diff --git a/Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt
new file mode 100644
index 0000000000..94ac31e4c8
--- /dev/null
+++ b/Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CompilerIdCXX CXX)
+
+foreach(v
+ CMAKE_CXX_COMPILER
+ CMAKE_CXX_COMPILER_ID
+ CMAKE_CXX_COMPILER_VERSION
+ )
+ if(${v})
+ message(STATUS "${v}=[${${v}}]")
+ else()
+ message(SEND_ERROR "${v} not set!")
+ endif()
+endforeach()
diff --git a/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt
new file mode 100644
index 0000000000..3a2bdebd69
--- /dev/null
+++ b/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CompilerIdFortran Fortran)
+
+foreach(v
+ CMAKE_Fortran_COMPILER
+ CMAKE_Fortran_COMPILER_ID
+ )
+ if(${v})
+ message(STATUS "${v}=[${${v}}]")
+ else()
+ message(SEND_ERROR "${v} not set!")
+ endif()
+endforeach()
+foreach(v
+ CMAKE_Fortran_COMPILER_VERSION
+ )
+ if(${v})
+ message(STATUS "${v}=[${${v}}]")
+ else()
+ message(WARNING "${v} not set!")
+ endif()
+endforeach()