diff --git a/colcon.pkg b/colcon.pkg new file mode 100644 index 000000000..ff8e66379 --- /dev/null +++ b/colcon.pkg @@ -0,0 +1,4 @@ +# Configuration file for colcon (https://colcon.readthedocs.io). +{ + "hooks": ["share/ignition-math6/setup.sh"] +} diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index 6751b9061..61c4d7e3c 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -80,6 +80,18 @@ if (PYTHONLIBS_FOUND) set(IGN_PYTHON_INSTALL_PATH ${IGN_LIB_INSTALL_DIR}/python) endif() + # TODO(ahcorde): Use ign-cmake to include hooks + # Refer to this issue: https://github.com/ignitionrobotics/ign-cmake/issues/185 + configure_file( + "setup.sh.in" + "${CMAKE_CURRENT_BINARY_DIR}/share/setup.sh" @ONLY + ) + + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/share/setup.sh + DESTINATION share/${PROJECT_NAME} + ) + set(IGN_PYTHON_INSTALL_PATH "${IGN_PYTHON_INSTALL_PATH}/ignition") install(TARGETS ${SWIG_PY_LIB} DESTINATION ${IGN_PYTHON_INSTALL_PATH}) install(FILES ${CMAKE_BINARY_DIR}/lib/python/math.py DESTINATION ${IGN_PYTHON_INSTALL_PATH}) diff --git a/src/python/setup.sh.in b/src/python/setup.sh.in new file mode 100644 index 000000000..e7973ee0c --- /dev/null +++ b/src/python/setup.sh.in @@ -0,0 +1,3 @@ +# generated from ignition-math/setup.sh.in + +export PYTHONPATH=@CMAKE_INSTALL_PREFIX@/@IGN_PYTHON_INSTALL_PATH@:$PYTHONPATH