From e3524cefaa9bc6ebe1b9f0d31ad627dbb8bfb9d8 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Thu, 14 May 2015 21:21:07 +0200 Subject: [PATCH] Cmake build: Abort build-configuration if using a too old c++ gnu compiler --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 785e37e7d4..531532627d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,8 +68,15 @@ if(LYX_XMINGW) endif() if(NOT help AND NOT HELP) - # 'project' triggers the searching for a compiler - project(${LYX_PROJECT}) + # 'project' triggers the searching for a compiler + project(${LYX_PROJECT}) + if (CMAKE_COMPILER_IS_GNUCXX) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.0") + message(STATUS "Gnu CXX compiler version = ${CMAKE_CXX_COMPILER_VERSION}") + message(STATUS "is too old, should be >= 4.0") + message(FATAL_ERROR "Exiting") + endif() + endif() endif() if(UNIX)