move check for Fortran Compiler validity

This commit is contained in:
Axel Kohlmeyer 2022-09-13 11:24:20 -04:00
parent 446cc46bbd
commit 56304fe939
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 4 additions and 4 deletions

View File

@ -6,14 +6,14 @@ endif()
include(CheckLanguage)
check_language(Fortran)
if(NOT CMAKE_Fortran_COMPILER_ID)
message(STATUS "Skipping Tests for the LAMMPS Fortran Module: cannot identify Fortran compiler")
return()
endif()
if(CMAKE_Fortran_COMPILER)
enable_language(C)
enable_language(Fortran)
if(NOT CMAKE_Fortran_COMPILER_ID)
message(STATUS "Skipping Tests for the LAMMPS Fortran Module: cannot identify Fortran compiler")
return()
endif()
get_filename_component(LAMMPS_FORTRAN_MODULE ${LAMMPS_SOURCE_DIR}/../fortran/lammps.f90 ABSOLUTE)
if(BUILD_MPI)
find_package(MPI REQUIRED)