Merged in fix/python_hide_library_rebased (pull request #288)
[python] Make python library hidden by renaming gtsampy.so to _gtsampy.sorelease/4.3a0
commit
2a7c64d4a8
|
@ -1 +1 @@
|
|||
from gtsampy import *
|
||||
from _gtsampy import *
|
||||
|
|
|
@ -12,7 +12,7 @@ endforeach()
|
|||
add_library(gtsam_python SHARED exportgtsam.cpp ${gtsam_python_srcs})
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type_toupper)
|
||||
set_target_properties(gtsam_python PROPERTIES
|
||||
OUTPUT_NAME gtsampy
|
||||
OUTPUT_NAME _gtsampy
|
||||
PREFIX ""
|
||||
${build_type_toupper}_POSTFIX ""
|
||||
SKIP_BUILD_RPATH TRUE
|
||||
|
@ -31,11 +31,11 @@ target_link_libraries(gtsam_python
|
|||
|
||||
# Cause the library to be output in the correct directory.
|
||||
# TODO: Change below to work on different systems (currently works only with Linux)
|
||||
set(output_path ${CMAKE_CURRENT_BINARY_DIR}/../gtsam/_libgtsam_python.so)
|
||||
set(output_path ${CMAKE_CURRENT_BINARY_DIR}/../gtsam/_gtsampy.so)
|
||||
add_custom_command(
|
||||
OUTPUT ${output_path}
|
||||
DEPENDS gtsam_python
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:gtsam_python> ${output_path}
|
||||
COMMENT "Copying extension module to python/gtsam/_libgtsam_python.so"
|
||||
COMMENT "Copying extension module to python/gtsam/_gtsampy.so"
|
||||
)
|
||||
add_custom_target(copy_gtsam_python_module ALL DEPENDS ${output_path})
|
|
@ -62,7 +62,7 @@ void registerNumpyEigenConversions();
|
|||
|
||||
//-----------------------------------//
|
||||
|
||||
BOOST_PYTHON_MODULE(gtsampy){
|
||||
BOOST_PYTHON_MODULE(_gtsampy){
|
||||
|
||||
// NOTE: We need to call import_array1() instead of import_array() to support both python 2
|
||||
// and 3. The reason is that BOOST_PYTHON_MODULE puts all its contents in a function
|
||||
|
|
|
@ -11,5 +11,5 @@ setup(name='gtsam',
|
|||
package_dir={ '': '${CMAKE_CURRENT_SOURCE_DIR}' },
|
||||
packages=['gtsam', 'gtsam_utils', 'gtsam_examples', 'gtsam_tests'],
|
||||
#package_data={'gtsam' : ['_libgtsam_python.so']}, # location of .so file is relative to package_dir
|
||||
data_files=[('${PY_INSTALL_FOLDER}/gtsam/', ['gtsam/_libgtsam_python.so'])], # location of .so file relative to setup.py
|
||||
data_files=[('${PY_INSTALL_FOLDER}/gtsam/', ['gtsam/_gtsampy.so'])], # location of .so file relative to setup.py
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue