diff --git a/CMakeLists.txt b/CMakeLists.txt index b19ece0e6..6fc456609 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,17 +60,6 @@ include(cmake/HandleGlobalBuildFlags.cmake) # Build flags # Build CppUnitLite add_subdirectory(CppUnitLite) -# This is the new wrapper -if(GTSAM_BUILD_PYTHON) - # Need to set this for the wrap package so we don't use the default value. - set(WRAP_PYTHON_VERSION ${GTSAM_PYTHON_VERSION} - CACHE STRING "The Python version to use for wrapping") - - add_subdirectory(wrap) - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/wrap/cmake") - add_subdirectory(python) -endif() - # Build GTSAM library add_subdirectory(gtsam) @@ -88,8 +77,22 @@ if (GTSAM_BUILD_UNSTABLE) add_subdirectory(gtsam_unstable) endif() +# This is the new wrapper +if(GTSAM_BUILD_PYTHON OR GTSAM_INSTALL_MATLAB_TOOLBOX) + # Need to set this for the wrap package so we don't use the default value. + set(WRAP_PYTHON_VERSION ${GTSAM_PYTHON_VERSION} + CACHE STRING "The Python version to use for wrapping") + add_subdirectory(wrap) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/wrap/cmake") +endif() + +# Python toolbox +if(GTSAM_BUILD_PYTHON) + add_subdirectory(python) +endif() + # Matlab toolbox -if (GTSAM_INSTALL_MATLAB_TOOLBOX) +if(GTSAM_INSTALL_MATLAB_TOOLBOX) add_subdirectory(matlab) endif() diff --git a/matlab/CMakeLists.txt b/matlab/CMakeLists.txt index 1e7e88612..5de7ebac0 100644 --- a/matlab/CMakeLists.txt +++ b/matlab/CMakeLists.txt @@ -58,8 +58,7 @@ if(NOT BUILD_SHARED_LIBS) list(APPEND mexFlags -DGTSAM_IMPORT_STATIC) endif() -set(ignore gtsam::Point2 gtsam::Point3 gtsam::BearingRangeFactor - gtsam::BearingRangeFactor2D gtsam::BearingRangeFactorPose2) +set(ignore gtsam::Point2 gtsam::Point3) # Wrap matlab_wrap(${GTSAM_SOURCE_DIR}/gtsam/gtsam.i "${GTSAM_ADDITIONAL_LIBRARIES}"