Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing catkin_destination not being called #144

Merged
merged 4 commits into from
Aug 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions cmake/catkin-pip-package.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand All @@ -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
Expand All @@ -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()
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion test/catkin_pip_pytest/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
14 changes: 12 additions & 2 deletions test/distutils-setup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions test/distutils-setup/extra_installs/bin.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/distutils-setup/extra_installs/etc.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/distutils-setup/extra_installs/include.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/distutils-setup/extra_installs/lib.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/distutils-setup/extra_installs/python.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/distutils-setup/extra_installs/share.txt
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions test/pipproject/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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...

Expand Down
6 changes: 4 additions & 2 deletions test/pylibrary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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...

Expand Down
6 changes: 4 additions & 2 deletions test/pypackage-minimal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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...

Expand Down
6 changes: 4 additions & 2 deletions test/pypackage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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...

Expand Down
14 changes: 12 additions & 2 deletions test/setuptools-setup/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions test/setuptools-setup/extra_installs/bin.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/setuptools-setup/extra_installs/etc.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/setuptools-setup/extra_installs/include.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/setuptools-setup/extra_installs/lib.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/setuptools-setup/extra_installs/python.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions test/setuptools-setup/extra_installs/share.txt
Original file line number Diff line number Diff line change
@@ -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