Skip to content
New issue

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

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

Already on GitHub? # to your account

Update CMakeLists.txt and package.xml #404

Merged
merged 20 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
43 changes: 30 additions & 13 deletions combined_robot_hw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,50 @@
cmake_minimum_required(VERSION 2.8.3)
project(combined_robot_hw)

# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED COMPONENTS
hardware_interface
pluginlib
roscpp
)

include_directories(include ${catkin_INCLUDE_DIRS})

# Declare a catkin package
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS hardware_interface pluginlib roscpp
INCLUDE_DIRS
include
LIBRARIES
${PROJECT_NAME}
CATKIN_DEPENDS
hardware_interface
pluginlib
roscpp
)

add_library(${PROJECT_NAME}
src/combined_robot_hw.cpp
)

###########
## Build ##
###########

# Specify header include paths
include_directories(include ${catkin_INCLUDE_DIRS})
bmagyar marked this conversation as resolved.
Show resolved Hide resolved

add_library(${PROJECT_NAME} src/combined_robot_hw.cpp)
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})


#############
## Install ##
#############

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

# Install library
# Install targets
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
3 changes: 2 additions & 1 deletion combined_robot_hw/package.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<package format="2">
<name>combined_robot_hw</name>
<version>0.15.1</version>
<description>Combined Robot HW class.</description>

<maintainer email="bence.magyar.robotics@gmail.com">Bence Magyar</maintainer>
<maintainer email="toni@shadowrobot.com">Toni Oliver</maintainer>
<maintainer email="enrique.fernandez.perdomo@gmail.com">Enrique Fernandez</maintainer>
Expand All @@ -17,6 +17,7 @@
<author email="toni@shadowrobot.com">Toni Oliver</author>

<buildtool_depend>catkin</buildtool_depend>

<depend>hardware_interface</depend>
<depend>pluginlib</depend>
<depend>roscpp</depend>
Expand Down
55 changes: 41 additions & 14 deletions combined_robot_hw_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.8.3)
project(combined_robot_hw_tests)

# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED COMPONENTS
combined_robot_hw
controller_manager
Expand All @@ -9,29 +10,47 @@ find_package(catkin REQUIRED COMPONENTS
roscpp
)

include_directories(include ${catkin_INCLUDE_DIRS})

# Declare a catkin package
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS combined_robot_hw hardware_interface roscpp
INCLUDE_DIRS
include
LIBRARIES
${PROJECT_NAME}
CATKIN_DEPENDS
combined_robot_hw
hardware_interface
roscpp
# Note: controller_manager and controller_manager_tests are only used in tests
)


###########
## Build ##
###########

# Specify header include paths
include_directories(include ${catkin_INCLUDE_DIRS})

add_library(${PROJECT_NAME}
src/my_robot_hw_1.cpp
src/my_robot_hw_2.cpp
src/my_robot_hw_3.cpp
src/my_robot_hw_4.cpp
)
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Boost_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})

add_executable(combined_robot_hw_dummy_app src/dummy_app.cpp)
target_link_libraries(combined_robot_hw_dummy_app ${PROJECT_NAME} ${catkin_LIBRARIES})

if(CATKIN_ENABLE_TESTING)

#############
## Testing ##
#############

if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)

add_rostest_gtest(combined_robot_hw_test
bmagyar marked this conversation as resolved.
Show resolved Hide resolved
test/combined_robot_hw_test.test
test/combined_robot_hw_test.cpp
Expand All @@ -43,18 +62,26 @@ if(CATKIN_ENABLE_TESTING)
test/cm_test.cpp
)
target_link_libraries(combined_robot_hw_cm_test ${PROJECT_NAME} ${catkin_LIBRARIES})

endif()

# Install

#############
## Install ##
#############

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

# Install library
install(TARGETS ${PROJECT_NAME}
# Install targets
install(TARGETS ${PROJECT_NAME} combined_robot_hw_dummy_app
bmagyar marked this conversation as resolved.
Show resolved Hide resolved
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)

# Install plugins
install(FILES test_robot_hw_plugin.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
5 changes: 3 additions & 2 deletions combined_robot_hw_tests/package.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<package format="2">
<name>combined_robot_hw_tests</name>
<version>0.15.1</version>
<description>The combined_robot_hw_tests package</description>
<description>Tests for the combined Robot HW class.</description>

<maintainer email="bence.magyar.robotics@gmail.com">Bence Magyar</maintainer>
<maintainer email="toni@shadowrobot.com">Toni Oliver</maintainer>
<maintainer email="enrique.fernandez.perdomo@gmail.com">Enrique Fernandez</maintainer>
Expand All @@ -17,6 +17,7 @@
<author email="toni@shadowrobot.com">Toni Oliver</author>

<buildtool_depend>catkin</buildtool_depend>

<depend>combined_robot_hw</depend>
<depend>controller_manager</depend>
<depend>controller_manager_tests</depend>
Expand Down
50 changes: 32 additions & 18 deletions controller_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,46 @@ cmake_minimum_required(VERSION 2.8.3)
project(controller_interface)

# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED COMPONENTS roscpp hardware_interface pluginlib)
find_package(catkin REQUIRED COMPONENTS
hardware_interface
pluginlib
roscpp
)

# Declare catkin package
# Declare a catkin package
catkin_package(
CATKIN_DEPENDS roscpp hardware_interface pluginlib
INCLUDE_DIRS include
)
INCLUDE_DIRS
include
CATKIN_DEPENDS
hardware_interface
pluginlib
roscpp
)

if(CATKIN_ENABLE_TESTING)

find_package(rosunit REQUIRED)
###########
## Build ##
###########

catkin_add_gmock(controller_base_test
test/controller_base_test.cpp
)
# Specify header include paths
include_directories(include ${catkin_INCLUDE_DIRS})

target_include_directories(controller_base_test PRIVATE include)
target_include_directories(controller_base_test SYSTEM PRIVATE ${catkin_INCLUDE_DIRS})

target_link_libraries(controller_base_test
${catkin_LIBRARIES}
)
#############
## Testing ##
#############

if(CATKIN_ENABLE_TESTING)
catkin_add_gmock(controller_base_test test/controller_base_test.cpp)
target_link_libraries(controller_base_test ${catkin_LIBRARIES})
endif()

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

#############
## Install ##
#############

# Install headers
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
3 changes: 2 additions & 1 deletion controller_interface/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<package format="2">
<name>controller_interface</name>
<version>0.15.1</version>
<description>Interface base class for controllers</description>
<description>Interface base class for controllers.</description>

<maintainer email="bence.magyar.robotics@gmail.com">Bence Magyar</maintainer>
<maintainer email="enrique.fernandez.perdomo@gmail.com">Enrique Fernandez</maintainer>
<maintainer email="mathias.luedtke@ipa.fraunhofer.de">Mathias Lüdtke</maintainer>
Expand Down
91 changes: 59 additions & 32 deletions controller_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,92 @@ cmake_minimum_required(VERSION 2.8.3)
project(controller_manager)

# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED COMPONENTS controller_interface controller_manager_msgs hardware_interface pluginlib)
find_package(catkin REQUIRED COMPONENTS
controller_interface
controller_manager_msgs
hardware_interface
pluginlib
)

# Include Boost.Thread
find_package(Boost REQUIRED COMPONENTS thread)

include_directories(include ${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS})
catkin_python_setup()

# Declare catkin package
# Declare a catkin package
catkin_package(
DEPENDS Boost
CATKIN_DEPENDS controller_interface controller_manager_msgs hardware_interface pluginlib
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
INCLUDE_DIRS
include
LIBRARIES
${PROJECT_NAME}
CATKIN_DEPENDS
controller_interface
controller_manager_msgs
hardware_interface
pluginlib
DEPENDS
Boost
)


###########
## Build ##
###########

# Specify header include paths
include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIR})
matthew-reynolds marked this conversation as resolved.
Show resolved Hide resolved

add_library(${PROJECT_NAME}
src/controller_manager.cpp
include/controller_manager/controller_manager.h
include/controller_manager/controller_loader_interface.h
include/controller_manager/controller_loader.h
include/controller_manager/controller_loader_interface.h
include/controller_manager/controller_manager.h
src/controller_manager.cpp
)
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Boost_LIBRARIES})

if(catkin_EXPORTED_TARGETS)
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
endif()

if(CATKIN_ENABLE_TESTING)
#############
## Testing ##
#############

if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)

add_rostest_gtest(controller_manager_hwi_switch_test
add_rostest_gtest(${PROJECT_NAME}_hwi_switch_test
test/hwi_switch_test.test
test/hwi_switch_test.cpp
)
target_link_libraries(controller_manager_hwi_switch_test ${PROJECT_NAME} ${catkin_LIBRARIES})
target_link_libraries(${PROJECT_NAME}_hwi_switch_test ${PROJECT_NAME} ${catkin_LIBRARIES})

add_rostest_gmock(controller_manager_hwi_update_test
add_rostest_gmock(${PROJECT_NAME}_hwi_update_test
test/hwi_update_test.test
test/hwi_update_test.cpp
)
target_link_libraries(controller_manager_hwi_update_test ${PROJECT_NAME} ${catkin_LIBRARIES})

target_link_libraries(${PROJECT_NAME}_hwi_update_test ${PROJECT_NAME} ${catkin_LIBRARIES})
endif()

# Install

#############
## Install ##
#############

# Install python scripts
catkin_install_python(PROGRAMS scripts/controller_group
scripts/controller_manager
scripts/spawner
scripts/unspawner
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

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

# Install library
# Install targets
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})

catkin_install_python(PROGRAMS
scripts/controller_group
scripts/controller_manager
scripts/spawner
scripts/unspawner
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

catkin_python_setup()
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
Loading