gtsam_unstable as a separate package

release/4.3a0
Matthew Broadway 2019-02-08 15:34:09 +00:00
parent f6af989e67
commit a62197ec6e
5 changed files with 8 additions and 14 deletions

View File

@ -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")

1
cython/gtsam/__init__.py Normal file
View File

@ -0,0 +1 @@
from .gtsam import *

View File

@ -1,2 +0,0 @@
from .gtsam import *
${GTSAM_UNSTABLE_IMPORT}

View File

@ -0,0 +1,2 @@
from .gtsam_unstable import *

View File

@ -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/