Better location for setting Python dataset directory in CMake
parent
3674b9c65f
commit
ac3e564293
|
@ -428,14 +428,6 @@ add_subdirectory(CppUnitLite)
|
|||
if(GTSAM_BUILD_PYTHON)
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/wrap/cmake")
|
||||
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()
|
||||
|
||||
# Build GTSAM library
|
||||
|
|
|
@ -4,6 +4,17 @@ if (NOT GTSAM_BUILD_PYTHON)
|
|||
return()
|
||||
endif()
|
||||
|
||||
# Common directory for storing data stored with the package.
|
||||
# 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.
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
# Easy directory with write access.
|
||||
set(GTSAM_PYTHON_DATASET_DIR "/tmp/gtsam_example_data")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
# %LocalAppData% directory in Windows.
|
||||
set(GTSAM_PYTHON_DATASET_DIR "$ENV{LOCALAPPDATA}/gtsam_example_data")
|
||||
endif()
|
||||
|
||||
# Generate setup.py.
|
||||
file(READ "${PROJECT_SOURCE_DIR}/README.md" README_CONTENTS)
|
||||
configure_file(${PROJECT_SOURCE_DIR}/python/setup.py.in
|
||||
|
|
Loading…
Reference in New Issue