summaryrefslogtreecommitdiffstats
path: root/Modules/FortranCInterface.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-08-20 20:21:53 (GMT)
committerBrad King <brad.king@kitware.com>2009-08-20 20:21:53 (GMT)
commitf64f9940afc02b3d11f5326d806f8c24483df6cd (patch)
tree3db8145ddda927dc144e5788eef7dbb5b6d69f52 /Modules/FortranCInterface.cmake
parent5a4797ad80d9f89f57270adf9eb8573211856471 (diff)
downloadCMake-f64f9940afc02b3d11f5326d806f8c24483df6cd.zip
CMake-f64f9940afc02b3d11f5326d806f8c24483df6cd.tar.gz
CMake-f64f9940afc02b3d11f5326d806f8c24483df6cd.tar.bz2
Teach FortranCInterface to verify languages
This module requires both C and Fortran to be enabled, so error-out if they are not.
Diffstat (limited to 'Modules/FortranCInterface.cmake')
-rw-r--r--Modules/FortranCInterface.cmake9
1 files changed, 9 insertions, 0 deletions
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)