diff --git a/gtsam/linear/CMakeLists.txt b/gtsam/linear/CMakeLists.txt index 802cb4d78..744151a8b 100644 --- a/gtsam/linear/CMakeLists.txt +++ b/gtsam/linear/CMakeLists.txt @@ -22,6 +22,11 @@ if (GTSAM_BUILD_TESTS) gtsam_add_subdir_tests(linear "${linear_local_libs}" "${gtsam-default}" "${linear_excluded_files}") endif(GTSAM_BUILD_TESTS) +if(MSVC) + set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/tests/testSerializationLinear.cpp" + APPEND PROPERTY COMPILE_FLAGS "/bigobj") +endif() + # Build timing scripts if (GTSAM_BUILD_TIMING) gtsam_add_subdir_timing(linear "${linear_local_libs}" "${gtsam-default}" "${linear_excluded_files}") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 74aa1e059..cc91ea4f3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,10 +21,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # might not be best test - Rich list (APPEND tests_exclude "${CMAKE_CURRENT_SOURCE_DIR}/testSerializationSLAM.cpp") endif() -if(MSVC) - add_definitions("/bigobj") # testSerializationSLAM needs this -endif() - # Build tests if (GTSAM_BUILD_TESTS) # Subdirectory target for tests @@ -50,3 +46,8 @@ if (GTSAM_BUILD_TIMING) "${tests_local_libs}" "${gtsam-default};CppUnitLite" "${tests_exclude}" # Pass in linking and exclusion lists ${is_test}) endif (GTSAM_BUILD_TIMING) + +if(MSVC) + set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/testSerializationSLAM.cpp" + APPEND PROPERTY COMPILE_FLAGS "/bigobj") +endif()