From 6578e720ceb7795db425fc224242792a86418b28 Mon Sep 17 00:00:00 2001 From: Pierre Gergondet Date: Thu, 9 Feb 2023 16:29:42 +0900 Subject: [PATCH 1/2] [conan] Use the closes build type that is compatible --- kortex_driver/CMakeLists.txt | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/kortex_driver/CMakeLists.txt b/kortex_driver/CMakeLists.txt index 1b3cb4bf..73c352c1 100644 --- a/kortex_driver/CMakeLists.txt +++ b/kortex_driver/CMakeLists.txt @@ -62,38 +62,52 @@ generate_messages(DEPENDENCIES std_msgs actionlib_msgs) ## declare a catkin package catkin_package(CATKIN_DEPENDS actionlib_msgs) +function(get_closest_build_type VAR_OUT) + if(NOT DEFINED CMAKE_BUILD_TYPE) + set(${VAR_OUT} "Debug" PARENT_SCOPE) + return() + endif() + string(TOUPPER ${CMAKE_BUILD_TYPE} BTYPE) + if("${BTYPE}" STREQUAL "DEBUG") + set(${VAR_OUT} "Debug" PARENT_SCOPE) + else() + set(${VAR_OUT} "Release" PARENT_SCOPE) + endif() +endfunction() + if(USE_CONAN) # Include conan.cmake module and download Kortex API from artifactory include(${PROJECT_SOURCE_DIR}/cmake/conan.cmake) conan_check(REQUIRED) conan_add_remote(NAME kinova_public URL https://artifactory.kinovaapps.com/artifactory/api/conan/conan-public) + get_closest_build_type(CONAN_BUILD_TYPE) if("${CONAN_TARGET_PLATFORM}" STREQUAL "x86") conan_cmake_run(CONANFILE conanfile.py UPDATE BASIC_SETUP CMAKE_TARGETS NO_OUTPUT_DIRS - SETTINGS kortex_api_cpp:compiler=gcc kortex_api_cpp:compiler.version=5 kortex_api_cpp:compiler.libcxx=libstdc++11) + SETTINGS kortex_api_cpp:compiler=gcc kortex_api_cpp:compiler.version=5 kortex_api_cpp:compiler.libcxx=libstdc++11 kortex_api_cpp:build_type=${CONAN_BUILD_TYPE}) elseif("${CONAN_TARGET_PLATFORM}" STREQUAL "artik710") conan_cmake_run(CONANFILE conanfile.py UPDATE BASIC_SETUP CMAKE_TARGETS NO_OUTPUT_DIRS - SETTINGS kortex_api_cpp:arch=armv7 kortex_api_cpp:compiler=gcc kortex_api_cpp:compiler.version=5 kortex_api_cpp:compiler.libcxx=libstdc++11 + SETTINGS kortex_api_cpp:arch=armv7 kortex_api_cpp:compiler=gcc kortex_api_cpp:compiler.version=5 kortex_api_cpp:compiler.libcxx=libstdc++11 kortex_api_cpp:build_type=${CONAN_BUILD_TYPE} ENV TARGET=artik710) elseif("${CONAN_TARGET_PLATFORM}" STREQUAL "imx6") conan_cmake_run(CONANFILE conanfile.py UPDATE BASIC_SETUP CMAKE_TARGETS NO_OUTPUT_DIRS - SETTINGS kortex_api_cpp:arch=armv7 kortex_api_cpp:compiler=gcc kortex_api_cpp:compiler.version=6.4 kortex_api_cpp:compiler.libcxx=libstdc++11 + SETTINGS kortex_api_cpp:arch=armv7 kortex_api_cpp:compiler=gcc kortex_api_cpp:compiler.version=6.4 kortex_api_cpp:compiler.libcxx=libstdc++11 kortex_api_cpp:build_type=${CONAN_BUILD_TYPE} ENV TARGET=imx6) elseif("${CONAN_TARGET_PLATFORM}" STREQUAL "jetson") conan_cmake_run(CONANFILE conanfile.py UPDATE BASIC_SETUP CMAKE_TARGETS NO_OUTPUT_DIRS - SETTINGS kortex_api_cpp:arch=armv7 kortex_api_cpp:compiler=gcc kortex_api_cpp:compiler.version=7 kortex_api_cpp:compiler.libcxx=libstdc++11 + SETTINGS kortex_api_cpp:arch=armv7 kortex_api_cpp:compiler=gcc kortex_api_cpp:compiler.version=7 kortex_api_cpp:compiler.libcxx=libstdc++11 kortex_api_cpp:build_type=${CONAN_BUILD_TYPE} ENV TARGET=jetson) endif() endif() From 24da986d6a6babd817e7ac264fe9b13ad346ca96 Mon Sep 17 00:00:00 2001 From: Pierre Gergondet Date: Thu, 2 Mar 2023 09:42:27 +0900 Subject: [PATCH 2/2] Add a note regarding the available builds --- kortex_driver/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kortex_driver/readme.md b/kortex_driver/readme.md index 20696a0f..df5bf155 100644 --- a/kortex_driver/readme.md +++ b/kortex_driver/readme.md @@ -230,6 +230,8 @@ Many things have been changed in the ros_kortex repository between versions 1.1. From release 2.2.0 onwards, the Kortex API is automatically downloaded from our Artifactory Conan server. The steps to install and setup Conan have been added to the root readme file. Conan downloads the binaries and header files in the Conan cache, by default situated in the `~/.conan/` directory. +Note that we only provide packages for the Release and Debug configurations. CMake will pick the most appropriate one given the `CMAKE_BUILD_TYPE` of your catkin workspace. + If you want to learn more about Conan, you can read about it [on their website](https://conan.io/). If you still want to download the ZIP files for the API, you can find the link in the [Kortex repository](https://github.com/Kinovarobotics/kortex).