Skip to content

Commit aed5c08

Browse files
Merge pull request #632 from TimPushkin/cmake-options
Replace CACHE-BOOLs with options
2 parents d9234ce + f481c6f commit aed5c08

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

CMakeLists.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ endif()
150150

151151
# Eigen library parallelise itself, though, presumably due to performance issues
152152
# OPENMP is experimental. We experienced some slowdown with it
153-
set(G2O_USE_OPENMP OFF CACHE BOOL "Build g2o with OpenMP support (EXPERIMENTAL)")
153+
option(G2O_USE_OPENMP "Build g2o with OpenMP support (EXPERIMENTAL)" OFF)
154154
if(G2O_USE_OPENMP)
155155
find_package(OpenMP)
156156
if(OPENMP_FOUND)
@@ -167,7 +167,7 @@ set(OpenGL_GL_PREFERENCE "GLVND")
167167
find_package(OpenGL)
168168

169169
# If OpenGL was found, use the import target if available. If not, use old-style includes
170-
set(G2O_USE_OPENGL ON CACHE BOOL "Build g2o with OpenGL support for visualization")
170+
option(G2O_USE_OPENGL "Build g2o with OpenGL support for visualization" ON)
171171
if (OPENGL_FOUND AND G2O_USE_OPENGL)
172172
if (TARGET OpenGL::GL)
173173
set(G2O_OPENGL_TARGET "OpenGL::GL;OpenGL::GLU")
@@ -185,16 +185,16 @@ find_package(QGLViewer)
185185

186186
# The Ceres package is required for some of the solvers.
187187
# Ceres is vendored in g2o/EXTERNAL/ceres, or the system's can be used.
188-
set(G2O_USE_VENDORED_CERES ON CACHE BOOL "Use vendored Ceres from g2o/EXTERNAL/ceres")
188+
option(G2O_USE_VENDORED_CERES "Use vendored Ceres from g2o/EXTERNAL/ceres" ON)
189189

190190
# Handle building the built in types. There is a fair degree of
191191
# granularity and dependency in the types supported.
192192

193193
# 2D types
194-
set(G2O_BUILD_SLAM2D_TYPES ON CACHE BOOL "Build SLAM2D types")
195-
set(G2O_BUILD_SLAM2D_ADDON_TYPES ON CACHE BOOL "Build SLAM2D addon types")
196-
set(G2O_BUILD_DATA_TYPES ON CACHE BOOL "Build SLAM2D data types")
197-
set(G2O_BUILD_SCLAM2D_TYPES ON CACHE BOOL "Build SCLAM2D types")
194+
option(G2O_BUILD_SLAM2D_TYPES "Build SLAM2D types" ON)
195+
option(G2O_BUILD_SLAM2D_ADDON_TYPES "Build SLAM2D addon types" ON)
196+
option(G2O_BUILD_DATA_TYPES "Build SLAM2D data types" ON)
197+
option(G2O_BUILD_SCLAM2D_TYPES "Build SCLAM2D types" ON)
198198

199199
# Process the arguments. If G2O_BUILD_SLAM2D_TYPES is disabled, forceably
200200
# disable all types. Otherwise, update messages on the types enabled.
@@ -217,11 +217,11 @@ else()
217217
endif()
218218

219219
# 3D types
220-
set(G2O_BUILD_SLAM3D_TYPES ON CACHE BOOL "Build SLAM 3D types")
221-
set(G2O_BUILD_SLAM3D_ADDON_TYPES ON CACHE BOOL "Build SLAM 3D addon types")
222-
set(G2O_BUILD_SBA_TYPES ON CACHE BOOL "Build SLAM3D SBA types")
223-
set(G2O_BUILD_ICP_TYPES ON CACHE BOOL "Build SLAM3D ICP types")
224-
set(G2O_BUILD_SIM3_TYPES ON CACHE BOOL "Build SLAM3D sim3 types")
220+
option(G2O_BUILD_SLAM3D_TYPES "Build SLAM 3D types" ON)
221+
option(G2O_BUILD_SLAM3D_ADDON_TYPES "Build SLAM 3D addon types" ON)
222+
option(G2O_BUILD_SBA_TYPES "Build SLAM3D SBA types" ON)
223+
option(G2O_BUILD_ICP_TYPES "Build SLAM3D ICP types" ON)
224+
option(G2O_BUILD_SIM3_TYPES "Build SLAM3D sim3 types" ON)
225225

226226
# Process the arguments. If G2O_BUILD_SLAM3D_TYPES is disabled, forceably
227227
# disable all the types. Enable SBA if it's not enabled but one of it's
@@ -265,7 +265,7 @@ else()
265265
endif()
266266

267267
# shall we build the core apps using the library
268-
set(G2O_BUILD_APPS ON CACHE BOOL "Build g2o apps")
268+
option(G2O_BUILD_APPS "Build g2o apps" ON)
269269
if(G2O_BUILD_APPS)
270270
message(STATUS "Compiling g2o apps")
271271
endif(G2O_BUILD_APPS)
@@ -275,7 +275,7 @@ CMAKE_DEPENDENT_OPTION(G2O_BUILD_LINKED_APPS "Build apps linked with the librari
275275
"G2O_BUILD_APPS" OFF)
276276

277277
# shall we build the examples
278-
set(G2O_BUILD_EXAMPLES ON CACHE BOOL "Build g2o examples")
278+
option(G2O_BUILD_EXAMPLES "Build g2o examples" ON)
279279
if(G2O_BUILD_EXAMPLES)
280280
message(STATUS "Compiling g2o examples")
281281
endif(G2O_BUILD_EXAMPLES)
@@ -304,7 +304,7 @@ macro(DEFINE_SSE_VAR _setname)
304304
endif()
305305
else (DO_SSE_AUTODETECT)
306306
# Manual:
307-
set("DISABLE_${_setname}" OFF CACHE BOOL "Forces compilation WITHOUT ${_setname} extensions")
307+
option("DISABLE_${_setname}" "Forces compilation WITHOUT ${_setname} extensions" OFF)
308308
mark_as_advanced("DISABLE_${_setname}")
309309
set(CMAKE_G2O_HAS_${_setname} 0)
310310
if (NOT DISABLE_${_setname})

0 commit comments

Comments
 (0)