Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 0 additions & 5 deletions ros2cli_test_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
cmake_minimum_required(VERSION 3.20)
project(ros2cli_test_interfaces)

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
Expand Down
15 changes: 6 additions & 9 deletions ros2lifecycle_test_fixtures/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@ cmake_minimum_required(VERSION 3.20)

project(ros2lifecycle_test_fixtures)

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_ros_core REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
find_package(rclcpp REQUIRED)

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

find_package(ament_cmake REQUIRED)
find_package(rclcpp_lifecycle REQUIRED)
find_package(rclcpp REQUIRED)

add_executable(simple_lifecycle_node
src/simple_lifecycle_node.cpp)

target_link_libraries(simple_lifecycle_node PRIVATE
rclcpp_lifecycle::rclcpp_lifecycle)
rclcpp_lifecycle::rclcpp_lifecycle
ament_cmake_ros_core::ament_ros_defaults)

install(TARGETS
simple_lifecycle_node
Expand Down
1 change: 1 addition & 0 deletions ros2lifecycle_test_fixtures/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<author email="michel@ekumenlabs.com">Michel Hidalgo</author>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_ros_core</buildtool_depend>

<depend>rclcpp</depend>
<depend>rclcpp_lifecycle</depend>
Expand Down
4 changes: 2 additions & 2 deletions ros2pkg/ros2pkg/resource/ament_cmake/CMakeLists.txt.em
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ find_package(@dep REQUIRED)

add_library(@(cpp_library_name) src/@(cpp_library_name).cpp)
add_library(@(project_name)::@(cpp_library_name) ALIAS @(cpp_library_name))
target_compile_features(@(cpp_library_name) PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
target_compile_features(@(cpp_library_name) PUBLIC c_std_17 cxx_std_20) # Require C17 and C++20
target_include_directories(@(cpp_library_name) PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>)
Expand Down Expand Up @@ -61,7 +61,7 @@ target_include_directories(@(cpp_node_name) PUBLIC
@[ if cpp_library_name]@
target_link_libraries(@(cpp_node_name) @(cpp_library_name))
@[ else]@
target_compile_features(@(cpp_node_name) PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
target_compile_features(@(cpp_node_name) PUBLIC c_std_17 cxx_std_20) # Require C17 and C++20
@[ if dependencies]@
target_link_libraries(
@(cpp_node_name)
Expand Down
4 changes: 2 additions & 2 deletions ros2pkg/ros2pkg/resource/cmake/CMakeLists.txt.em
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ find_package(@dep REQUIRED)

add_library(@(cpp_library_name) SHARED src/@(cpp_library_name).cpp)
add_library(@(project_name)::@(cpp_library_name) ALIAS @(cpp_library_name))
target_compile_features(@(cpp_library_name) PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
target_compile_features(@(cpp_library_name) PUBLIC c_std_17 cxx_std_20) # Require C17 and C++20
target_include_directories(@(cpp_library_name) PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
Expand Down Expand Up @@ -72,7 +72,7 @@ target_include_directories(@(cpp_node_name) PUBLIC
@[ if cpp_library_name]@
target_link_libraries(@(cpp_node_name) @(cpp_library_name))
@[ else]@
target_compile_features(@(cpp_node_name) PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
target_compile_features(@(cpp_node_name) PUBLIC c_std_17 cxx_std_20) # Require C17 and C++20
@[ if dependencies]@
target_link_libraries(@(cpp_node_name)
@[ for dep in dependencies]@
Expand Down