make it possible to toggle fortran support
This commit is contained in:
parent
c75a3bb439
commit
cb3a0a5249
@ -8,6 +8,7 @@
|
|||||||
# Variables used::
|
# Variables used::
|
||||||
#
|
#
|
||||||
# EXTRA_FCFLAGS
|
# EXTRA_FCFLAGS
|
||||||
|
# ENABLE_FC_SUPPORT
|
||||||
#
|
#
|
||||||
# Variables defined::
|
# Variables defined::
|
||||||
#
|
#
|
||||||
@ -17,6 +18,10 @@
|
|||||||
#
|
#
|
||||||
# CMAKE_Fortran_FLAGS
|
# CMAKE_Fortran_FLAGS
|
||||||
#
|
#
|
||||||
|
# Variables set::
|
||||||
|
#
|
||||||
|
# ENABLE_FC_SUPPORT
|
||||||
|
#
|
||||||
# Environment variables used::
|
# Environment variables used::
|
||||||
#
|
#
|
||||||
# FCFLAGS
|
# FCFLAGS
|
||||||
@ -27,9 +32,14 @@
|
|||||||
# source: https://github.com/scisoft/autocmake/raw/master/modules/fc.cmake
|
# source: https://github.com/scisoft/autocmake/raw/master/modules/fc.cmake
|
||||||
# docopt: --fc=<FC> Fortran compiler [default: gfortran].
|
# docopt: --fc=<FC> Fortran compiler [default: gfortran].
|
||||||
# --extra-fc-flags=<EXTRA_FCFLAGS> Extra Fortran compiler flags [default: ''].
|
# --extra-fc-flags=<EXTRA_FCFLAGS> Extra Fortran compiler flags [default: ''].
|
||||||
|
# --fc-support=<FC_SUPPORT> Toggle Fortran language support (ON/OFF) [default: ON].
|
||||||
# export: 'FC=%s' % arguments['--fc']
|
# export: 'FC=%s' % arguments['--fc']
|
||||||
# define: '-DEXTRA_FCFLAGS="%s"' % arguments['--extra-fc-flags']
|
# define: '-DEXTRA_FCFLAGS="%s"' % arguments['--extra-fc-flags']
|
||||||
|
# '-DENABLE_FC_SUPPORT="%s"' % arguments['--fc-support']
|
||||||
|
|
||||||
|
option(ENABLE_FC_SUPPORT "Enable Fortran language support" ON)
|
||||||
|
|
||||||
|
if(ENABLE_FC_SUPPORT)
|
||||||
enable_language(Fortran)
|
enable_language(Fortran)
|
||||||
|
|
||||||
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/include/fortran)
|
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/include/fortran)
|
||||||
@ -50,3 +60,4 @@ if(DEFINED ENV{FCFLAGS})
|
|||||||
message(STATUS "FCFLAGS is set to '$ENV{FCFLAGS}'.")
|
message(STATUS "FCFLAGS is set to '$ENV{FCFLAGS}'.")
|
||||||
set(CMAKE_Fortran_FLAGS "$ENV{FCFLAGS}")
|
set(CMAKE_Fortran_FLAGS "$ENV{FCFLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user