Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
62e751c
Splitted rosidl_generator_c and rosidl_generator_cpp in two: rosidl_g…
ahcorde Feb 26, 2020
1dbf818
added comments
ahcorde Feb 26, 2020
aa4a84b
rosidl_runtime_cpp removed rosidl_parser dependency
ahcorde Feb 26, 2020
8c1a936
removed c++ flags
ahcorde Feb 26, 2020
6433657
included more feedback
ahcorde Feb 26, 2020
83e4392
Restoring rosidl_typesupport_interface in the package.xml
ahcorde Feb 26, 2020
f7f14d0
rosidl_typesupport_interface from build_depend to build_export_depend
ahcorde Feb 27, 2020
c76cd28
Restored tabs
ahcorde Mar 3, 2020
c069663
rosidl_generator_c including headers in CMakeLists.txt
ahcorde Mar 4, 2020
27d8100
Fixed rosidl_generator_cpp cmakelists
ahcorde Mar 4, 2020
4932d51
Exported the right rosidl_generator and rosidl_runtime
ahcorde Mar 5, 2020
015ab19
replaced include_directories for target_include_directories
ahcorde Mar 5, 2020
ba8bae2
moved rosidl_generator_x dependencies from build_depend to test_depend
ahcorde Mar 5, 2020
c230574
Merge branch 'master' into ahcorde/feature/splitted_rosidl_generator
ahcorde Mar 24, 2020
3a07f57
Removed member_of_group rosidl_runtime_packages from rosidl_generator_c
ahcorde Mar 24, 2020
5cf19e6
changed target_include_libraries and directory for ament_target_depen…
ahcorde Mar 26, 2020
280ec24
restored add dependency in rosidl_generator_cpp
ahcorde Mar 27, 2020
3db20b0
Removed rosidl_generator_x from rosidl_typesupport_introspection_x
ahcorde Mar 30, 2020
58bf887
Removed comments
ahcorde Mar 31, 2020
e3fe878
Restored C standard and compiler flags
ahcorde Mar 31, 2020
38c6125
Merge remote-tracking branch 'origin/master' into ahcorde/feature/spl…
ahcorde Apr 3, 2020
52a3709
keep the originally used dependency type
ahcorde Apr 7, 2020
132d521
Fixed rosidl_runtime_c cmakelists.txt
ahcorde Apr 7, 2020
144e392
Removed ament_export_dependencies rosidl_cmake
ahcorde Apr 8, 2020
009831f
Merge remote-tracking branch 'origin/master' into ahcorde/feature/spl…
ahcorde Apr 9, 2020
ed42d18
fixed test_msg_builder directories
ahcorde Apr 9, 2020
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
67 changes: 26 additions & 41 deletions rosidl_generator_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,10 @@ endif()

find_package(ament_cmake_python REQUIRED)
find_package(ament_cmake_ros REQUIRED)
find_package(rosidl_typesupport_interface REQUIRED)

include_directories(include)
add_library(${PROJECT_NAME}
"src/message_bounds.c"
"src/message_type_support.c"
"src/primitives_sequence_functions.c"
"src/service_type_support.c"
"src/string_functions.c"
"src/u16string_functions.c"
)
ament_target_dependencies(${PROJECT_NAME}
"rosidl_typesupport_interface")
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(${PROJECT_NAME} PROPERTIES
COMPILE_OPTIONS -Wall -Wextra -Wpedantic)
endif()
if(WIN32)
target_compile_definitions(${PROJECT_NAME}
PRIVATE "ROSIDL_GENERATOR_C_BUILDING_DLL")
endif()
find_package(rosidl_runtime_c REQUIRED)

ament_export_dependencies(rosidl_cmake)
ament_export_dependencies(rosidl_typesupport_interface)
ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})

ament_index_register_resource("rosidl_generator_packages")

ament_python_install_package(${PROJECT_NAME})
Expand All @@ -59,7 +36,6 @@ if(BUILD_TESTING)
# Trick ament_target_dependencies() into thinking this package has been found
set(rosidl_generator_c_FOUND "1")
set(rosidl_generator_c_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(rosidl_generator_c_LIBRARIES "${PROJECT_NAME}")

rosidl_generator_c_extras(
"${CMAKE_CURRENT_SOURCE_DIR}/bin/rosidl_generator_c"
Expand All @@ -76,8 +52,7 @@ if(BUILD_TESTING)
add_executable(test_compilation_c test/test_compilation.c test/separate_compilation.c)
add_executable(test_interfaces_c test/test_interfaces.c)
add_executable(test_invalid_initialization_c test/test_invalid_initialization.c)
add_dependencies(test_interfaces_c ${PROJECT_NAME})
add_dependencies(test_invalid_initialization_c ${PROJECT_NAME})

ament_add_test(
test_compilation_c
COMMAND "$<TARGET_FILE:test_compilation_c>"
Expand All @@ -95,10 +70,30 @@ if(BUILD_TESTING)
)

# include the built files directly, instead of their install location
include_directories("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}")
target_link_libraries(test_compilation_c ${PROJECT_NAME} ${PROJECT_NAME}_interfaces__${PROJECT_NAME})
target_link_libraries(test_interfaces_c ${PROJECT_NAME} ${PROJECT_NAME}_interfaces__${PROJECT_NAME})
target_link_libraries(test_invalid_initialization_c ${PROJECT_NAME} ${PROJECT_NAME}_interfaces__${PROJECT_NAME})
target_link_libraries(test_compilation_c
${PROJECT_NAME}_interfaces__${PROJECT_NAME}
${rosidl_runtime_c_LIBRARIES}
)
target_include_directories(test_compilation_c PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
${rosidl_runtime_c_INCLUDE_DIRS}
)
target_link_libraries(test_interfaces_c
${PROJECT_NAME}_interfaces__${PROJECT_NAME}
${rosidl_runtime_c_LIBRARIES}
)
target_include_directories(test_interfaces_c PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
${rosidl_runtime_c_INCLUDE_DIRS}
)
target_link_libraries(test_invalid_initialization_c
${PROJECT_NAME}_interfaces__${PROJECT_NAME}
${rosidl_runtime_c_LIBRARIES}
)
target_include_directories(test_invalid_initialization_c PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
${rosidl_runtime_c_INCLUDE_DIRS}
)
endif()

ament_package(
Expand All @@ -113,13 +108,3 @@ install(
DIRECTORY cmake resource
DESTINATION share/${PROJECT_NAME}
)
install(
DIRECTORY include/
DESTINATION include
)
install(
TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES})
${_pkg_name})
endforeach()
ament_target_dependencies(${rosidl_generate_interfaces_TARGET}${_target_suffix}
"rosidl_generator_c"
"rosidl_runtime_c"
"rosidl_typesupport_interface")

add_dependencies(
Expand Down
5 changes: 2 additions & 3 deletions rosidl_generator_c/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
<maintainer email="[email protected]">William Woodall</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_python</buildtool_depend>
<buildtool_depend>ament_cmake_ros</buildtool_depend>

<build_depend>rosidl_typesupport_interface</build_depend>

<buildtool_export_depend>ament_cmake</buildtool_export_depend>
<buildtool_export_depend>rosidl_cmake</buildtool_export_depend>

Expand All @@ -22,10 +21,10 @@
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>rosidl_cmake</test_depend>
<test_depend>rosidl_runtime_c</test_depend>
<test_depend>test_interface_files</test_depend>

<member_of_group>rosidl_generator_packages</member_of_group>
<member_of_group>rosidl_runtime_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
Expand Down
53 changes: 40 additions & 13 deletions rosidl_generator_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)

ament_export_dependencies(rosidl_cmake)
ament_export_dependencies(rosidl_generator_c)
ament_export_include_directories(include)

ament_index_register_resource("rosidl_generator_packages")
ament_index_register_resource("rosidl_runtime_packages")

ament_python_install_package(${PROJECT_NAME})

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
find_package(rosidl_generator_c REQUIRED)
find_package(rosidl_runtime_c REQUIRED)
find_package(rosidl_runtime_cpp REQUIRED)
find_package(test_interface_files REQUIRED)
ament_lint_auto_find_test_dependencies()

Expand Down Expand Up @@ -45,32 +43,65 @@ if(BUILD_TESTING)
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

include_directories(include
${rosidl_generator_c_INCLUDE_DIRS})

ament_add_gtest(test_bounded_vector test/test_bounded_vector.cpp)
if(TARGET test_bounded_vector)
add_dependencies(test_bounded_vector ${PROJECT_NAME})
target_include_directories(test_bounded_vector PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME})
ament_target_dependencies(test_bounded_vector
rosidl_runtime_cpp
rosidl_runtime_c)
endif()
ament_add_gtest(test_msg_initialization test/test_msg_initialization.cpp)
if(TARGET test_msg_initialization)
add_dependencies(test_msg_initialization ${PROJECT_NAME})
ament_target_dependencies(test_msg_initialization
rosidl_runtime_cpp
rosidl_runtime_c)
target_include_directories(test_msg_initialization PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
)
endif()
ament_add_gtest(test_srv_initialization test/test_srv_initialization.cpp)
if(TARGET test_srv_initialization)
add_dependencies(test_srv_initialization ${PROJECT_NAME})
ament_target_dependencies(test_srv_initialization
rosidl_runtime_cpp
rosidl_runtime_c)
target_include_directories(test_srv_initialization PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
)
endif()
ament_add_gtest(test_interfaces_cpp test/test_interfaces.cpp)
if(TARGET test_interfaces_cpp)
add_dependencies(test_interfaces_cpp ${PROJECT_NAME})
ament_target_dependencies(test_interfaces_cpp
rosidl_runtime_cpp
rosidl_runtime_c)
target_include_directories(test_interfaces_cpp PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
)
endif()
ament_add_gtest(test_msg_datatype test/test_msg_datatype.cpp)
if(TARGET test_msg_datatype)
add_dependencies(test_msg_datatype ${PROJECT_NAME})
ament_target_dependencies(test_msg_datatype
rosidl_runtime_cpp
rosidl_runtime_c)
target_include_directories(test_msg_datatype PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
)
endif()
ament_add_gtest(test_traits test/test_traits.cpp)
if(TARGET test_traits)
add_dependencies(test_traits ${PROJECT_NAME})
ament_target_dependencies(test_traits
rosidl_runtime_cpp
rosidl_runtime_c)
target_include_directories(test_traits PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
)
endif()
# include the built files directly, instead of their install location
include_directories("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}")
endif()

ament_package(
Expand All @@ -85,7 +116,3 @@ install(
DIRECTORY cmake resource
DESTINATION share/${PROJECT_NAME}
)
install(
DIRECTORY include/
DESTINATION include
)
5 changes: 3 additions & 2 deletions rosidl_generator_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<maintainer email="[email protected]">Dirk Thomas</maintainer>
<license>Apache License 2.0</license>


<buildtool_depend>ament_cmake</buildtool_depend>

<buildtool_export_depend>ament_cmake</buildtool_export_depend>
Expand All @@ -21,11 +22,11 @@
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<test_depend>rosidl_cmake</test_depend>
<test_depend>rosidl_generator_c</test_depend>
<test_depend>rosidl_runtime_cpp</test_depend>
<test_depend>rosidl_runtime_c</test_depend>
<test_depend>test_interface_files</test_depend>

<member_of_group>rosidl_generator_packages</member_of_group>
<member_of_group>rosidl_runtime_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
Expand Down
59 changes: 59 additions & 0 deletions rosidl_runtime_c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
cmake_minimum_required(VERSION 3.5)

project(rosidl_runtime_c C)

# Default to C11
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 11)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake_ros REQUIRED)
find_package(rosidl_typesupport_interface REQUIRED)

include_directories(include)
add_library(${PROJECT_NAME}
"src/message_bounds.c"
"src/message_type_support.c"
"src/primitives_sequence_functions.c"
"src/service_type_support.c"
"src/string_functions.c"
"src/u16string_functions.c"
)
ament_target_dependencies(${PROJECT_NAME}
"rosidl_typesupport_interface")
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(${PROJECT_NAME} PROPERTIES
COMPILE_OPTIONS -Wall -Wextra -Wpedantic)
endif()
if(WIN32)
target_compile_definitions(${PROJECT_NAME}
PRIVATE "ROSIDL_GENERATOR_C_BUILDING_DLL")
endif()

ament_export_dependencies(rosidl_typesupport_interface)
ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})

ament_index_register_resource("rosidl_runtime_packages")

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

install(
DIRECTORY include/
DESTINATION include
)
install(
TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)

ament_package()
26 changes: 26 additions & 0 deletions rosidl_runtime_c/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosidl_runtime_c</name>
<version>0.8.2</version>
<description>Generate the ROS interfaces in C.</description>
<maintainer email="[email protected]">William Woodall</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_ros</buildtool_depend>

<build_depend>rosidl_typesupport_interface</build_depend>

<buildtool_export_depend>ament_cmake</buildtool_export_depend>

<build_export_depend>rosidl_typesupport_interface</build_export_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<member_of_group>rosidl_runtime_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
22 changes: 22 additions & 0 deletions rosidl_runtime_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.5)

project(rosidl_runtime_cpp)

find_package(ament_cmake REQUIRED)

ament_export_dependencies(rosidl_cmake)
ament_export_include_directories(include)

ament_index_register_resource("rosidl_runtime_packages")

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

install(
DIRECTORY include/
DESTINATION include
)

ament_package()
22 changes: 22 additions & 0 deletions rosidl_runtime_cpp/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosidl_runtime_cpp</name>
<version>0.8.2</version>
<description>Generate the ROS interfaces in C++.</description>
<maintainer email="[email protected]">Dirk Thomas</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<buildtool_export_depend>ament_cmake</buildtool_export_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<member_of_group>rosidl_runtime_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
2 changes: 1 addition & 1 deletion rosidl_typesupport_introspection_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ find_package(ament_cmake_python REQUIRED)
find_package(ament_cmake_ros REQUIRED)

ament_export_dependencies(rosidl_cmake)
ament_export_dependencies(rosidl_generator_c)
ament_export_dependencies(rosidl_runtime_c)
# The reason the impl folder is exported is that it contains the implementation
# for the get_*_type_support_handle functions and defines the opensplice
# specific version of these functions.
Expand Down
Loading