Add CMakeAddFortranSubdirectory to use MinGW gfortran in VS

This patch adds a new module that allows for easy integration of MinGW
gfortran and the Visual Studio compiler. It is done in a function called
cmake_add_fortran_subdirectory. The patch also includes a test for this
feature.
This commit is contained in:
Bill Hoffman
2011-12-09 18:04:19 -05:00
committed by Brad King
parent 3c6af5ff33
commit 538c3452ad
11 changed files with 282 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
set(ENV{PATH} "@MINGW_PATH@\;$ENV{PATH}")
execute_process(COMMAND "@CMAKE_COMMAND@" --build . )

View File

@@ -0,0 +1,8 @@
set(ENV{PATH} "@MINGW_PATH@\;$ENV{PATH}")
execute_process(
COMMAND "@CMAKE_COMMAND@" "-GMinGW Makefiles"
-DCMAKE_Fortran_COMPILER:PATH=@MINGW_GFORTRAN@
-DBUILD_SHARED_LIBS=ON
-DCMAKE_GNUtoMS=ON
@ARGS_CMAKE_COMMAND_LINE@
"@source_dir@")