Skip to content
Snippets Groups Projects
Commit 25211d75 authored by James Johnston's avatar James Johnston
Browse files

Compiler ID: Compiler versions must be a valid, numeric version string.

This test helps catch errors in compiler identification.
parent 060442c2
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......@@ -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_CXX_COMPILER_VERSION MATCHES
"^([0-9]+)(\\.([0-9]+))?(\\.([0-9]+))?(\\.([0-9]+))?$"
)
message(SEND_ERROR "Compiler version is not numeric!")
endif()
......@@ -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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment