detecting HDF5 and FFTW

some PETSc installations are not aware of them, so it might make sense
to become independent of PETSc. But PETSc-defined variables should take
precedence
This commit is contained in:
Martin Diehl 2022-04-09 21:10:15 +02:00
parent bf7da2c717
commit 16f5a27e08
1 changed files with 7 additions and 1 deletions

View File

@ -9,7 +9,7 @@ endif()
# Dummy project to determine compiler names and version
project(Prerequisites LANGUAGES)
set(ENV{PKG_CONFIG_PATH} "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig")
set(ENV{PKG_CONFIG_PATH} "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
pkg_check_modules(PETSC_MIN REQUIRED PETSc>=3.12.0 QUIET) #CMake does not support version range
pkg_check_modules(PETSC REQUIRED PETSc<3.18.0)
@ -27,6 +27,12 @@ else()
endif()
add_definitions("-D${DAMASK_SOLVER}")
# EXPERIMENTAL: This might help to detect HDF5 and FFTW3 in the future if PETSc is not aware of them
set(ENV{PKG_CONFIG_PATH} "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/externalpackages:$ENV{PKG_CONFIG_PATH}")
message($ENV{PKG_CONFIG_PATH})
pkg_check_modules(HDF5 hdf5)
pkg_check_modules(FFTW3 fftw3)
file(STRINGS ${PROJECT_SOURCE_DIR}/VERSION DAMASK_VERSION)
message("\nBuilding ${CMAKE_PROJECT_NAME} ${DAMASK_VERSION}\n")