Copy python/gtsam to build/python directory
Not the best way since the gtsam module into build/python won't be updated if .py files change in the python module.release/4.3a0
parent
888af6b948
commit
768c594299
|
|
@ -58,6 +58,9 @@ if(Boost_PYTHON${BOOST_PYTHON_VERSION_SUFFIX_UPPERCASE}_FOUND AND PYTHONLIBS_FOU
|
|||
include_directories(${PYTHON_INCLUDE_DIRS})
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
include_directories(${CMAKE_SOURCE_DIR}/gtsam/3rdparty/numpy_eigen/include/)
|
||||
|
||||
file(COPY "gtsam" DESTINATION ".")
|
||||
file(COPY "setup.py" DESTINATION ".")
|
||||
add_subdirectory(handwritten)
|
||||
# Disable python module if we didn't find required lybraries
|
||||
else()
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
/_libgtsam_python.so
|
||||
|
|
@ -21,16 +21,9 @@ set_target_properties(${moduleName}_python PROPERTIES
|
|||
|
||||
target_link_libraries(${moduleName}_python ${Boost_PYTHON${BOOST_PYTHON_VERSION_SUFFIX_UPPERCASE}_LIBRARY} ${PYTHON_LIBRARY} ${gtsamLib}) #temp
|
||||
|
||||
# On OSX and Linux, the python library must end in the extension .so. Build this
|
||||
# filename here.
|
||||
set(PYLIB_OUTPUT_FILE $<TARGET_FILE:${moduleName}_python>)
|
||||
set(PYLIB_SO_NAME lib${moduleName}_python.so)
|
||||
|
||||
# Installs the library in the gtsam folder, which is used by setup.py to create the gtsam package
|
||||
set(PYTHON_MODULE_DIRECTORY ${CMAKE_SOURCE_DIR}/python/gtsam)
|
||||
# Cause the library to be output in the correct directory.
|
||||
add_custom_command(TARGET ${moduleName}_python
|
||||
POST_BUILD
|
||||
COMMAND cp -v ${PYLIB_OUTPUT_FILE} ${PYTHON_MODULE_DIRECTORY}/_${PYLIB_SO_NAME}
|
||||
COMMAND cp -v $<TARGET_FILE:${moduleName}_python> ${CMAKE_BINARY_DIR}/python/gtsam/_$<TARGET_FILE_NAME:${moduleName}_python>
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Copying library files to python directory" )
|
||||
|
|
|
|||
Loading…
Reference in New Issue