Skip to content
Snippets Groups Projects
Commit 1ac52e06 authored by Markus Blatt's avatar Markus Blatt
Browse files

[cmake,release] Also use libscotch when linking with PTScotch.

Without it linking will fail when using static libraries due
to missing symbols.
parent c5739a27
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@
function(add_dune_ptscotch_flags _targets)
if(PTSCOTCH_FOUND)
foreach(_target ${_targets})
target_link_libraries(${_target} ${PTSCOTCH_LIBRARY} ${PTSCOTCHERR_LIBRARY})
target_link_libraries(${_target} ${PTSCOTCH_LIBRARY} ${SCOTCH_LIBRARY} ${PTSCOTCHERR_LIBRARY})
GET_TARGET_PROPERTY(_props ${_target} INCLUDE_DIRECTORIES)
string(REPLACE "_props-NOTFOUND" "" _props "${_props}")
SET_TARGET_PROPERTIES(${_target} PROPERTIES INCLUDE_DIRECTORIES
......
......@@ -47,6 +47,7 @@ find_path(PTSCOTCH_INCLUDE_DIR ptscotch.h
PATH_SUFFIXES ${PATH_SUFFIXES})
_search_pt_lib(PTSCOTCH_LIBRARY ptscotch "The main PT-Scotch library.")
_search_pt_lib(SCOTCH_LIBRARY scotch "The Scotch library.")
_search_pt_lib(PTSCOTCHERR_LIBRARY ptscotcherr "The PT-Scotch error library.")
# behave like a CMake module is supposed to behave
......@@ -56,6 +57,7 @@ find_package_handle_standard_args(
DEFAULT_MSG
PTSCOTCH_INCLUDE_DIR
PTSCOTCH_LIBRARY
SCOTCH_LIBRARY
PTSCOTCHERR_LIBRARY
)
#restore old values
......@@ -63,7 +65,7 @@ cmake_pop_check_state()
if(PTSCOTCH_FOUND)
set(PTSCOTCH_INCLUDE_DIRS ${PTSCOTCH_INCLUDE_DIR})
set(PTSCOTCH_LIBRARIES ${PTSCOTCH_LIBRARY} ${PTSCOTCHERR_LIBRARY} ${MPI_DUNE_LIBRARIES}
set(PTSCOTCH_LIBRARIES ${PTSCOTCH_LIBRARY} ${SCOTCH_LIBRARY} ${PTSCOTCHERR_LIBRARY} ${MPI_DUNE_LIBRARIES}
CACHE FILEPATH "All libraries needed to link programs using PT-Scotch")
set(PTSCOCH_LINK_FLAGS "${DUNE_MPI_LINK_FLAGS}"
CACHE STRING "PT-Scotch link flags")
......
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