summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeOnly/CompilerIdFortran
diff options
context:
space:
mode:
authorJames Johnston <johnstonj.public@codenest.com>2015-12-03 21:17:26 (GMT)
committerJames Johnston <johnstonj.public@codenest.com>2015-12-03 21:37:07 (GMT)
commit25211d756fad353e96d29e289d40d780a5341c92 (patch)
treef9b79fe107c406d72f8003e7c743e5621616bc6f /Tests/CMakeOnly/CompilerIdFortran
parent060442c2e866c44ecf0c479e49e1d5ae35e8c6fb (diff)
downloadCMake-25211d756fad353e96d29e289d40d780a5341c92.zip
CMake-25211d756fad353e96d29e289d40d780a5341c92.tar.gz
CMake-25211d756fad353e96d29e289d40d780a5341c92.tar.bz2
Compiler ID: Compiler versions must be a valid, numeric version string.
This test helps catch errors in compiler identification.
Diffstat (limited to 'Tests/CMakeOnly/CompilerIdFortran')
-rw-r--r--Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt
index 02e4668..067fb8c 100644
--- a/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt
+++ b/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt
@@ -12,3 +12,10 @@ foreach(v
message(SEND_ERROR "${v} not set!")
endif()
endforeach()
+
+# Version numbers may only contain numbers and periods.
+if(NOT CMAKE_Fortran_COMPILER_VERSION MATCHES
+ "^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$"
+ )
+ message(SEND_ERROR "Compiler version is not numeric!")
+endif()