Skip to content
Snippets Groups Projects
Commit 5a72be78 authored by renchao.lu's avatar renchao.lu
Browse files

Merge branch 'petsc-runtime-fix' into 'master'

[cmake] Add petsc-lib path to RPATH.

See merge request ogs/ogs!3881
parents c33c20ab 4cdcdb05
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,7 @@ if(OGS_USE_PETSC)
BUILD_COMMAND make -j all
INSTALL_COMMAND make -j install
)
set(PETSC_DIR ${PROJECT_BINARY_DIR}/_ext/PETSc)
set(PETSC_DIR ${PROJECT_BINARY_DIR}/_ext/PETSc CACHE PATH "" FORCE)
find_package(PETSc ${ogs.minimum_version.petsc} REQUIRED)
endif()
......@@ -62,6 +62,11 @@ if(OGS_USE_PETSC)
target_include_directories(petsc INTERFACE ${PETSC_INCLUDES})
set_target_properties(petsc PROPERTIES IMPORTED_LOCATION ${PETSC_LIBRARIES})
target_compile_definitions(petsc INTERFACE USE_PETSC)
if(EXISTS ${PETSC_DIR}/lib)
message(STATUS "RPATH: Appending ${PETSC_DIR}/lib")
list(APPEND CMAKE_INSTALL_RPATH ${PETSC_DIR}/lib)
endif()
endif()
if(OGS_USE_LIS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment