Skip to content

Commit

Permalink
Hunterise ros_comm
Browse files Browse the repository at this point in the history
  • Loading branch information
Krasimir Georgiev authored and ruslo committed Aug 8, 2019
1 parent c4a6d51 commit 6e3f4c8
Show file tree
Hide file tree
Showing 11 changed files with 707 additions and 50 deletions.
59 changes: 59 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
cmake_minimum_required(VERSION 2.8.3)

include(cmake/HunterGate.cmake)
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.207.tar.gz"
SHA1 "6e1b05a1f65c2aa492f7f43a43578e83ac62bbdd"
)


project(ros_comm)

hunter_add_package(Boost
COMPONENTS date_time filesystem program_options regex system chrono thread)
hunter_add_package(BZip2)
hunter_add_package(lz4)
hunter_add_package(catkin)
hunter_add_package(rosconsole)
hunter_add_package(roscpp_core)
hunter_add_package(ros)
hunter_add_package(ros_message_generation)
hunter_add_package(ros_comm_msgs)
hunter_add_package(pluginlib)

find_package(Boost CONFIG REQUIRED
COMPONENTS date_time filesystem program_options regex system chrono thread)

add_subdirectory(tools/rosgraph)
add_subdirectory(tools/roslaunch)
add_subdirectory(tools/rosmaster)
add_subdirectory(tools/rosparam)
add_subdirectory(utilities/xmlrpcpp)
add_subdirectory(clients/roscpp)
add_subdirectory(clients/rospy)
add_subdirectory(utilities/roslz4)
add_subdirectory(tools/rostest)
add_subdirectory(tools/rosnode)
add_subdirectory(tools/rosbag_storage)
add_subdirectory(tools/topic_tools)
add_subdirectory(tools/rosbag)
add_subdirectory(tools/rostopic)
add_subdirectory(tools/rosmsg)
add_subdirectory(tools/rosout)
add_subdirectory(tools/rosservice)
add_subdirectory(utilities/roswtf)
add_subdirectory(utilities/message_filters)
add_subdirectory(ros_comm)

add_subdirectory(test/test_roscpp)
add_subdirectory(test/test_rosbag)
add_subdirectory(test/test_rosbag_storage)

add_subdirectory(test/test_rosgraph)
add_subdirectory(test/test_roslaunch)
add_subdirectory(test/test_roslib_comm)
add_subdirectory(test/test_rosmaster)
add_subdirectory(test/test_rosparam)
add_subdirectory(test/test_rospy)
add_subdirectory(test/test_rosservice)
add_subdirectory(test/test_rostopic)
24 changes: 18 additions & 6 deletions clients/roscpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
cmake_minimum_required(VERSION 2.8.3)
project(roscpp)

if(NOT WIN32)
set_directory_properties(PROPERTIES COMPILE_OPTIONS "-std=c++11;-Wall;-Wextra")
endif()

find_package(catkin REQUIRED COMPONENTS
cpp_common message_generation rosconsole roscpp_serialization roscpp_traits rosgraph_msgs rostime std_msgs xmlrpcpp
)
Expand All @@ -22,7 +18,9 @@ list(GET roscpp_VERSION_LIST 2 roscpp_VERSION_PATCH)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/ros/common.h.in ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}/ros/common.h)

find_package(Boost REQUIRED COMPONENTS chrono filesystem signals system)
find_package(Boost REQUIRED COMPONENTS chrono filesystem system)
set(Boost_LIBRARIES Boost::chrono Boost::filesystem
Boost::system)

include_directories(include ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}/ros ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})

Expand Down Expand Up @@ -51,11 +49,12 @@ if(CMAKE_THREAD_LIBS_INIT)
endif()
endif()

set(PROJECT_INSTALLSPACE_LIBRARIES ros::roscpp ${PTHREAD_LIB})
catkin_package(
INCLUDE_DIRS include ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}/ros
LIBRARIES roscpp ${PTHREAD_LIB}
CATKIN_DEPENDS cpp_common message_runtime rosconsole roscpp_serialization roscpp_traits rosgraph_msgs rostime std_msgs xmlrpcpp
DEPENDS Boost
DEPENDS "Boost COMPONENTS chrono filesystem system"
)

include(CheckIncludeFiles)
Expand Down Expand Up @@ -126,16 +125,29 @@ add_library(roscpp

add_dependencies(roscpp ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

target_include_directories(roscpp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}/ros>
$<BUILD_INTERFACE:${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}>
$<INSTALL_INTERFACE:include>
)

target_link_libraries(roscpp
${catkin_LIBRARIES}
${Boost_LIBRARIES}
)

#explicitly install library and includes
install(TARGETS roscpp
EXPORT ${PROJECT_NAME}Targets
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
install(EXPORT ${PROJECT_NAME}Targets
DESTINATION share/${PROJECT_NAME}/cmake
NAMESPACE ros::
FILE ${PROJECT_NAME}Targets.cmake
)
install(DIRECTORY include/
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h")
Expand Down
Loading

0 comments on commit 6e3f4c8

Please sign in to comment.