summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-12-15 15:50:55 (GMT)
committerBrad King <brad.king@kitware.com>2012-02-09 13:34:14 (GMT)
commit7e0d9f15d626c13b452bc213172cd54c24f5b41a (patch)
treedcc79beac5d3c0283aecb66bcdcc4835b07b6c0e
parentd6b031283a686eaeff643a13f8368c7828850229 (diff)
downloadCMake-7e0d9f15d626c13b452bc213172cd54c24f5b41a.zip
CMake-7e0d9f15d626c13b452bc213172cd54c24f5b41a.tar.gz
CMake-7e0d9f15d626c13b452bc213172cd54c24f5b41a.tar.bz2
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.
-rw-r--r--Modules/CMakeAddFortranSubdirectory.cmake11
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/CMakeAddFortranSubdirectory.cmake b/Modules/CMakeAddFortranSubdirectory.cmake
index 10935a8..d36738c 100644
--- a/Modules/CMakeAddFortranSubdirectory.cmake
+++ b/Modules/CMakeAddFortranSubdirectory.cmake
@@ -44,10 +44,13 @@ include(ExternalProject)
include(CMakeParseArguments)
function(_setup_mingw_config_and_build source_dir)
- find_program(MINGW_GFORTRAN NAMES gfortran
- HINTS
- c:/MinGW/bin
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin" )
+ # Look for a MinGW gfortran.
+ find_program(MINGW_GFORTRAN
+ NAMES gfortran
+ PATHS
+ c:/MinGW/bin
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
+ )
if(NOT MINGW_GFORTRAN)
message(FATAL_ERROR
"gfortran not found, please install MinGW with the gfortran option."