From b8f10b49dfdd9632d7de379213e613cda7d9998d Mon Sep 17 00:00:00 2001 From: Evan Benn Date: Tue, 1 May 2018 10:33:59 +1000 Subject: [PATCH] Make cmake respect CC and PATH compiler overrides Cmake does not respect non-system default compilers using the conventional override methods (CC env variable and PATH). https://stackoverflow.com/questions/29902862/how-to-get-cmake-to-use-the-default-compiler-on-system-path --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dfd92543..c2d0c9cd 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,10 @@ # Author: Peter Krusche # cmake_minimum_required (VERSION 2.8) + +find_program(CMAKE_C_COMPILER NAMES $ENV{CC} gcc PATHS ENV PATH NO_DEFAULT_PATH) +find_program(CMAKE_CXX_COMPILER NAMES $ENV{CXX} g++ PATHS ENV PATH NO_DEFAULT_PATH) + project (HAPLOTYPES) set(CMAKE_EXPORT_COMPILE_COMMANDS 1)