Skip to content

Commit

Permalink
Merge pull request #4 from meyerj/orocos-generate-package-cleanup
Browse files Browse the repository at this point in the history
rtt_ros_integration: orocos_generate_package() cleanup
  • Loading branch information
Ruben Smits committed Dec 5, 2013
2 parents 5a54286 + ec96bd0 commit 5203e87
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 73 deletions.
17 changes: 8 additions & 9 deletions rtt_actionlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ project(rtt_actionlib)
find_package(catkin REQUIRED COMPONENTS
roscpp rtt_ros actionlib rtt_roscomm)

catkin_package(
INCLUDE_DIRS include
# DEPENDS rtt ocl
CATKIN_DEPENDS roscpp rtt_roscomm actionlib)

include_directories(
include
${catkin_INCLUDE_DIRS}
Expand All @@ -18,8 +13,12 @@ include_directories(
orocos_service(rtt_actionlib_service src/rtt_actionlib_service.cpp)
target_link_libraries(rtt_actionlib_service ${catkin_LIBRARIES})

orocos_generate_package()

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
orocos_generate_package(
INCLUDE_DIRS include
DEPENDS roscpp actionlib
DEPENDS_TARGETS rtt_ros rtt_roscomm
)

orocos_install_headers(
DIRECTORY include/${PROJECT_NAME}
)
15 changes: 9 additions & 6 deletions rtt_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ include(${OROCOS-RTT_USE_FILE_PATH}/UseOROCOS-RTT.cmake)

catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS rostime
CFG_EXTRAS rtt_ros-extras.cmake)
CFG_EXTRAS rtt_ros-extras.cmake
)

find_package(LibXml2 REQUIRED)

Expand All @@ -23,7 +23,10 @@ add_definitions(-DRTT_COMPONENT)
orocos_service(rtt_ros src/rtt_ros_service.cpp)
target_link_libraries(rtt_ros ${catkin_LIBRARIES} ${LIBXML2_LIBRARIES})

orocos_generate_package()
orocos_generate_package(
INCLUDE_DIRS include
DEPENDS rostime
)

install(PROGRAMS
scripts/rtt-upgrade-2.5
Expand All @@ -38,6 +41,6 @@ install(PROGRAMS
scripts/typegen
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})

orocos_install_headers(
DIRECTORY include/${PROJECT_NAME}
)
23 changes: 12 additions & 11 deletions rtt_roscomm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
cmake_minimum_required(VERSION 2.8.3)
project(rtt_roscomm)

find_package(catkin REQUIRED COMPONENTS roscpp rtt_rospack rtt_ros)
find_package(catkin REQUIRED COMPONENTS roscpp rtt_ros)

catkin_package(
INCLUDE_DIRS include
# DEPENDS rtt ocl
CATKIN_DEPENDS roscpp rtt_rospack
CFG_EXTRAS GenerateRTTROSCommPackage.cmake)
INCLUDE_DIRS include
CATKIN_DEPENDS rtt_ros
CFG_EXTRAS GenerateRTTROSCommPackage.cmake
)

include_directories(
include
Expand Down Expand Up @@ -44,17 +44,18 @@ orocos_service(rtt_rosservice
target_link_libraries(rtt_rosservice ${catkin_LIBRARIES})

# Generate install targets and pkg-config files
orocos_generate_package()


orocos_generate_package(
INCLUDE_DIRS include
DEPENDS roscpp
)

install(PROGRAMS
scripts/create_rtt_pkg
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

install(DIRECTORY include/
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"
orocos_install_headers(
DIRECTORY include/rtt_rostopic include/rtt_rosservice
INSTALL ${CATKIN_GLOBAL_INCLUDE_DESTINATION}/orocos
)

# Install cmake macros
Expand Down
17 changes: 5 additions & 12 deletions rtt_roscomm/rtt_roscomm_pkg_template/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
cmake_minimum_required(VERSION 2.8.3)
project(rtt_@pkgname@)

find_package(catkin REQUIRED COMPONENTS
rtt_roscomm
@pkgname@
@catkin_deplist@)
find_package(catkin REQUIRED COMPONENTS rtt_roscomm)

ros_generate_rtt_typekit(@pkgname@)
ros_generate_rtt_service_proxies(@pkgname@)

catkin_package(
# DEPENDS ocl rtt
CATKIN_DEPENDS
rtt_roscomm
@pkgname@
@catkin_deplist@)

orocos_generate_package()
orocos_generate_package(
DEPENDS @pkgname@
DEPENDS_TARGETS rtt_roscomm @rtt_packages@
)
2 changes: 1 addition & 1 deletion rtt_roscomm/rtt_roscomm_pkg_template/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<package>
<name>rtt_@pkgname@</name>
<version>2.6.0</version>
<version>0.0.0</version>
<description>

Provides an rtt typekit for ROS @pkgname@ messages.
Expand Down
4 changes: 2 additions & 2 deletions rtt_roscomm/scripts/create_rtt_pkg
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ for dep in $(rospack depends $pkgname | grep "_msgs$"); do
fi
deplist="$deplist <build_depend>rtt_$dep</build_depend>\n <run_depend>rtt_$dep</run_depend>\n"
rtt_deplist="$rtt_deplist <plugin_depend>rtt_$dep</plugin_depend>\n"
catkin_deplist="$catkin_deplist rtt_$dep\n"
rtt_packages="$rtt_packages rtt_$dep\n"
done

mkdir $force rtt_$pkgname || { echo "Package already exists, use -f to force creation." ; exit 1; }
Expand All @@ -78,7 +78,7 @@ allcappkgname=$(echo $pkgname | tr [:lower:] [:upper:])
cappkgname=$(echo $allcappkgname | cut -c1)$(echo $pkgname | cut -c2-)
for i in $files; do
tgtname=$(echo $(basename "$i") | sed -e "s/pkgname/$pkgname/g;s/Pkgname/$cappkgname/g;")
cat "$i" | sed -e "s/@PKGNAME@/$allcappkgname/g;s/@pkgname@/$pkgname/g;s/@Pkgname@/$cappkgname/g;s|@deplist@|$deplist|g;s|@rtt_deplist@|$rtt_deplist|g;s|@catkin_deplist@|$catkin_deplist|g" > rtt_$pkgname/$tgtname
cat "$i" | sed -e "s/@PKGNAME@/$allcappkgname/g;s/@pkgname@/$pkgname/g;s/@Pkgname@/$cappkgname/g;s|@deplist@|$deplist|g;s|@rtt_deplist@|$rtt_deplist|g;s|@rtt_packages@|$rtt_packages|g" > rtt_$pkgname/$tgtname
done
rm -vf rtt_$pkgname/CATKIN_IGNORE

Expand Down
9 changes: 3 additions & 6 deletions rtt_rosnode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ project(rtt_rosnode)

find_package(catkin REQUIRED COMPONENTS roscpp rtt_ros)

catkin_package(
# DEPENDS rtt ocl
CATKIN_DEPENDS roscpp )

include_directories(${catkin_INCLUDE_DIRS})

# Create orocos rosnode plugin
orocos_plugin(rtt_rosnode src/ros_plugin.cpp)
target_link_libraries(rtt_rosnode ${catkin_LIBRARIES})

# Generate install targets and pkg-config files
orocos_generate_package()

orocos_generate_package(
DEPENDS roscpp
)
7 changes: 2 additions & 5 deletions rtt_rospack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ find_package(catkin REQUIRED COMPONENTS roslib rtt_ros)
orocos_plugin(rtt_rospack src/rtt_rospack_service.cpp)
target_link_libraries(rtt_rospack ${roslib_LIBRARIES})

orocos_generate_package()

catkin_package(
# DEPENDS rtt
CATKIN_DEPENDS roslib
orocos_generate_package(
DEPENDS roslib
)
12 changes: 4 additions & 8 deletions rtt_rosparam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ project(rtt_rosparam)

find_package(catkin REQUIRED COMPONENTS roscpp rtt_ros)

catkin_package(
INCLUDE_DIRS include
# DEPENDS rtt ocl
CATKIN_DEPENDS roscpp)

include_directories(
include
${catkin_INCLUDE_DIRS})
Expand All @@ -20,6 +15,7 @@ target_link_libraries(rtt_rosparam

# Generate install targets and pkg-config files
orocos_install_headers(include/rtt_rosparam/rosparam.h)
orocos_generate_package()


orocos_generate_package(
INCLUDE_DIRS include
DEPENDS roscpp
)
5 changes: 1 addition & 4 deletions tests/rtt_ros_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
cmake_minimum_required(VERSION 2.8.3)
project(rtt_ros_tests)

find_package(catkin REQUIRED
COMPONENTS rtt_ros)
find_package(catkin REQUIRED COMPONENTS rtt_ros)

if(CATKIN_ENABLE_TESTING)

orocos_use_package(ocl-logging)
orocos_use_package(ocl-deployment)

catkin_package()

catkin_add_gtest(rtt_ros_api_tests test/api_tests.cpp)
target_link_libraries(rtt_ros_api_tests
${catkin_LIBRARIES}
Expand Down
5 changes: 1 addition & 4 deletions tests/rtt_roscomm_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
cmake_minimum_required(VERSION 2.8.3)
project(rtt_roscomm_tests)

find_package(catkin REQUIRED
COMPONENTS rtt_ros rtt_roscomm rtt_std_msgs rostest)
find_package(catkin REQUIRED COMPONENTS rtt_ros)

if(CATKIN_ENABLE_TESTING)

orocos_use_package(ocl-logging)
orocos_use_package(ocl-deployment)

catkin_package()

catkin_add_gtest(rtt_roscomm_api_tests test/api_tests.cpp)
target_link_libraries(rtt_roscomm_api_tests
${catkin_LIBRARIES}
Expand Down
1 change: 0 additions & 1 deletion tests/rtt_roscomm_tests/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

<build_depend>rtt_roscomm</build_depend>
<build_depend>rtt_std_msgs</build_depend>
<build_depend>rostest</build_depend>
<build_depend>ocl</build_depend>


Expand Down
5 changes: 1 addition & 4 deletions tests/rtt_rospack_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
cmake_minimum_required(VERSION 2.8.3)
project(rtt_rospack_tests)

find_package(catkin REQUIRED
COMPONENTS rtt_ros rtt_rospack roslib)
find_package(catkin REQUIRED COMPONENTS rtt_ros)

if(CATKIN_ENABLE_TESTING)

orocos_use_package(ocl-logging)
orocos_use_package(ocl-deployment)

catkin_package()

catkin_add_gtest(rtt_rospack_api_tests test/api_tests.cpp)
target_link_libraries(rtt_rospack_api_tests
${catkin_LIBRARIES}
Expand Down

0 comments on commit 5203e87

Please sign in to comment.