Skip to content

Commit 11b82d1

Browse files
committed
Update c++ dependency using target_compile_features
1 parent 423801a commit 11b82d1

File tree

6 files changed

+4
-224
lines changed

6 files changed

+4
-224
lines changed

CMakeLists.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.0.2)
1+
cmake_minimum_required(VERSION 3.14.0)
22
project(ur_client_library)
33

44
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/" ${CMAKE_MODULE_PATH})
@@ -10,13 +10,6 @@ endif()
1010

1111
option(WITH_ASAN "Compile with address sanitizer support" OFF)
1212

13-
##
14-
## Check C++11 support / enable global pedantic and Wall
15-
##
16-
include(DefineCXX17CompilerFlag)
17-
DEFINE_CXX_17_COMPILER_FLAG(CXX17_FLAG)
18-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic")
19-
2013
add_library(urcl SHARED
2114
src/comm/tcp_socket.cpp
2215
src/comm/tcp_server.cpp
@@ -52,7 +45,7 @@ add_library(urcl SHARED
5245
)
5346
add_library(ur_client_library::urcl ALIAS urcl)
5447
target_compile_options(urcl PRIVATE -Wall -Wextra -Wno-unused-parameter)
55-
target_compile_options(urcl PUBLIC ${CXX17_FLAG})
48+
target_compile_features(urcl PUBLIC cxx_std_17)
5649
if(WITH_ASAN)
5750
target_compile_options(urcl PUBLIC -fsanitize=address)
5851
target_link_options(urcl PUBLIC -fsanitize=address)

CMakeModules/DefineCXX11CompilerFlag.cmake

Lines changed: 0 additions & 55 deletions
This file was deleted.

CMakeModules/DefineCXX14CompilerFlag.cmake

Lines changed: 0 additions & 55 deletions
This file was deleted.

CMakeModules/DefineCXX17CompilerFlag.cmake

Lines changed: 0 additions & 55 deletions
This file was deleted.

examples/CMakeLists.txt

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,49 @@
1-
cmake_minimum_required(VERSION 3.0.2)
1+
cmake_minimum_required(VERSION 3.14.0)
22
project(ur_driver_examples)
33

44
# find_package(ur_client_library REQUIRED)
55

6-
# #
7-
# # Check C++11 support / enable global pedantic and Wall
8-
# #
9-
include(DefineCXX17CompilerFlag)
10-
DEFINE_CXX_17_COMPILER_FLAG(CXX17_FLAG)
11-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic")
126

137
add_executable(driver_example
148
full_driver.cpp)
15-
target_compile_options(driver_example PUBLIC ${CXX17_FLAG})
169
target_link_libraries(driver_example ur_client_library::urcl)
1710

1811
add_executable(primary_pipeline_example
1912
primary_pipeline.cpp)
20-
target_compile_options(primary_pipeline_example PUBLIC ${CXX17_FLAG})
2113
target_link_libraries(primary_pipeline_example ur_client_library::urcl)
2214

2315
add_executable(primary_pipeline_calibration_example
2416
primary_pipeline_calibration.cpp)
25-
target_compile_options(primary_pipeline_calibration_example PUBLIC ${CXX17_FLAG})
2617
target_link_libraries(primary_pipeline_calibration_example ur_client_library::urcl)
2718

2819
add_executable(rtde_client_example
2920
rtde_client.cpp)
30-
target_compile_options(rtde_client_example PUBLIC ${CXX17_FLAG})
3121
target_link_libraries(rtde_client_example ur_client_library::urcl)
3222

3323
add_executable(dashboard_example
3424
dashboard_example.cpp)
35-
target_compile_options(dashboard_example PUBLIC ${CXX17_FLAG})
3625
target_link_libraries(dashboard_example ur_client_library::urcl)
3726

3827
add_executable(spline_example
3928
spline_example.cpp)
40-
target_compile_options(spline_example PUBLIC ${CXX17_FLAG})
4129
target_link_libraries(spline_example ur_client_library::urcl)
4230

4331
add_executable(tool_contact_example
4432
tool_contact_example.cpp)
45-
target_compile_options(tool_contact_example PUBLIC ${CXX17_FLAG})
4633
target_link_libraries(tool_contact_example ur_client_library::urcl)
4734

4835
add_executable(freedrive_example
4936
freedrive_example.cpp)
50-
target_compile_options(freedrive_example PUBLIC ${CXX17_FLAG})
5137
target_link_libraries(freedrive_example ur_client_library::urcl)
5238

5339
add_executable(force_mode_example
5440
force_mode_example.cpp)
55-
target_compile_options(force_mode_example PUBLIC ${CXX17_FLAG})
5641
target_link_libraries(force_mode_example ur_client_library::urcl)
5742

5843
add_executable(script_sender_example
5944
script_sender.cpp)
60-
target_compile_options(script_sender_example PUBLIC ${CXX17_FLAG})
6145
target_link_libraries(script_sender_example ur_client_library::urcl)
6246

6347
add_executable(trajectory_point_interface_example
6448
trajectory_point_interface.cpp)
65-
target_compile_options(trajectory_point_interface_example PUBLIC ${CXX17_FLAG})
6649
target_link_libraries(trajectory_point_interface_example ur_client_library::urcl)

0 commit comments

Comments
 (0)