2020-04-10 17:17:45 -05:00
|
|
|
# Finds the libMesh installation using CMake's PkgConfig
|
|
|
|
|
# module and creates a libmesh imported target
|
2019-12-05 22:29:47 -06:00
|
|
|
|
2021-02-10 16:00:44 -06:00
|
|
|
if(${CMAKE_VERSION} VERSION_LESS 3.12.0)
|
2021-02-10 15:38:12 -06:00
|
|
|
message(FATAL_ERROR "OpenMC builds with libMesh support require CMake version 3.12.0 or greater.")
|
2021-02-10 13:47:27 -06:00
|
|
|
endif()
|
|
|
|
|
|
2021-03-03 18:08:40 -06:00
|
|
|
set(LIBMESH_PC_FILE libmesh)
|
|
|
|
|
|
|
|
|
|
# if the METHOD variable is present, check specifically for
|
|
|
|
|
# the libMesh .pc file for that build type
|
|
|
|
|
if(DEFINED ENV{METHOD})
|
|
|
|
|
set(LIBMESH_PC_FILE libmesh-$ENV{METHOD})
|
|
|
|
|
message(STATUS "Using environment variable METHOD to determine libMesh build: ${LIBMESH_PC_FILE}")
|
|
|
|
|
endif()
|
|
|
|
|
|
2024-08-18 23:09:32 -05:00
|
|
|
find_package(PkgConfig REQUIRED)
|
2024-10-10 22:05:32 +06:00
|
|
|
|
|
|
|
|
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
|
2021-11-22 15:20:01 -06:00
|
|
|
pkg_check_modules(LIBMESH REQUIRED ${LIBMESH_PC_FILE}>=1.7.0 IMPORTED_TARGET)
|
|
|
|
|
pkg_get_variable(LIBMESH_PREFIX ${LIBMESH_PC_FILE} prefix)
|