mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Adding ability to specify the libMesh pkconfig type with the METHOD env var.
This commit is contained in:
parent
cb6c24ba9b
commit
0abf803bb7
1 changed files with 10 additions and 7 deletions
|
|
@ -5,13 +5,16 @@ if(${CMAKE_VERSION} VERSION_LESS 3.12.0)
|
|||
message(FATAL_ERROR "OpenMC builds with libMesh support require CMake version 3.12.0 or greater.")
|
||||
endif()
|
||||
|
||||
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()
|
||||
|
||||
include(FindPkgConfig)
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${LIBMESH_PC}")
|
||||
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH True)
|
||||
pkg_check_modules(LIBMESH REQUIRED libmesh>=1.6.0 IMPORTED_TARGET)
|
||||
|
||||
find_path(LIBMESH_PC NAMES libmesh.pc
|
||||
HINTS ${LIBMESH_LIBDIR}
|
||||
PATHS ENV LD_LIBRARY_PATH
|
||||
PATH_SUFFIXES lib/pkgconfig pkgconfig
|
||||
NO_DEFAULT_PATH)
|
||||
pkg_check_modules(LIBMESH REQUIRED ${LIBMESH_PC_FILE}>=1.6.0 IMPORTED_TARGET)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue