Teach FortranCInterface to verify languages
This module requires both C and Fortran to be enabled, so error-out if they are not.
This commit is contained in:
parent
5a4797ad80
commit
f64f9940af
|
@ -75,6 +75,15 @@ if(FortranCInterface_SOURCE_DIR)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Verify that C and Fortran are available.
|
||||||
|
foreach(lang C Fortran)
|
||||||
|
if(NOT CMAKE_${lang}_COMPILER_LOADED)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"FortranCInterface requires the ${lang} language to be enabled.")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Set up an interface detection project.
|
# Set up an interface detection project.
|
||||||
set(FortranCInterface_SOURCE_DIR ${CMAKE_ROOT}/Modules/FortranCInterface)
|
set(FortranCInterface_SOURCE_DIR ${CMAKE_ROOT}/Modules/FortranCInterface)
|
||||||
|
|
Loading…
Reference in New Issue