diff --git a/cmake/catkin-pip-package.cmake.in b/cmake/catkin-pip-package.cmake.in index bee9d6b..b3e30e3 100644 --- a/cmake/catkin-pip-package.cmake.in +++ b/cmake/catkin-pip-package.cmake.in @@ -76,10 +76,8 @@ function(catkin_pip_python_setup) endfunction() -# TODO : we now create an actual cmake target -> rename to catkin_pip_target ? -function(catkin_pip_package package_name) - set(${PROJECT_NAME}_PIP_TARGET ${package_name} CACHE STRING "Make target generated to install this pip package as --editable for development") +function(catkin_pip_target package_name) set (extra_macro_args ${ARGN}) @@ -92,6 +90,8 @@ function(catkin_pip_package package_name) set(package_path ${CMAKE_CURRENT_SOURCE_DIR}) endif() + set(${PROJECT_NAME}_PIP_TARGET ${package_name} CACHE STRING "Make target generated to install this pip package as --editable for development") + # Note : environment should already be setup at configure time for devel # Then we can run the pip command @@ -114,10 +114,16 @@ function(catkin_pip_package package_name) # TODO : we might want to generate a package.xml on the fly from setup.py contents... - # Hijacking catkin scripts again - #set(_PACKAGE_XML_DIRECTORY ${package_path}) +endfunction() + + +# BWCOMPAT : eventually get rid of that... +macro(catkin_pip_package package_name) + + catkin_pip_target(${package_name} ${ARGN}) # Here we plug back into usual catkin package build flow + # CAREFUL : this will set variables into current scope. catkin_package() -endfunction() +endmacro() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 384b9b9..87538a3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -150,4 +150,6 @@ if (CATKIN_ENABLE_TESTING) ${cookiecutter_pypackage_minimal_PIP_TARGET} # from pypackage-minimal ) + #TODO : a way to verified installed files from cmake ??? + endif() \ No newline at end of file diff --git a/test/catkin_pip_pytest/test_import.py b/test/catkin_pip_pytest/test_import.py index 8e0fc53..63e2478 100644 --- a/test/catkin_pip_pytest/test_import.py +++ b/test/catkin_pip_pytest/test_import.py @@ -12,7 +12,7 @@ def test_dynamic_import_devel_space_pkgs(): # If all packages are in the sys.path, we can import them -def test_dynamic_import_vedel_pkg(): +def test_dynamic_import_devel_pkg(): importlib.import_module('mypippkg') importlib.import_module('nameless') importlib.import_module('python_boilerplate') diff --git a/test/distutils-setup/CMakeLists.txt b/test/distutils-setup/CMakeLists.txt index adb49c3..07c7522 100644 --- a/test/distutils-setup/CMakeLists.txt +++ b/test/distutils-setup/CMakeLists.txt @@ -6,13 +6,23 @@ set (PIP_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/distutils_setup) find_package(catkin REQUIRED COMPONENTS catkin_pip) -# This replace both catkin_python_setup() and catkin_package() +# This replace catkin_python_setup() # For devel, this will install all your unsatisfied pip dependencies. # Upon install, this will bark if some dependencies are not already satisfied (by ROS). -catkin_pip_package(dstest ${PIP_PROJECT_DIR}) +catkin_pip_target(dstest ${PIP_PROJECT_DIR}) + +catkin_package() # CAREFUL : all projects for test here will share the same workspace. pip might have conflicts... +# Testing potential extra files installation +install(FILES extra_installs/bin.txt DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) +install(FILES extra_installs/etc.txt DESTINATION ${CATKIN_PACKAGE_ETC_DESTINATION}) +install(FILES extra_installs/include.txt DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) +install(FILES extra_installs/lib.txt DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}) +install(FILES extra_installs/python.txt DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION}) +install(FILES extra_installs/share.txt DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) + ## Unit tests if (CATKIN_ENABLE_TESTING) catkin_add_nosetests(${PIP_PROJECT_DIR}/test DEPENDENCIES dstest) diff --git a/test/distutils-setup/extra_installs/bin.txt b/test/distutils-setup/extra_installs/bin.txt new file mode 100644 index 0000000..e5543e6 --- /dev/null +++ b/test/distutils-setup/extra_installs/bin.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_BIN_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html \ No newline at end of file diff --git a/test/distutils-setup/extra_installs/etc.txt b/test/distutils-setup/extra_installs/etc.txt new file mode 100644 index 0000000..cc0d3cd --- /dev/null +++ b/test/distutils-setup/extra_installs/etc.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_ETC_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html \ No newline at end of file diff --git a/test/distutils-setup/extra_installs/include.txt b/test/distutils-setup/extra_installs/include.txt new file mode 100644 index 0000000..8e7ba3f --- /dev/null +++ b/test/distutils-setup/extra_installs/include.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html diff --git a/test/distutils-setup/extra_installs/lib.txt b/test/distutils-setup/extra_installs/lib.txt new file mode 100644 index 0000000..8fc803b --- /dev/null +++ b/test/distutils-setup/extra_installs/lib.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_LIB_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html \ No newline at end of file diff --git a/test/distutils-setup/extra_installs/python.txt b/test/distutils-setup/extra_installs/python.txt new file mode 100644 index 0000000..8a84185 --- /dev/null +++ b/test/distutils-setup/extra_installs/python.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_PYTHON_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html \ No newline at end of file diff --git a/test/distutils-setup/extra_installs/share.txt b/test/distutils-setup/extra_installs/share.txt new file mode 100644 index 0000000..6070c98 --- /dev/null +++ b/test/distutils-setup/extra_installs/share.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_SHARE_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html \ No newline at end of file diff --git a/test/pipproject/CMakeLists.txt b/test/pipproject/CMakeLists.txt index 862d198..aa6a034 100644 --- a/test/pipproject/CMakeLists.txt +++ b/test/pipproject/CMakeLists.txt @@ -15,10 +15,12 @@ catkin_pip_requirements(${PIP_PROJECT_DIR}/requirements.txt --ignore-installed) # However this also means that existing packages in the workspace will not be used to satisfy requirements, # and will be reinstalled everytime... -# This replace both catkin_python_setup() and catkin_package() +# This replace catkin_python_setup() # For devel, this will install all your unsatisfied pip dependencies. # Upon install, this will bark if some dependencies are not already satisfied (by ROS). -catkin_pip_package(mypippkg ${PIP_PROJECT_DIR}) +catkin_pip_target(mypippkg ${PIP_PROJECT_DIR}) + +catkin_package() # CAREFUL : all projects for test here will share the same workspace. pip might have conflicts... diff --git a/test/pylibrary/CMakeLists.txt b/test/pylibrary/CMakeLists.txt index b9f5922..af85b54 100644 --- a/test/pylibrary/CMakeLists.txt +++ b/test/pylibrary/CMakeLists.txt @@ -11,10 +11,12 @@ find_package(catkin REQUIRED COMPONENTS catkin_pip) # no requirements file in this project template -# This replace both catkin_python_setup() and catkin_package() +# This replace catkin_python_setup() # For devel, this will install all your unsatisfied pip dependencies. # Upon install, this will bark if some dependencies are not already satisfied (by ROS). -catkin_pip_package(nameless ${PIP_PROJECT_DIR}) +catkin_pip_target(nameless ${PIP_PROJECT_DIR}) + +catkin_package() # CAREFUL : all projects for test here will share the same workspace. pip might have conflicts... diff --git a/test/pypackage-minimal/CMakeLists.txt b/test/pypackage-minimal/CMakeLists.txt index 88f028e..e61b1fe 100644 --- a/test/pypackage-minimal/CMakeLists.txt +++ b/test/pypackage-minimal/CMakeLists.txt @@ -11,10 +11,12 @@ find_package(catkin REQUIRED COMPONENTS catkin_pip) # no requirements file here -# This replace both catkin_python_setup() and catkin_package() +# This replace catkin_python_setup() # For devel, this will install all your unsatisfied pip dependencies. # Upon install, this will bark if some dependencies are not already satisfied (by ROS). -catkin_pip_package(cookiecutter_pypackage_minimal ${PIP_PROJECT_DIR}) +catkin_pip_target(cookiecutter_pypackage_minimal ${PIP_PROJECT_DIR}) + +catkin_package() # CAREFUL : all projects for test here will share the same workspace. pip might have conflicts... diff --git a/test/pypackage/CMakeLists.txt b/test/pypackage/CMakeLists.txt index 9a08c05..71dea0f 100644 --- a/test/pypackage/CMakeLists.txt +++ b/test/pypackage/CMakeLists.txt @@ -18,10 +18,12 @@ catkin_pip_requirements(${PIP_PROJECT_DIR}/requirements_dev.txt --ignore-install # However this also means that existing packages in the workspace will not be used to satisfy requirements, # and will be reinstalled everytime... -# This replace both catkin_python_setup() and catkin_package() +# This replace catkin_python_setup() # For devel, this will install all your unsatisfied pip dependencies. # Upon install, this will bark if some dependencies are not already satisfied (by ROS). -catkin_pip_package(python_boilerplate ${PIP_PROJECT_DIR}) +catkin_pip_target(python_boilerplate ${PIP_PROJECT_DIR}) + +catkin_package() # CAREFUL : all projects for test here will share the same workspace. pip might have conflicts... diff --git a/test/setuptools-setup/CMakeLists.txt b/test/setuptools-setup/CMakeLists.txt index 7dffd6e..8aa708c 100644 --- a/test/setuptools-setup/CMakeLists.txt +++ b/test/setuptools-setup/CMakeLists.txt @@ -6,13 +6,23 @@ set (PIP_PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/setuptools_setup) find_package(catkin REQUIRED COMPONENTS catkin_pip) -# This replace both catkin_python_setup() and catkin_package() +# This replace catkin_python_setup() # For devel, this will install all your unsatisfied pip dependencies. # Upon install, this will bark if some dependencies are not already satisfied (by ROS). -catkin_pip_package(sstest ${PIP_PROJECT_DIR}) +catkin_pip_target(sstest ${PIP_PROJECT_DIR}) + +catkin_package() # CAREFUL : all projects for test here will share the same workspace. pip might have conflicts... +# Testing potential extra files installation +install(FILES extra_installs/bin.txt DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) +install(FILES extra_installs/etc.txt DESTINATION ${CATKIN_PACKAGE_ETC_DESTINATION}) +install(FILES extra_installs/include.txt DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) +install(FILES extra_installs/lib.txt DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}) +install(FILES extra_installs/python.txt DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION}) +install(FILES extra_installs/share.txt DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) + ## Unit tests if (CATKIN_ENABLE_TESTING) catkin_add_nosetests(${PIP_PROJECT_DIR}/test DEPENDENCIES sstest) diff --git a/test/setuptools-setup/extra_installs/bin.txt b/test/setuptools-setup/extra_installs/bin.txt new file mode 100644 index 0000000..e5543e6 --- /dev/null +++ b/test/setuptools-setup/extra_installs/bin.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_BIN_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html \ No newline at end of file diff --git a/test/setuptools-setup/extra_installs/etc.txt b/test/setuptools-setup/extra_installs/etc.txt new file mode 100644 index 0000000..cc0d3cd --- /dev/null +++ b/test/setuptools-setup/extra_installs/etc.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_ETC_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html \ No newline at end of file diff --git a/test/setuptools-setup/extra_installs/include.txt b/test/setuptools-setup/extra_installs/include.txt new file mode 100644 index 0000000..8e7ba3f --- /dev/null +++ b/test/setuptools-setup/extra_installs/include.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html diff --git a/test/setuptools-setup/extra_installs/lib.txt b/test/setuptools-setup/extra_installs/lib.txt new file mode 100644 index 0000000..8fc803b --- /dev/null +++ b/test/setuptools-setup/extra_installs/lib.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_LIB_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html \ No newline at end of file diff --git a/test/setuptools-setup/extra_installs/python.txt b/test/setuptools-setup/extra_installs/python.txt new file mode 100644 index 0000000..8a84185 --- /dev/null +++ b/test/setuptools-setup/extra_installs/python.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_PYTHON_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html \ No newline at end of file diff --git a/test/setuptools-setup/extra_installs/share.txt b/test/setuptools-setup/extra_installs/share.txt new file mode 100644 index 0000000..6070c98 --- /dev/null +++ b/test/setuptools-setup/extra_installs/share.txt @@ -0,0 +1,2 @@ +# Test file that should be installed in ${CATKIN_PACKAGE_SHARE_DESTINATION} +# Ref : http://docs.ros.org/kinetic/api/catkin/html/user_guide/variables.html \ No newline at end of file