diff --git a/CMakeLists.txt b/CMakeLists.txt index 52b34101f..4a72854a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,19 @@ 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) +option(GTSAM_USE_BOOST_FEATURES "Enable Features that use Boost" OFF) +# 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() + +if(GTSAM_USE_BOOST_FEATURES) + add_definitions(-DGTSAM_USE_BOOST_FEATURES) +endif() + include(cmake/HandleGeneralOptions.cmake) # CMake build options # Libraries: diff --git a/gtsam_unstable/discrete/tests/CMakeLists.txt b/gtsam_unstable/discrete/tests/CMakeLists.txt index 2687a760c..1b66e5c85 100644 --- a/gtsam_unstable/discrete/tests/CMakeLists.txt +++ b/gtsam_unstable/discrete/tests/CMakeLists.txt @@ -1 +1,6 @@ -gtsamAddTestsGlob(discrete_unstable "test*.cpp" "" "gtsam_unstable") +set(excluded_sources "") +if (NOT GTSAM_USE_BOOST_FEATURES) + list(APPEND excluded_sources "testScheduler.cpp") +endif() + +gtsamAddTestsGlob(discrete_unstable "test*.cpp" "${excluded_sources}" "gtsam_unstable") diff --git a/gtsam_unstable/linear/tests/CMakeLists.txt b/gtsam_unstable/linear/tests/CMakeLists.txt index 43df23daa..b2cda1811 100644 --- a/gtsam_unstable/linear/tests/CMakeLists.txt +++ b/gtsam_unstable/linear/tests/CMakeLists.txt @@ -1 +1,10 @@ -gtsamAddTestsGlob(linear_unstable "test*.cpp" "" "gtsam_unstable") +# if GTSAM_USE_BOOST_FEATURES is OFF then exclude some tests +if (NOT GTSAM_USE_BOOST_FEATURES) + # create a semicolon seperated list of files to exclude + set(EXCLUDE_TESTS "testQPSolver.cpp") + message(STATUS "Excluding ${EXCLUDE_TESTS}") +else() + set(EXCLUDE_TESTS "${EXCLUDE_TESTS}") +endif() + +gtsamAddTestsGlob(linear_unstable "test*.cpp" "${EXCLUDE_TESTS}" "gtsam_unstable")