Skip to content

Commit 0abf803

Browse files
committed
Adding ability to specify the libMesh pkconfig type with the METHOD env var.
1 parent cb6c24b commit 0abf803

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

cmake/Modules/FindLIBMESH.cmake

+10-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ if(${CMAKE_VERSION} VERSION_LESS 3.12.0)
55
message(FATAL_ERROR "OpenMC builds with libMesh support require CMake version 3.12.0 or greater.")
66
endif()
77

8+
set(LIBMESH_PC_FILE libmesh)
9+
10+
# if the METHOD variable is present, check specifically for
11+
# the libMesh .pc file for that build type
12+
if(DEFINED ENV{METHOD})
13+
set(LIBMESH_PC_FILE libmesh-$ENV{METHOD})
14+
message(STATUS "Using environment variable METHOD to determine libMesh build: ${LIBMESH_PC_FILE}")
15+
endif()
16+
817
include(FindPkgConfig)
918
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${LIBMESH_PC}")
1019
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH True)
11-
pkg_check_modules(LIBMESH REQUIRED libmesh>=1.6.0 IMPORTED_TARGET)
12-
13-
find_path(LIBMESH_PC NAMES libmesh.pc
14-
HINTS ${LIBMESH_LIBDIR}
15-
PATHS ENV LD_LIBRARY_PATH
16-
PATH_SUFFIXES lib/pkgconfig pkgconfig
17-
NO_DEFAULT_PATH)
20+
pkg_check_modules(LIBMESH REQUIRED ${LIBMESH_PC_FILE}>=1.6.0 IMPORTED_TARGET)

0 commit comments

Comments
 (0)