cmake function to install python package once make install is completed

release/4.3a0
Varun Agrawal 2020-03-21 14:52:17 -04:00
parent cb55d81fb5
commit 1725a577cf
2 changed files with 9 additions and 0 deletions

View File

@ -279,3 +279,10 @@ function(install_cython_files source_files dest_directory)
endfunction()
function(install_python_package install_path)
set(package_path "${install_path}${GTSAM_BUILD_TAG}")
# set cython directory permissions to user so we don't get permission denied
install(CODE "execute_process(COMMAND sh \"-c\" \"chown -R $(logname):$(logname) ${package_path}\")")
# go to cython directory and run setup.py
install(CODE "execute_process(COMMAND sh \"-c\" \"cd ${package_path} && python setup.py install\")")
endfunction()

View File

@ -45,4 +45,6 @@ if (GTSAM_INSTALL_CYTHON_TOOLBOX)
install_cython_scripts("${PROJECT_SOURCE_DIR}/cython/gtsam" "${GTSAM_CYTHON_INSTALL_PATH}" "*.py")
install_cython_scripts("${PROJECT_SOURCE_DIR}/cython/gtsam_unstable" "${GTSAM_CYTHON_INSTALL_PATH}" "*.py")
install_python_package("${GTSAM_CYTHON_INSTALL_PATH}")
endif ()