Define dataset directory for Python package

release/4.3a0
Varun Agrawal 2020-08-31 09:50:10 -04:00
parent 39aeae657e
commit 13d33e0f51
2 changed files with 9 additions and 0 deletions

View File

@ -428,6 +428,14 @@ add_subdirectory(CppUnitLite)
if(GTSAM_BUILD_PYTHON) if(GTSAM_BUILD_PYTHON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/wrap/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/wrap/cmake")
add_subdirectory(python) add_subdirectory(python)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# Common directory which always has write access
# This is because the exact location of the Python installation may vary
# depending on various factors such as python version and use of virtual envs.
set(GTSAM_PYTHON_DATASET_DIR "/tmp/gtsam_example_data")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(GTSAM_PYTHON_DATASET_DIR "$ENV{LOCALAPPDATA}/gtsam_example_data")
endif()
endif() endif()
# Build GTSAM library # Build GTSAM library

View File

@ -27,6 +27,7 @@
// Paths to example datasets distributed with GTSAM // Paths to example datasets distributed with GTSAM
#define GTSAM_SOURCE_TREE_DATASET_DIR "@GTSAM_SOURCE_DIR@/examples/Data" #define GTSAM_SOURCE_TREE_DATASET_DIR "@GTSAM_SOURCE_DIR@/examples/Data"
#define GTSAM_INSTALLED_DATASET_DIR "@GTSAM_TOOLBOX_INSTALL_PATH@/gtsam_examples/Data" #define GTSAM_INSTALLED_DATASET_DIR "@GTSAM_TOOLBOX_INSTALL_PATH@/gtsam_examples/Data"
#define GTSAM_PYTHON_DATASET_DIR "@GTSAM_PYTHON_DATASET_DIR"
// Whether GTSAM is compiled to use quaternions for Rot3 (otherwise uses rotation matrices) // Whether GTSAM is compiled to use quaternions for Rot3 (otherwise uses rotation matrices)
#cmakedefine GTSAM_USE_QUATERNIONS #cmakedefine GTSAM_USE_QUATERNIONS