blob: b3917ec5525aec17e522db2e448191fb3e09ffea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2b0a09..08bd944 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -95,7 +95,7 @@ endif()
# For building the CHOLMOD based solvers
option(G2O_USE_CHOLMOD "Build g2o with CHOLMOD support" ON)
-find_package(SuiteSparse)
+find_package(SuiteSparse_CHOLMOD NAMES CHOLMOD CONFIG REQUIRED)
if (G2O_USE_CHOLMOD AND SuiteSparse_CHOLMOD_FOUND)
message(STATUS "Enable support for Cholmod")
set(CHOLMOD_FOUND TRUE)
@@ -128,7 +128,8 @@ endif()
# For building the CSparse based solvers. Note this depends on an LGPL library.
option(G2O_USE_CSPARSE "Build g2o with CSParse support" ON)
-find_package(CSparse)
+find_package(CSPARSE NAMES CXSparse REQUIRED)
+set(CSPARSE_LIBRARY SuiteSparse::CXSparse)
if (${G2O_USE_CSPARSE} AND ${CSPARSE_FOUND} AND ${G2O_USE_LGPL_LIBS})
message(STATUS "Enable support for CSparse")
else()
diff --git a/cmake_modules/Config.cmake.in b/cmake_modules/Config.cmake.in
index efeb3bd..f8ab1ad 100644
--- a/cmake_modules/Config.cmake.in
+++ b/cmake_modules/Config.cmake.in
@@ -1,4 +1,6 @@
include(CMakeFindDependencyMacro)
+find_dependency(CHOLMOD CONFIG)
+find_dependency(CXSparse CONFIG)
find_dependency(Eigen3)
|