CMakeAddFortranSubdirectory: Find gfortran in PATH
In the find_program(MINGW_GFORTRAN) call use the PATHS option for hard-coded guesses instead of HINTS. This allows the user environment to override the guesses and corrects usage of the command options.
This commit is contained in:
parent
d6b031283a
commit
7e0d9f15d6
@ -44,10 +44,13 @@ include(ExternalProject)
|
|||||||
include(CMakeParseArguments)
|
include(CMakeParseArguments)
|
||||||
|
|
||||||
function(_setup_mingw_config_and_build source_dir)
|
function(_setup_mingw_config_and_build source_dir)
|
||||||
find_program(MINGW_GFORTRAN NAMES gfortran
|
# Look for a MinGW gfortran.
|
||||||
HINTS
|
find_program(MINGW_GFORTRAN
|
||||||
c:/MinGW/bin
|
NAMES gfortran
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin" )
|
PATHS
|
||||||
|
c:/MinGW/bin
|
||||||
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
|
||||||
|
)
|
||||||
if(NOT MINGW_GFORTRAN)
|
if(NOT MINGW_GFORTRAN)
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"gfortran not found, please install MinGW with the gfortran option."
|
"gfortran not found, please install MinGW with the gfortran option."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user