commit
e59f898e10
|
@ -87,6 +87,15 @@ endfunction()
|
||||||
# - output_dir: The output directory
|
# - output_dir: The output directory
|
||||||
function(build_cythonized_cpp target cpp_file output_lib_we output_dir)
|
function(build_cythonized_cpp target cpp_file output_lib_we output_dir)
|
||||||
add_library(${target} MODULE ${cpp_file})
|
add_library(${target} MODULE ${cpp_file})
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
# Use .pyd extension instead of .dll on Windows
|
||||||
|
set_target_properties(${target} PROPERTIES SUFFIX ".pyd")
|
||||||
|
|
||||||
|
# Add full path to the Python library
|
||||||
|
target_link_libraries(${target} ${PYTHON_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(link_flags "-undefined dynamic_lookup")
|
set(link_flags "-undefined dynamic_lookup")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -7,6 +7,11 @@ if (GTSAM_INSTALL_CYTHON_TOOLBOX)
|
||||||
add_subdirectory(gtsam_eigency)
|
add_subdirectory(gtsam_eigency)
|
||||||
include_directories(${PROJECT_BINARY_DIR}/cython/gtsam_eigency)
|
include_directories(${PROJECT_BINARY_DIR}/cython/gtsam_eigency)
|
||||||
|
|
||||||
|
# Fix for error "C1128: number of sections exceeded object file format limit"
|
||||||
|
if(MSVC)
|
||||||
|
add_compile_options(/bigobj)
|
||||||
|
endif()
|
||||||
|
|
||||||
# wrap gtsam
|
# wrap gtsam
|
||||||
add_custom_target(gtsam_header DEPENDS "../gtsam.h")
|
add_custom_target(gtsam_header DEPENDS "../gtsam.h")
|
||||||
wrap_and_install_library_cython("../gtsam.h" # interface_header
|
wrap_and_install_library_cython("../gtsam.h" # interface_header
|
||||||
|
|
|
@ -35,7 +35,7 @@ setup(
|
||||||
|
|
||||||
packages=packages,
|
packages=packages,
|
||||||
package_data={package:
|
package_data={package:
|
||||||
[f for f in os.listdir(package.replace('.', os.path.sep)) if os.path.splitext(f)[1] in ('.so', '.dll')]
|
[f for f in os.listdir(package.replace('.', os.path.sep)) if os.path.splitext(f)[1] in ('.so', '.pyd')]
|
||||||
for package in packages
|
for package in packages
|
||||||
},
|
},
|
||||||
install_requires=[line.strip() for line in '''
|
install_requires=[line.strip() for line in '''
|
||||||
|
|
Loading…
Reference in New Issue