FindPETSC.cmake: PETSC_LIBRARIES variables are not absolute paths.
On Plafrim result of using find_package(PETSc REQUIRED COMPONENTS CXX)
with a local installation of PETSc is:
${PETSC_LIBRARIES}=petsc;blas;X11;dl;mpi_usempi_ignore_tkr;mpi;m;m;quadmath;stdc++;
I wonder why there is no absolute path.
Because on the cmake documentation about link_directories
we can read:
Prefer to pass full absolute paths to libraries where possible, since this ensures the correct library will always be linked.
And on the old documentation even:
Library locations returned by find_package() and find_library() are absolute paths.
but this may have change ?
Am I incorrect to expect PETSC_LIBRARIES
to be fill with absolute path ?
And if so, how to correctly link against petsc library ?
something like:
find_package(PETSc REQUIRED COMPONENTS CXX)
include_directories(${PETSC_INCLUDE_DIRS})
link_directories(${PETSC_LIBRARY_DIRS})
target_link_libraries(${PROJECTNAME} ${PETSC_LIBRARIES})