Official development repository for SUNDIALS - a SUite of Nonlinear and DIfferential/ALgebraic equation Solvers. Pull requests are welcome for bug fixes and minor changes.
get_target_property(klu_aliased_target SuiteSparse::KLU ALIASED_TARGET)
if (klu_aliased_target)
add_library(SUNDIALS::KLU ALIAS ${klu_aliased_target})
else()
add_library(SUNDIALS::KLU ALIAS SuiteSparse::KLU)
endif()
Current Behavior:
Configuring sundials with KLU fails with
Expected Behavior:
Configuring succeeds.
Steps To Reproduce:
BUILD_SHARED_LIBS=OFF
CMAKE_PREFIX_PATH
so the SuiteSparse CMake config can be found-DENABLE_KLU=ON
(and not setting anyKLU_*
)Environment:
Anything else:
Here, sundials tries to create an ALIAS target
SUNDIALS::KLU
forSuiteSparse::KLU
:https://github.com/LLNL/sundials/blob/c28eaa3764a03705d61decb6025b409360e9d53f/cmake/tpl/FindKLU.cmake#L33-L40
This works as long as
SuiteSparse::KLU
is not an alias target itself.However, for a SuiteSparse static-only build,
SuiteSparse::KLU
is already an ALIAS ofSuiteSparse::KLU_static
:https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/c8c3a9de1c8eef54da5ff19fd0bcf7ca6e8bc9de/KLU/Config/KLUConfig.cmake.in#L113-L116
Proposed fix:
Replace
https://github.com/LLNL/sundials/blob/c28eaa3764a03705d61decb6025b409360e9d53f/cmake/tpl/FindKLU.cmake#L40
by