Skip to content

Commit

Permalink
Export SUITESPARSE CCOLAMD target
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed Dec 9, 2022
1 parent 2ae878a commit d643a79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions fuse_constraints/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
${geometry_msgs_TARGETS}
pluginlib::pluginlib
rclcpp::rclcpp
)
target_link_libraries(${PROJECT_NAME} PRIVATE
SuiteSparse::CCOLAMD
)

Expand Down
9 changes: 8 additions & 1 deletion fuse_constraints/cmake/FindSUITESPARSE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Author: alexs.mac@gmail.com (Alex Stewart)
#

# FindSuiteSparse.cmake - Find SuiteSparse libraries & dependencies.
# FindSUITESPARSE.cmake - Find SuiteSparse libraries & dependencies.
#
# This module defines the following variables:
#
Expand Down Expand Up @@ -496,6 +496,13 @@ if(SUITESPARSE_FOUND)
REQUIRED_VARS ${SUITESPARSE_FOUND_REQUIRED_VARS}
VERSION_VAR SUITESPARSE_VERSION
FAIL_MESSAGE "Failed to find some/all required components of SuiteSparse.")

# We export an alias target for CCOLAMD since we're not actually using the CMakeLists from the lib
# https://github.com/sergiud/SuiteSparse/blob/cmake/CMakeLists.txt#L778
add_library(ccolamd UNKNOWN IMPORTED)
target_link_libraries(ccolamd INTERFACE ${SUITESPARSE_LIBRARIES})
target_include_directories(ccolamd INTERFACE ${SUITESPARSE_INCLUDE_DIRS})
add_library(SuiteSparse::CCOLAMD ALIAS ccolamd)
else()
# Do not pass VERSION_VAR to FindPackageHandleStandardArgs() if we failed to
# find SuiteSparse to avoid a confusing autogenerated failure message
Expand Down

0 comments on commit d643a79

Please sign in to comment.