From db3c24164bfb7b4a527543beefc7d8cc5aa8d72c Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Wed, 25 Oct 2023 16:19:19 +0200 Subject: [PATCH] Eigen: explicitly disable Fortran usage We don't want different packages be created wheter a Fortran compiler is available or not. As Eigen 3.4.0 has no flags to disable the Fortran related code hook into the [CheckLanguge](https://cmake.org/cmake/help/latest/module/CheckLanguage.html) CMake feature. For the variable `CMAKE__COMPILER` the documentation states the following: > If this variable is already set, either explicitly or cached by a previous > call, the check is skipped. We use this to effectively force Eigen to think that there was no Fortan compiler. Fixes the ninja and nmake vs-16-2019 based toolchains. --- cmake/projects/Eigen/hunter.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/projects/Eigen/hunter.cmake b/cmake/projects/Eigen/hunter.cmake index ee6d46beba..b2dba28986 100644 --- a/cmake/projects/Eigen/hunter.cmake +++ b/cmake/projects/Eigen/hunter.cmake @@ -198,7 +198,11 @@ endif() hunter_cmake_args( Eigen CMAKE_ARGS + # explicitly disable gfortran usage + CMAKE_Fortran_COMPILER=NOTFOUND + # no need for tests or docs to save build-time BUILD_TESTING=OFF + EIGEN_BUILD_DOC=OFF HUNTER_INSTALL_LICENSE_FILES=COPYING.MPL2 ${_android_args} )