diff --git a/cython/CMakeLists.txt b/cython/CMakeLists.txt index 317fb7e2d..c2d38fd47 100644 --- a/cython/CMakeLists.txt +++ b/cython/CMakeLists.txt @@ -22,19 +22,16 @@ if (GTSAM_INSTALL_CYTHON_TOOLBOX) set(GTSAM_UNSTABLE_IMPORT "from .gtsam_unstable import *") wrap_and_install_library_cython("../gtsam_unstable/gtsam_unstable.h" # interface_header "from gtsam.gtsam cimport *" # extra imports - "${GTSAM_CYTHON_INSTALL_PATH}/gtsam" # install path + "${GTSAM_CYTHON_INSTALL_PATH}/gtsam_unstable" # install path gtsam_unstable # library to link with "gtsam_unstable;gtsam_unstable_header;cythonize_gtsam" # dependencies to be built before wrapping ) - # for some reasons cython gtsam_unstable can't find gtsam/gtsam.pxd without doing this - file(WRITE ${PROJECT_BINARY_DIR}/cython/gtsam_unstable/__init__.py "") endif() # Install the custom-generated __init__.py # This is to make the build/cython/gtsam folder a python package, so gtsam can be found while wrapping gtsam_unstable - configure_file(${PROJECT_SOURCE_DIR}/cython/gtsam/__init__.py.in ${PROJECT_BINARY_DIR}/cython/gtsam/__init__.py) configure_file(${PROJECT_SOURCE_DIR}/cython/setup.py.in ${PROJECT_BINARY_DIR}/cython/setup.py) - install_cython_files("${PROJECT_BINARY_DIR}/cython/gtsam/__init__.py" "${GTSAM_CYTHON_INSTALL_PATH}/gtsam") + install_cython_files("${PROJECT_BINARY_DIR}/cython/setup.py" "${GTSAM_CYTHON_INSTALL_PATH}/") # install scripts and tests install_cython_scripts("${PROJECT_SOURCE_DIR}/cython/gtsam" "${GTSAM_CYTHON_INSTALL_PATH}" "*.py") diff --git a/cython/gtsam/__init__.py b/cython/gtsam/__init__.py new file mode 100644 index 000000000..9bda86efe --- /dev/null +++ b/cython/gtsam/__init__.py @@ -0,0 +1 @@ +from .gtsam import * diff --git a/cython/gtsam/__init__.py.in b/cython/gtsam/__init__.py.in deleted file mode 100644 index 85451c680..000000000 --- a/cython/gtsam/__init__.py.in +++ /dev/null @@ -1,2 +0,0 @@ -from .gtsam import * -${GTSAM_UNSTABLE_IMPORT} diff --git a/cython/gtsam_unstable/__init__.py b/cython/gtsam_unstable/__init__.py new file mode 100644 index 000000000..04ce7f1e0 --- /dev/null +++ b/cython/gtsam_unstable/__init__.py @@ -0,0 +1,2 @@ +from .gtsam_unstable import * + diff --git a/cython/setup.py.in b/cython/setup.py.in index e99bd5de1..e72dbd7c1 100644 --- a/cython/setup.py.in +++ b/cython/setup.py.in @@ -1,18 +1,14 @@ import os try: - from setuptools import setup + from setuptools import setup, find_packages except ImportError: - from distutils.core import setup + from distutils.core import setup, find_packages -packages = ['gtsam', 'gtsam_eigency'] -if ${GTSAM_BUILD_UNSTABLE}: - packages += 'gtsam_unstable' - +packages = find_packages() setup( name='gtsam', - description='Georgia Tech Smoothing And Mapping library', url='https://bitbucket.org/gtborg/gtsam', version='${GTSAM_VERSION_STRING}', # https://www.python.org/dev/peps/pep-0440/