Skip to content

Commit

Permalink
Merge branch 'modernize_cmake' into win-build
Browse files Browse the repository at this point in the history
  • Loading branch information
urfeex committed Jan 10, 2025
2 parents 0f758dd + 11b82d1 commit 3bf52bb
Show file tree
Hide file tree
Showing 13 changed files with 328 additions and 242 deletions.
11 changes: 2 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.14.0)
project(ur_client_library)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/" ${CMAKE_MODULE_PATH})
Expand All @@ -15,12 +15,6 @@ if(MSVC)
set(BUILD_SHARED_LIBS OFF)
endif()

##
## Check C++11 support / enable global pedantic and Wall
##
include(DefineCXX17CompilerFlag)
DEFINE_CXX_17_COMPILER_FLAG(CXX17_FLAG)

add_library(urcl
src/comm/tcp_socket.cpp
src/comm/tcp_server.cpp
Expand Down Expand Up @@ -55,14 +49,13 @@ add_library(urcl
src/helpers.cpp
)
add_library(ur_client_library::urcl ALIAS urcl)
target_compile_features(urcl PUBLIC cxx_std_17)

if(MSVC)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/endian)
target_link_libraries(urcl ws2_32)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic")
target_compile_options(urcl PRIVATE -Wall -Wextra -Wno-unused-parameter)

if(WITH_ASAN)
target_compile_options(urcl PUBLIC -fsanitize=address)
target_link_options(urcl PUBLIC -fsanitize=address)
Expand Down
55 changes: 0 additions & 55 deletions CMakeModules/DefineCXX11CompilerFlag.cmake

This file was deleted.

55 changes: 0 additions & 55 deletions CMakeModules/DefineCXX14CompilerFlag.cmake

This file was deleted.

58 changes: 0 additions & 58 deletions CMakeModules/DefineCXX17CompilerFlag.cmake

This file was deleted.

22 changes: 5 additions & 17 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,61 +1,49 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.14.0)
project(ur_driver_examples)

# find_package(ur_client_library REQUIRED)

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

add_executable(driver_example
full_driver.cpp)
target_compile_options(driver_example PUBLIC ${CXX17_FLAG})
target_link_libraries(driver_example ur_client_library::urcl)

add_executable(primary_pipeline_example
primary_pipeline.cpp)
target_compile_options(primary_pipeline_example PUBLIC ${CXX17_FLAG})
target_link_libraries(primary_pipeline_example ur_client_library::urcl)

add_executable(primary_pipeline_calibration_example
primary_pipeline_calibration.cpp)
target_compile_options(primary_pipeline_calibration_example PUBLIC ${CXX17_FLAG})
target_link_libraries(primary_pipeline_calibration_example ur_client_library::urcl)

add_executable(rtde_client_example
rtde_client.cpp)
target_compile_options(rtde_client_example PUBLIC ${CXX17_FLAG})
target_link_libraries(rtde_client_example ur_client_library::urcl)

add_executable(dashboard_example
dashboard_example.cpp)
target_compile_options(dashboard_example PUBLIC ${CXX17_FLAG})
target_link_libraries(dashboard_example ur_client_library::urcl)

add_executable(spline_example
spline_example.cpp)
target_compile_options(spline_example PUBLIC ${CXX17_FLAG})
target_link_libraries(spline_example ur_client_library::urcl)

add_executable(tool_contact_example
tool_contact_example.cpp)
target_compile_options(tool_contact_example PUBLIC ${CXX17_FLAG})
target_link_libraries(tool_contact_example ur_client_library::urcl)

add_executable(freedrive_example
freedrive_example.cpp)
target_compile_options(freedrive_example PUBLIC ${CXX17_FLAG})
target_link_libraries(freedrive_example ur_client_library::urcl)

add_executable(force_mode_example
force_mode_example.cpp)
target_compile_options(force_mode_example PUBLIC ${CXX17_FLAG})
target_link_libraries(force_mode_example ur_client_library::urcl)

add_executable(script_sender_example
script_sender.cpp)
target_compile_options(script_sender_example PUBLIC ${CXX17_FLAG})
target_link_libraries(script_sender_example ur_client_library::urcl)

add_executable(trajectory_point_interface_example
trajectory_point_interface.cpp)
target_link_libraries(trajectory_point_interface_example ur_client_library::urcl)
Loading

0 comments on commit 3bf52bb

Please sign in to comment.