use check_language() instead of enable_language() to get fortran compiler name

This commit is contained in:
Axel Kohlmeyer 2019-08-01 18:24:14 -04:00
parent 8df7f51470
commit 5b4b418289
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 6 additions and 2 deletions

View File

@ -20,9 +20,13 @@ if(PKG_KIM)
message(FATAL_ERROR "Cannot build downloaded KIM-API library with Ninja build tool")
endif()
message(STATUS "KIM-API download requested - we will build our own")
enable_language(C)
enable_language(Fortran)
include(CheckLanguage)
include(ExternalProject)
enable_language(C)
check_language(Fortran)
if(NOT CMAKE_Fortran_COMPILER)
message(FATAL_ERROR "Compiling the KIM-API library requires a Fortran compiler")
endif()
ExternalProject_Add(kim_build
URL https://s3.openkim.org/kim-api/kim-api-2.1.2.txz
URL_MD5 6ac52e14ef52967fc7858220b208cba5