diff --git a/CMakeLists.txt b/CMakeLists.txt index eb79600e1..52b34101f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,14 +48,6 @@ if(${GTSAM_SOURCE_DIR} STREQUAL ${GTSAM_BINARY_DIR}) message(FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt. ") endif() -# TODO(kartikarcot): Determine a proper home for this option -# a flag to enable or disable serialization with GTSAM_ENABLE_BOOST_SERIALIZATION -option(GTSAM_ENABLE_BOOST_SERIALIZATION "Enable Boost serialization" ON) -# set a compiler flag to enable or disable serialization with GTSAM_DISABLE_BOOST_SERIALIZATION -if(GTSAM_ENABLE_BOOST_SERIALIZATION) - add_definitions(-DGTSAM_ENABLE_BOOST_SERIALIZATION) -endif() - include(cmake/HandleGeneralOptions.cmake) # CMake build options # Libraries: diff --git a/cmake/HandleGeneralOptions.cmake b/cmake/HandleGeneralOptions.cmake index 64fa6b407..266da7ca1 100644 --- a/cmake/HandleGeneralOptions.cmake +++ b/cmake/HandleGeneralOptions.cmake @@ -29,6 +29,7 @@ option(GTSAM_ALLOW_DEPRECATED_SINCE_V43 "Allow use of methods/functions depr option(GTSAM_SUPPORT_NESTED_DISSECTION "Support Metis-based nested dissection" ON) option(GTSAM_TANGENT_PREINTEGRATION "Use new ImuFactor with integration on tangent space" ON) option(GTSAM_SLOW_BUT_CORRECT_BETWEENFACTOR "Use the slower but correct version of BetweenFactor" OFF) +option(GTSAM_ENABLE_BOOST_SERIALIZATION "Enable Boost serialization" ON) if(NOT MSVC AND NOT XCODE_VERSION) option(GTSAM_BUILD_WITH_CCACHE "Use ccache compiler cache" ON) endif() diff --git a/gtsam/config.h.in b/gtsam/config.h.in index 7f8936d1e..fd71f5d89 100644 --- a/gtsam/config.h.in +++ b/gtsam/config.h.in @@ -83,3 +83,6 @@ // Toggle switch for BetweenFactor jacobian computation #cmakedefine GTSAM_SLOW_BUT_CORRECT_BETWEENFACTOR + +// Toggle Boost serialization definitions +#cmakedefine GTSAM_ENABLE_BOOST_SERIALIZATION