From 75135af43084f763f910a4a27a5bfe8e0856a7e9 Mon Sep 17 00:00:00 2001
From: Konstantin Osipov <kostja@tarantool.org>
Date: Mon, 10 Aug 2015 15:19:55 +0300
Subject: [PATCH] cmake: fix broken travis build, which uses cmake 2.8.9

cmake 2.8.9 doesn't have CMAKE_CXX_COMPILER_VERSION
---
 cmake/compiler.cmake | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake
index 107d2c9e51..e5d16ae915 100644
--- a/cmake/compiler.cmake
+++ b/cmake/compiler.cmake
@@ -22,10 +22,17 @@ endif()
 # demand for C++ compiler is support of C++11 lambdas, added
 # only in version 4.5 https://gcc.gnu.org/projects/cxx0x.html
 #
-if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5)
-        message(FATAL_ERROR "
-        Your GCC version is ${CMAKE_CXX_COMPILER_VERSION}, please update to version 4.6 or later 
-                ")
+if (CMAKE_COMPILER_IS_GNUCC)
+# cmake 2.8.9 and earlier doesn't support CMAKE_CXX_COMPILER_VERSION
+       if (NOT CMAKE_CXX_COMPILER_VERSION)
+               execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+                               OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION)
+       endif()
+       if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5)
+               message(FATAL_ERROR "
+               Your GCC version is ${CMAKE_CXX_COMPILER_VERSION}, please update
+                       ")
+       endif()
 endif()
 
 #
-- 
GitLab