summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeOnly/CompilerIdC
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/CompilerIdC
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/CompilerIdC')
-rw-r--r--Tests/CMakeOnly/CompilerIdC/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt
index 848ffdd..6fea73e 100644
--- a/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt
+++ b/Tests/CMakeOnly/CompilerIdC/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_C_COMPILER_VERSION MATCHES
+ "^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$"
+ )
+ message(SEND_ERROR "Compiler version is not numeric!")
+endif()