-
Notifications
You must be signed in to change notification settings - Fork 492
BUMP 4.0.4 #678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
BUMP 4.0.4 #678
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8cdd787
use cmake in c and cpp
GyuH13 a646c22
remove p1 , p2 in cmake prefix
GyuH13 78ef8e8
Rename CMake project to 'dynamixel_sdk_c' and add global variables fo…
GyuH13 f3c6f04
bump
GyuH13 a6d97c9
add colcon ignore in standalone source file
GyuH13 a7d8263
reflect review
GyuH13 08abf4a
Update CMake configuration for dynamixel_sdk and examples
GyuH13 6a44b99
Remove conditional ARM architecture handling from CMakeLists.txt for …
GyuH13 e3e1cc7
Update version to 4.0.4 in pyproject.toml for dynamixel-sdk
GyuH13 aaed3b5
Merge pull request #677 from ROBOTIS-GIT/feature-use-cmake
GyuH13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,183 @@ | ||
| cmake_minimum_required(VERSION 3.10) | ||
|
|
||
| # Standalone C++ SDK: configure/build from the c++/ directory (paths below are relative to c++/). | ||
| project(dynamixel_sdk VERSION 4.0.4 LANGUAGES CXX) | ||
|
|
||
| set(_dxl_pkg "dynamixel_sdk") | ||
|
|
||
| # -------------------------------------------------------- | ||
| # 1. Build Environment Configuration | ||
| # -------------------------------------------------------- | ||
| set(CMAKE_CXX_STANDARD 17) | ||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
|
||
| set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
|
|
||
| option(DYNAMIXEL_SDK_RUN_LDCONFIG | ||
| "Run ldconfig after install (usually requires root). Recommended OFF." | ||
| OFF | ||
| ) | ||
|
|
||
| # -------------------------------------------------------- | ||
| # 2. Build C++ Library (common sources + platform-specific, like c/CMakeLists.txt) | ||
| # -------------------------------------------------------- | ||
| set(_dxl_common_sources | ||
| src/dynamixel_sdk/group_bulk_read.cpp | ||
| src/dynamixel_sdk/group_bulk_write.cpp | ||
| src/dynamixel_sdk/group_sync_read.cpp | ||
| src/dynamixel_sdk/group_sync_write.cpp | ||
| src/dynamixel_sdk/group_fast_bulk_read.cpp | ||
| src/dynamixel_sdk/group_fast_sync_read.cpp | ||
| src/dynamixel_sdk/group_handler.cpp | ||
| src/dynamixel_sdk/packet_handler.cpp | ||
| src/dynamixel_sdk/port_handler.cpp | ||
| src/dynamixel_sdk/protocol1_packet_handler.cpp | ||
| src/dynamixel_sdk/protocol2_packet_handler.cpp | ||
| ) | ||
|
|
||
| if(APPLE) | ||
| set(_dxl_platform_sources | ||
| src/dynamixel_sdk/port_handler_mac.cpp | ||
| ) | ||
| elseif(WIN32) | ||
| set(_dxl_platform_sources | ||
| src/dynamixel_sdk/port_handler_windows.cpp | ||
| ) | ||
| else() | ||
| set(_dxl_platform_sources | ||
| src/dynamixel_sdk/port_handler_linux.cpp | ||
| src/dynamixel_easy_sdk/connector.cpp | ||
| src/dynamixel_easy_sdk/control_table.cpp | ||
| src/dynamixel_easy_sdk/motor.cpp | ||
| src/dynamixel_easy_sdk/dynamixel_error.cpp | ||
| src/dynamixel_easy_sdk/group_executor.cpp | ||
| ) | ||
| endif() | ||
|
|
||
| set(_dxl_sources | ||
| ${_dxl_common_sources} | ||
| ${_dxl_platform_sources} | ||
| ) | ||
|
|
||
| add_library(dynamixel_sdk SHARED ${_dxl_sources}) | ||
|
|
||
| target_include_directories(dynamixel_sdk PUBLIC | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
| $<INSTALL_INTERFACE:include> | ||
| $<INSTALL_INTERFACE:include/dynamixel_sdk> | ||
| ) | ||
| target_include_directories(dynamixel_sdk PRIVATE | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/include/dynamixel_sdk | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/include/dynamixel_easy_sdk | ||
| ) | ||
|
|
||
| set_target_properties(dynamixel_sdk PROPERTIES | ||
| VERSION ${PROJECT_VERSION} | ||
| SOVERSION 2 | ||
| CXX_STANDARD 17 | ||
| CXX_STANDARD_REQUIRED ON | ||
| OUTPUT_NAME "dxl_cpp" | ||
| ) | ||
|
|
||
| if(UNIX AND NOT APPLE) | ||
| target_link_libraries(dynamixel_sdk PRIVATE rt) | ||
| endif() | ||
|
|
||
| if(NOT APPLE) | ||
| set(_control_table_path "${CMAKE_INSTALL_PREFIX}/share/${_dxl_pkg}/control_table") | ||
| target_compile_definitions(dynamixel_sdk | ||
| PUBLIC | ||
| CONTROL_TABLE_PATH="${_control_table_path}" | ||
| ) | ||
| endif() | ||
|
|
||
| # -------------------------------------------------------- | ||
| # 3. Installation | ||
| # -------------------------------------------------------- | ||
| include(GNUInstallDirs) | ||
|
|
||
| install( | ||
| DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/dynamixel_sdk/ | ||
| DESTINATION include/${_dxl_pkg} | ||
| ) | ||
|
|
||
| if(UNIX AND NOT APPLE) | ||
| install( | ||
| DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/dynamixel_easy_sdk/ | ||
| DESTINATION include/dynamixel_easy_sdk | ||
| ) | ||
| endif() | ||
|
|
||
| if(NOT APPLE) | ||
| install( | ||
| DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../control_table/ | ||
| DESTINATION share/${_dxl_pkg}/control_table | ||
| ) | ||
| endif() | ||
|
|
||
| set(_dxl_cmake_package_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${_dxl_pkg}") | ||
|
|
||
| install( | ||
| TARGETS dynamixel_sdk | ||
| EXPORT dynamixel_sdkTargets | ||
| ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| INCLUDES DESTINATION include | ||
| ) | ||
|
|
||
| install( | ||
| EXPORT dynamixel_sdkTargets | ||
| FILE dynamixel_sdkTargets.cmake | ||
| NAMESPACE dynamixel_sdk:: | ||
| DESTINATION ${_dxl_cmake_package_dir} | ||
| ) | ||
|
|
||
| include(CMakePackageConfigHelpers) | ||
|
|
||
| configure_package_config_file( | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/cmake/dynamixel_sdkConfig.cmake.in" | ||
| "${CMAKE_CURRENT_BINARY_DIR}/dynamixel_sdkConfig.cmake" | ||
| INSTALL_DESTINATION ${_dxl_cmake_package_dir} | ||
| ) | ||
|
|
||
| write_basic_package_version_file( | ||
| "${CMAKE_CURRENT_BINARY_DIR}/dynamixel_sdkConfigVersion.cmake" | ||
| VERSION ${PROJECT_VERSION} | ||
| COMPATIBILITY SameMajorVersion | ||
| ) | ||
|
|
||
| install( | ||
| FILES | ||
| "${CMAKE_CURRENT_BINARY_DIR}/dynamixel_sdkConfig.cmake" | ||
| "${CMAKE_CURRENT_BINARY_DIR}/dynamixel_sdkConfigVersion.cmake" | ||
| DESTINATION ${_dxl_cmake_package_dir} | ||
| ) | ||
|
|
||
| if(DYNAMIXEL_SDK_RUN_LDCONFIG AND UNIX AND NOT APPLE) | ||
| install(CODE "execute_process(COMMAND ldconfig)") | ||
| endif() | ||
|
|
||
| # -------------------------------------------------------- | ||
| # 4. Uninstall / Reinstall Targets | ||
| # -------------------------------------------------------- | ||
| configure_file( | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" | ||
| "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" | ||
| IMMEDIATE @ONLY | ||
| ) | ||
|
|
||
| if(NOT TARGET uninstall) | ||
| add_custom_target(uninstall | ||
| COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake | ||
| COMMENT "Uninstalling DynamixelSDK (C++)..." | ||
| ) | ||
| endif() | ||
|
|
||
| if(NOT TARGET reinstall) | ||
| add_custom_target(reinstall | ||
| COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake | ||
| COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR} --target install | ||
| COMMENT "Reinstalling DynamixelSDK (C++)..." | ||
| ) | ||
| endif() |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Uninstall files listed in install_manifest.txt (created by cmake --install). | ||
| # Configured from cmake_uninstall.cmake.in via configure_file(... IMMEDIATE @ONLY). | ||
|
|
||
| if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") | ||
| message(FATAL_ERROR | ||
| "Cannot find @CMAKE_BINARY_DIR@/install_manifest.txt\n" | ||
| "Run: cmake --install <build-dir> (or make install) at least once so the manifest exists." | ||
| ) | ||
| endif() | ||
|
|
||
| file(STRINGS "@CMAKE_BINARY_DIR@/install_manifest.txt" _dxl_installed_files) | ||
|
|
||
| foreach(_dxl_file IN LISTS _dxl_installed_files) | ||
| string(STRIP "${_dxl_file}" _dxl_file) | ||
| if(_dxl_file STREQUAL "") | ||
| continue() | ||
| endif() | ||
| message(STATUS "Uninstalling: ${_dxl_file}") | ||
| # EXISTS is false for broken symlinks, so also check IS_SYMLINK. | ||
| if(EXISTS "${_dxl_file}" OR IS_SYMLINK "${_dxl_file}") | ||
| file(REMOVE "${_dxl_file}") | ||
| endif() | ||
| endforeach() | ||
|
|
||
| # Remove installed directories (manifest only removes files). | ||
| # Derive prefix from install_manifest.txt paths so --prefix overrides work. | ||
| set(_dxl_prefix "") | ||
| foreach(_dxl_file IN LISTS _dxl_installed_files) | ||
| string(STRIP "${_dxl_file}" _dxl_file_stripped) | ||
| if(_dxl_file_stripped STREQUAL "") | ||
| continue() | ||
| endif() | ||
|
|
||
| # Example: | ||
| # ${prefix}/include/dynamixel_sdk/dynamixel_sdk.h | ||
| if(_dxl_file_stripped MATCHES "^(.*)/@CMAKE_INSTALL_INCLUDEDIR@/dynamixel_sdk/.*$") | ||
| set(_dxl_prefix "${CMAKE_MATCH_1}") | ||
| break() | ||
| endif() | ||
| endforeach() | ||
|
|
||
| if(NOT _dxl_prefix STREQUAL "") | ||
| file(REMOVE_RECURSE "${_dxl_prefix}/@CMAKE_INSTALL_INCLUDEDIR@/dynamixel_sdk") | ||
| if(NOT APPLE) | ||
| file(REMOVE_RECURSE "${_dxl_prefix}/@CMAKE_INSTALL_INCLUDEDIR@/dynamixel_easy_sdk") | ||
| endif() | ||
|
|
||
| if(NOT APPLE) | ||
| file(REMOVE_RECURSE "${_dxl_prefix}/@CMAKE_INSTALL_DATAROOTDIR@/dynamixel_sdk/control_table") | ||
| endif() | ||
|
|
||
| file(REMOVE_RECURSE "${_dxl_prefix}/@CMAKE_INSTALL_LIBDIR@/cmake/dynamixel_sdk") | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| @PACKAGE_INIT@ | ||
|
|
||
| # Imported target: dynamixel_sdk::dynamixel_sdk | ||
| include("${CMAKE_CURRENT_LIST_DIR}/dynamixel_sdkTargets.cmake") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| cmake_minimum_required(VERSION 3.10) | ||
|
|
||
| # Standalone build for C++ DXL Monitor example (uses installed dynamixel_sdk). | ||
| if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) | ||
| project(dynamixel_sdk_cpp_examples_dxl_monitor LANGUAGES CXX) | ||
| endif() | ||
|
|
||
| find_package(dynamixel_sdk CONFIG REQUIRED) | ||
|
|
||
| add_executable(dxl_monitor "${CMAKE_CURRENT_SOURCE_DIR}/dxl_monitor.cpp") | ||
| target_link_libraries(dxl_monitor PRIVATE dynamixel_sdk::dynamixel_sdk) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| cmake_minimum_required(VERSION 3.10) | ||
|
|
||
| # Standalone build for C++ Protocol 1.0 examples (uses installed dynamixel_sdk). | ||
| if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) | ||
| project(dynamixel_sdk_cpp_examples_protocol1 LANGUAGES CXX) | ||
| endif() | ||
|
|
||
| find_package(dynamixel_sdk CONFIG REQUIRED) | ||
|
|
||
| set(_dxl_protocol1_examples | ||
| sync_write | ||
| reset | ||
| multi_port | ||
| read_write | ||
| ping | ||
| bulk_read | ||
| ) | ||
|
|
||
| foreach(_dxl_example IN LISTS _dxl_protocol1_examples) | ||
| set(_dxl_src "${CMAKE_CURRENT_SOURCE_DIR}/${_dxl_example}/${_dxl_example}.cpp") | ||
| if(NOT EXISTS "${_dxl_src}") | ||
| message(FATAL_ERROR "Missing example source: ${_dxl_src}") | ||
| endif() | ||
|
|
||
| set(_dxl_target "${_dxl_example}") | ||
| add_executable(${_dxl_target} "${_dxl_src}") | ||
| target_link_libraries(${_dxl_target} PRIVATE dynamixel_sdk::dynamixel_sdk) | ||
| endforeach() | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| cmake_minimum_required(VERSION 3.10) | ||
|
|
||
| # Standalone build for C++ Protocol 2.0 examples (uses installed dynamixel_sdk). | ||
| if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) | ||
| project(dynamixel_sdk_cpp_examples_protocol2 LANGUAGES CXX) | ||
| endif() | ||
|
|
||
| find_package(dynamixel_sdk CONFIG REQUIRED) | ||
|
|
||
| set(_dxl_protocol2_examples | ||
| broadcast_ping | ||
| ping | ||
| read_write | ||
| sync_read_write | ||
| reboot | ||
| multi_port | ||
| clear_multi_turn | ||
| factory_reset | ||
| indirect_address | ||
| fast_sync_read | ||
| fast_bulk_read | ||
| bulk_read_write | ||
| ) | ||
|
|
||
| foreach(_dxl_example IN LISTS _dxl_protocol2_examples) | ||
| set(_dxl_src "${CMAKE_CURRENT_SOURCE_DIR}/${_dxl_example}/${_dxl_example}.cpp") | ||
| if(NOT EXISTS "${_dxl_src}") | ||
| message(FATAL_ERROR "Missing example source: ${_dxl_src}") | ||
| endif() | ||
|
|
||
| set(_dxl_target "${_dxl_example}") | ||
| add_executable(${_dxl_target} "${_dxl_src}") | ||
| target_link_libraries(${_dxl_target} PRIVATE dynamixel_sdk::dynamixel_sdk) | ||
| endforeach() | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| cmake_minimum_required(VERSION 3.10) | ||
|
|
||
| # Standalone build for C++ Protocol Combined example (uses installed dynamixel_sdk). | ||
| if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) | ||
| project(dynamixel_sdk_cpp_examples_protocol_combined LANGUAGES CXX) | ||
| endif() | ||
|
|
||
| find_package(dynamixel_sdk CONFIG REQUIRED) | ||
|
|
||
| add_executable(protocol_combined | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/protocol_combined.cpp" | ||
| ) | ||
| target_link_libraries(protocol_combined PRIVATE dynamixel_sdk::dynamixel_sdk) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.