Skip to content

Commit 16c0650

Browse files
Updated CMakeLists.txt
1 parent 6e15150 commit 16c0650

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

CMakeLists.txt

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,32 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
55
add_compile_options(-Wall -Wextra -Wpedantic)
66
endif()
77

8+
# Default to C++14
9+
if(NOT CMAKE_CXX_STANDARD)
10+
set(CMAKE_CXX_STANDARD 14)
11+
endif()
12+
813
# find dependencies
914
find_package(ament_cmake REQUIRED)
10-
# uncomment the following section in order to fill in
11-
# further dependencies manually.
12-
# find_package(<dependency> REQUIRED)
15+
find_package(rclcpp REQUIRED)
16+
find_package(std_msgs REQUIRED)
17+
18+
19+
add_executable(talker src/publisher_member_function.cpp include/beginner_tutorials/publisher_function.hpp)
20+
ament_target_dependencies(talker rclcpp std_msgs)
21+
22+
add_executable(listener src/subscriber_member_function.cpp include/beginner_tutorials/subscriber_function.hpp)
23+
ament_target_dependencies(listener rclcpp std_msgs)
24+
1325

14-
add_executable(publisher_member_function src/publisher_member_function.cpp)
15-
target_include_directories(publisher_member_function PUBLIC
16-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
17-
$<INSTALL_INTERFACE:include>)
18-
target_compile_features(publisher_member_function PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
26+
# target_include_directories(publisher_member_function PUBLIC
27+
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
28+
# $<INSTALL_INTERFACE:include>)
29+
# target_compile_features(publisher_member_function PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
1930

20-
install(TARGETS publisher_member_function
31+
install(TARGETS
32+
talker
33+
listener
2134
DESTINATION lib/${PROJECT_NAME})
2235

2336
if(BUILD_TESTING)

0 commit comments

Comments
 (0)