From f64f9940afc02b3d11f5326d806f8c24483df6cd Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 20 Aug 2009 16:21:53 -0400 Subject: Teach FortranCInterface to verify languages This module requires both C and Fortran to be enabled, so error-out if they are not. --- Modules/FortranCInterface.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake index 580f84e..eba97c6 100644 --- a/Modules/FortranCInterface.cmake +++ b/Modules/FortranCInterface.cmake @@ -76,6 +76,15 @@ if(FortranCInterface_SOURCE_DIR) 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(FortranCInterface_SOURCE_DIR ${CMAKE_ROOT}/Modules/FortranCInterface) set(FortranCInterface_BINARY_DIR ${CMAKE_BINARY_DIR}/CMakeFiles/FortranCInterface) -- cgit v0.12