Skip to content

Commit 41dc097

Browse files
committed
start on cmake for gtsam
Signed-off-by: Jade Turner <[email protected]>
1 parent 266e4c2 commit 41dc097

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ if(WITH_DOCS)
145145
endif()
146146

147147
if(WITH_WPICAL)
148-
find_package(Ceres CONFIG REQUIRED)
148+
# find_package(Ceres CONFIG REQUIRED)
149+
find_package (SuiteSparse 5.12 NO_MODULE)
149150
endif()
150151

151152
find_package(LIBSSH CONFIG 0.7.1)

build.gradle

-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ allprojects {
3131
maven {
3232
url = 'https://frcmaven.wpi.edu/artifactory/ex-mvn'
3333
}
34-
maven {
35-
url = "https://maven.photonvision.org/snapshots"
36-
}
3734
}
3835
if (project.hasProperty('releaseMode')) {
3936
wpilibRepositories.addAllReleaseRepositories(it)

shared/gtsam.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ nativeUtils {
66
headerClassifier = "headers"
77
sourceClassifier = "sources"
88
ext = "zip"
9-
version = '4.3-1'
9+
version = '4.3-2'
1010
targetPlatforms.addAll(nativeUtils.wpi.platforms.desktopPlatforms)
1111
}
1212
}

wpical/CMakeLists.txt

+31-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ include(CompileWarnings)
44
include(GenResources)
55
include(LinkMacOSGUI)
66
include(AddTest)
7+
include(FetchContent)
8+
9+
find_package (SuiteSparse 5.12 NO_MODULE)
710

811
configure_file(src/main/generate/WPILibVersion.cpp.in WPILibVersion.cpp)
912
generate_resources(src/main/native/resources generated/main/cpp WPIcal wpical wpical_resources_src)
@@ -25,6 +28,26 @@ elseif(APPLE)
2528
set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
2629
endif()
2730

31+
set(GTSAM_COMPILE_OPTIONS_PRIVATE_DEBUG CACHE INTERNAL FORCE)
32+
set(GTSAM_COMPILE_OPTIONS_PRIVATE_RELWITHDEBINFO CACHE INTERNAL FORCE)
33+
set(GTSAM_ENABLE_BOOST_SERIALIZATION OFF)
34+
set(GTSAM_WITH_TBB OFF)
35+
set(GTSAM_USE_BOOST_FEATURES OFF)
36+
set(GTSAM_BUILD_PYTHON OFF)
37+
set(GTSAM_BUILD_EXAMPLES_ALWAYS OFF)
38+
set(GTSAM_BUILD_TESTS OFF)
39+
set(BUILD_SHARED_LIBS OFF)
40+
set(GTSAM_FORCE_SHARED_LIB OFF)
41+
set(GTSAM_FORCE_STATIC_LIB ON)
42+
43+
include(FetchContent)
44+
fetchcontent_declare(
45+
gtsam
46+
GIT_REPOSITORY https://github.com/mcm001/gtsam
47+
GIT_TAG c24ca7951f1db4cfe4e23f368b2eda503de72176
48+
)
49+
fetchcontent_makeavailable(gtsam)
50+
2851
add_executable(
2952
wpical
3053
${wpical_src}
@@ -38,7 +61,9 @@ wpilib_target_warnings(wpical)
3861
target_include_directories(
3962
wpical
4063
PRIVATE
64+
/usr/local/include/
4165
src/main/native/include
66+
src/main/native/thirdparty/mrcal/generated
4267
src/main/native/thirdparty/libdogleg/include
4368
src/main/native/thirdparty/mrcal/include
4469
src/main/native/thirdparty/mrcal_java/include
@@ -82,15 +107,16 @@ endif()
82107
target_compile_options(wpical PRIVATE ${compile_flags})
83108

84109
find_package(OpenCV REQUIRED)
85-
find_package(Ceres CONFIG REQUIRED)
86110
target_link_libraries(
87111
wpical
112+
gtsam
88113
apriltag
89114
${OpenCV_LIBS}
90115
wpigui
91116
wpiutil
92117
wpimath
93-
Ceres::ceres
118+
SuiteSparse::CHOLMOD
119+
# Ceres::ceres
94120
)
95121

96122
if(WIN32)
@@ -120,11 +146,13 @@ if(WITH_TESTS)
120146
)
121147
target_link_libraries(
122148
wpical_test
149+
gtsam
123150
googletest
124151
apriltag
125152
${OpenCV_LIBS}
126153
wpigui
127154
wpiutil
128-
Ceres::ceres
155+
SuiteSparse::CHOLMOD
156+
# Ceres::ceres
129157
)
130158
endif()

0 commit comments

Comments
 (0)