diff --git a/cmake/GtsamCythonWrap.cmake b/cmake/GtsamCythonWrap.cmake index c3cad9d83..e963a0d9c 100644 --- a/cmake/GtsamCythonWrap.cmake +++ b/cmake/GtsamCythonWrap.cmake @@ -5,13 +5,17 @@ unset(PYTHON_EXECUTABLE CACHE) unset(CYTHON_EXECUTABLE CACHE) unset(PYTHON_INCLUDE_DIR CACHE) unset(PYTHON_MAJOR_VERSION CACHE) +unset(PYTHON_LIBRARY CACHE) -if(GTSAM_PYTHON_VERSION STREQUAL "Default") - find_package(PythonInterp REQUIRED) - find_package(PythonLibs REQUIRED) -else() - find_package(PythonInterp ${GTSAM_PYTHON_VERSION} EXACT REQUIRED) - find_package(PythonLibs ${GTSAM_PYTHON_VERSION} EXACT REQUIRED) +# Allow override from command line +if(NOT DEFINED GTSAM_USE_CUSTOM_PYTHON_LIBRARY) + if(GTSAM_PYTHON_VERSION STREQUAL "Default") + find_package(PythonInterp REQUIRED) + find_package(PythonLibs REQUIRED) + else() + find_package(PythonInterp ${GTSAM_PYTHON_VERSION} EXACT REQUIRED) + find_package(PythonLibs ${GTSAM_PYTHON_VERSION} EXACT REQUIRED) + endif() endif() find_package(Cython 0.25.2 REQUIRED) diff --git a/cython/setup.py.in b/cython/setup.py.in index c35e54079..127eb9c3f 100644 --- a/cython/setup.py.in +++ b/cython/setup.py.in @@ -5,15 +5,6 @@ try: except ImportError: from distutils.core import setup, find_packages -if 'SETUP_PY_NO_CHECK' not in os.environ: - script_path = os.path.abspath(os.path.realpath(__file__)) - install_path = os.path.abspath(os.path.realpath(os.path.join('${GTSAM_CYTHON_INSTALL_PATH}${GTSAM_BUILD_TAG}', 'setup.py'))) - if script_path != install_path: - print('setup.py is being run from an unexpected location: "{}"'.format(script_path)) - print('please run `make install` and run the script from there') - sys.exit(1) - - packages = find_packages() setup( diff --git a/gtsam/3rdparty/metis/CMakeLists.txt b/gtsam/3rdparty/metis/CMakeLists.txt index 8ff69dde3..de46165ff 100644 --- a/gtsam/3rdparty/metis/CMakeLists.txt +++ b/gtsam/3rdparty/metis/CMakeLists.txt @@ -34,6 +34,11 @@ else() set(METIS_LIBRARY_TYPE STATIC) endif() +# Allow a static METIS while building GTSAM as dynamic +if(BUILD_STATIC_METIS) + set(METIS_LIBRARY_TYPE STATIC) +endif() + include(${GKLIB_PATH}/GKlibSystem.cmake) # Add include directories. include_directories(${GKLIB_PATH})