cmake: fix config for CXX-only consumers (#423)

Some consumers only have CXX enabled hence find_dependency(MPI) won't define a MPI::MPI_C target.
Explicitly enabling the C language will fix that.
This commit is contained in:
Christoph Junghans 2021-07-12 14:23:21 -06:00 committed by GitHub
parent 89521dcbf8
commit ec6670a886
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,8 @@ if(HYPRE_USING_DSUPERLU)
endif()
if(HYPRE_WITH_MPI)
find_dependency(MPI @MPI_C_VERSION@ EXACT)
enable_language(C)
find_dependency(MPI @MPI_C_VERSION@ EXACT COMPONENTS C)
endif()
if(HYPRE_WITH_OPENMP)