Unverified Commit 10fd87e1 authored by Tommaso Tocci's avatar Tommaso Tocci
Browse files

CMake: Honor CC and CXX environment variable

Do not force a specific c(++) compiler by setting the
CMAKE_{}_COMPILER variable.
After the c(++) compiler binary has been choosen check if it is the GNU compilear.

In this way we allow the users to specify a GNU compiler under a non
standard path through the CC and CXX envirnoment variable.
parent 9ddbb809
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
cmake_minimum_required(VERSION 3.7)
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
project(ifs)

if(NOT CMAKE_COMPILER_IS_GNUCC)
	message(FATAL_ERROR "The choosen C compiler is not gcc and is not supported")
endif()
if(NOT CMAKE_COMPILER_IS_GNUCXX)
	message(FATAL_ERROR "The choosen C++ compiler is not g++ and is not supported")
endif()

set(CMAKE_CXX_STANDARD 14)
if (NOT CMAKE_BUILD_TYPE)
    SET(CMAKE_BUILD_TYPE Release