--- old/CMake/vtkCompilerExtras.cmake
+++ new/CMake/vtkCompilerExtras.cmake
@@ -26,6 +26,8 @@
   execute_process(COMMAND ${CMAKE_C_COMPILER} --version
     OUTPUT_VARIABLE _gcc_version_info
     ERROR_VARIABLE _gcc_version_info)
+
+  string (REPLACE ";" "" _gcc_version_info "${_gcc_version_info}")
 
   string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]"
     _gcc_version "${_gcc_version_info}")
--- old/CMake/GenerateExportHeader.cmake
+++ new/CMake/GenerateExportHeader.cmake
@@ -166,6 +166,7 @@
     execute_process(COMMAND ${CMAKE_C_COMPILER} --version
       OUTPUT_VARIABLE _gcc_version_info
       ERROR_VARIABLE _gcc_version_info)
+    string (REPLACE ";" "" _gcc_version_info "${_gcc_version_info}")
     string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]"
       _gcc_version "${_gcc_version_info}")
     # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
