Skip to content

Commit

Permalink
fix catkin_python_setup to consider actual package names inside setup…
Browse files Browse the repository at this point in the history
….py when signaling that an __init__.py file is installed to genmsg/dynamic_reconfigure (ros/genmsg#34)
  • Loading branch information
dirk-thomas committed Sep 13, 2013
1 parent e46eec0 commit eeca8c4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmake/catkin_python_setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ function(catkin_python_setup)
message(FATAL_ERROR "catkin_python_setup() called with unused arguments: ${ARGN}")
endif()

# mark that catkin_python_setup() was called in order to disable installation of generated __init__.py files in generate_messages() and generate_dynamic_reconfigure_options()
set(${PROJECT_NAME}_CATKIN_PYTHON_SETUP TRUE PARENT_SCOPE)
if(${PROJECT_NAME}_GENERATE_MESSAGES)
message(FATAL_ERROR "generate_messages() must be called after catkin_python_setup() in project '${PROJECT_NAME}'")
endif()
Expand Down Expand Up @@ -87,6 +85,11 @@ function(catkin_python_setup)
math(EXPR pkgs_range "${pkgs_count} - 1")
foreach(index RANGE ${pkgs_range})
list(GET ${PROJECT_NAME}_SETUP_PY_PACKAGES ${index} pkg)
if("${pkg}" STREQUAL "${PROJECT_NAME}")
# mark that catkin_python_setup() was called and the setup.py file contains a package with the same name as the current project
# in order to disable installation of generated __init__.py files in generate_messages() and generate_dynamic_reconfigure_options()
set(${PROJECT_NAME}_CATKIN_PYTHON_SETUP_HAS_PACKAGE_INIT TRUE PARENT_SCOPE)
endif()
list(GET ${PROJECT_NAME}_SETUP_PY_PACKAGE_DIRS ${index} pkg_dir)
get_filename_component(name ${pkg_dir} NAME)
if(NOT ("${pkg}" STREQUAL "${name}"))
Expand Down

0 comments on commit eeca8c4

Please sign in to comment.