From 288d456c2951013e423ae4107f0207ef4594bb45 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 12 Oct 2020 12:24:08 +0100 Subject: Replace language_support module with builtin CheckLanguage The workaround_9220 function was introduced a long time ago to workaround a CMake issue with enable_language(OPTIONAL). Since then CMake has clarified that the OPTIONAL keywords has not been implemented[0]. A CheckLanguage module is now provided with CMake to check if a language can be enabled. Use that instead. [0] https://cmake.org/cmake/help/v3.18/command/enable_language.html --- test/CMakeLists.txt | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'test/CMakeLists.txt') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ce3782171..c624950c2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -5,18 +5,13 @@ if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/split_test_helper.h) endif() # check if we have a Fortran compiler -include("../cmake/language_support.cmake") - -workaround_9220(Fortran EIGEN_Fortran_COMPILER_WORKS) - -if(EIGEN_Fortran_COMPILER_WORKS) - enable_language(Fortran OPTIONAL) - if(NOT CMAKE_Fortran_COMPILER) - set(EIGEN_Fortran_COMPILER_WORKS OFF) - endif() -endif() - -if(NOT EIGEN_Fortran_COMPILER_WORKS) +include(CheckLanguage) +check_language(Fortran) +if(CMAKE_Fortran_COMPILER) + enable_language(Fortran) + set(EIGEN_Fortran_COMPILER_WORKS ON) +else() + set(EIGEN_Fortran_COMPILER_WORKS OFF) # search for a default Lapack library to complete Eigen's one find_package(LAPACK QUIET) endif() -- cgit v1.2.3