From 1cc025b7e8f494d4155629bf90c2231c61180f72 Mon Sep 17 00:00:00 2001 From: ziggy Date: Thu, 9 Nov 2023 00:45:49 +0200 Subject: [PATCH 1/2] add include/lib to cmake, no need to install. remove install.sh --- CMakeLists.txt | 3 ++- README.md | 5 ----- install.sh | 19 ------------------- 3 files changed, 2 insertions(+), 25 deletions(-) delete mode 100755 install.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ae4e69..99e287b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 3.5) SET(CMAKE_CXX_STANDARD 17) -include_directories(/usr/local/include/ddscxx /usr/local/include/iceoryx/v2.0.2) +include_directories(include thirdparty/include thirdparty/include/ddscxx thirdparty/include/iceoryx/v2.0.2) +link_directories(lib/x86_64 thirdparty/lib/x86_64) link_libraries(unitree_sdk2 ddsc ddscxx rt pthread) add_executable(test_publisher example/helloworld/publisher.cpp example/helloworld/HelloWorldData.cpp) diff --git a/README.md b/README.md index 0ffd31c..d5fa8f7 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,6 @@ Unitree robot sdk version 2. * CPU (aarch64 and x86_64) * Compiler (gcc version 9.4.0) -### Installation -```bash -sudo ./install.sh - -``` ### Build examples ```bash diff --git a/install.sh b/install.sh deleted file mode 100755 index 16bcca9..0000000 --- a/install.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -WorkDir=$(cd $(dirname $0); pwd) -echo "WrokDir=$WorkDir" - -Arch=$(uname -m) -echo "CPU Arch=$Arch" - -ThirdParty=$WorkDir/thirdparty - -set -e - -cp -r $WorkDir/include/* /usr/local/include -cp -r $WorkDir/lib/$Arch/* /usr/local/lib - -cp -r $ThirdParty/include/* /usr/local/include -cp -r $ThirdParty/lib/$Arch/* /usr/local/lib - -ldconfig From 2ff77267f269ade73be909b6a344ba7943bf2df6 Mon Sep 17 00:00:00 2001 From: ziggy Date: Thu, 9 Nov 2023 11:57:54 +0200 Subject: [PATCH 2/2] use CMAKE_HOST_SYSTEM_PROCESSOR --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99e287b..efd71fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.5) SET(CMAKE_CXX_STANDARD 17) include_directories(include thirdparty/include thirdparty/include/ddscxx thirdparty/include/iceoryx/v2.0.2) -link_directories(lib/x86_64 thirdparty/lib/x86_64) +link_directories(lib/${CMAKE_HOST_SYSTEM_PROCESSOR} thirdparty/lib/${CMAKE_HOST_SYSTEM_PROCESSOR}) link_libraries(unitree_sdk2 ddsc ddscxx rt pthread) add_executable(test_publisher example/helloworld/publisher.cpp example/helloworld/HelloWorldData.cpp)