Skip to content

Commit b39d56e

Browse files
hollowsunhcPatrick Laurin
authored andcommitted
refactor: Link to SuiteSparse targets
1 parent ca6ca18 commit b39d56e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

deps/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ endif()
135135
if(SUITESPARSE AND SUITESPARSE_FOUND)
136136
SET(GC_HAVE_SUITESPARSE TRUE)
137137
SET(GC_HAVE_SUITESPARSE TRUE PARENT_SCOPE)
138-
set(SUITESPARSE_INCLUDE_DIRS "${SUITESPARSE_INCLUDE_DIRS}" PARENT_SCOPE)
139-
set(SUITESPARSE_LIBRARIES "${SUITESPARSE_LIBRARIES}" PARENT_SCOPE)
138+
if(NOT TARGET SuiteSparse::spqr)
139+
message(FATAL_ERROR "SuiteSparse::spqr target not found.")
140+
endif()
141+
set_target_properties(SuiteSparse::spqr PROPERTIES IMPORTED_GLOBAL TRUE)
140142
else()
141143
SET(GC_HAVE_SUITESPARSE FALSE)
142144
SET(GC_HAVE_SUITESPARSE FALSE PARENT_SCOPE)

src/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ target_compile_definitions(geometry-central PUBLIC NOMINMAX _USE_MATH_DEFINES)
187187
# Define CMAKE flag used in these sources (but should be kept OUT of headers)
188188
if(GC_HAVE_SUITESPARSE)
189189
target_compile_definitions(geometry-central PUBLIC GC_HAVE_SUITESPARSE)
190-
target_include_directories(geometry-central PRIVATE ${SUITESPARSE_INCLUDE_DIRS})
191-
target_link_libraries(geometry-central PRIVATE ${SUITESPARSE_LIBRARIES})
190+
target_link_libraries(geometry-central PRIVATE SuiteSparse::spqr)
192191
endif()
193192

194193
# Export symbols if DLL is requested

0 commit comments

Comments
 (0)