From 3be82e4eb07fc3ec35717bd185e365aabd63db86 Mon Sep 17 00:00:00 2001 From: Shun Hasegawa Date: Tue, 18 Feb 2025 21:25:22 +0900 Subject: [PATCH] Enable to compile on melodic - https://github.com/frankaemika/libfranka-release/commit/1dffd4fad22ae455dab1d16ea14a5f4f672f2418 - https://github.com/frankaemika/libfranka-release/commit/d10e61b015ce171c9e4bab213ff002ebea2a1c62 - https://stackoverflow.com/questions/34443128/cmake-install-targets-in-subdirectories - Skip compiling tests to avoid compilation errors - Add dependency to pinocchio to make it installable via rosdep install --- CMakeLists.txt | 19 +++++++++++-------- common/CMakeLists.txt | 2 +- examples/CMakeLists.txt | 5 ++--- package.xml | 2 ++ 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e876709..db8e675 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,7 @@ if(BUILD_COVERAGE) endif() ## Submodules +add_library(libfranka-common INTERFACE) # https://stackoverflow.com/questions/34443128/cmake-install-targets-in-subdirectories add_subdirectory(common) ## Library @@ -119,7 +120,7 @@ endif() target_include_directories(franka PUBLIC $ - $ + $ ) target_link_libraries(franka PRIVATE @@ -135,16 +136,15 @@ target_link_libraries(franka PUBLIC ) ## Installation -include(GNUInstallDirs) -set(INSTALL_CMAKE_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/Franka) +set(INSTALL_CMAKE_CONFIG_DIR share/franka/cmake) install(TARGETS franka libfranka-common EXPORT FrankaTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION lib + RUNTIME DESTINATION lib/libfranka + ARCHIVE DESTINATION lib ) -install(DIRECTORY include/ common/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +install(DIRECTORY include/ common/include/ DESTINATION include/libfranka USE_SOURCE_PERMISSIONS ) @@ -172,12 +172,15 @@ install(EXPORT FrankaTargets DESTINATION ${INSTALL_CMAKE_CONFIG_DIR} ) +# Install catkin package.xml +install(FILES package.xml DESTINATION share/libfranka) + ## Subprojects # Ignore find_package(Franka) in subprojects. set(FRANKA_IS_FOUND TRUE) -option(BUILD_TESTS "Build tests" ON) +option(BUILD_TESTS "Build tests" OFF) if(BUILD_TESTS) enable_testing() add_subdirectory(test) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 562b605..80817d3 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0.2) -add_library(libfranka-common INTERFACE) +# add_library(libfranka-common INTERFACE) # https://stackoverflow.com/questions/34443128/cmake-install-targets-in-subdirectories target_include_directories(libfranka-common INTERFACE $ $ diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 60e5428..6dc4d48 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -63,8 +63,7 @@ target_link_libraries(joint_impedance_control Threads::Threads pinocchio::pinocc target_link_libraries(motion_with_control Poco::Foundation) target_link_libraries(motion_with_control_external_control_loop Poco::Foundation) -include(GNUInstallDirs) install(TARGETS ${EXAMPLES} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION lib + RUNTIME DESTINATION lib/libfranka ) diff --git a/package.xml b/package.xml index 8d85070..02c9675 100644 --- a/package.xml +++ b/package.xml @@ -18,8 +18,10 @@ eigen libpoco-dev + pinocchio libpoco-dev + pinocchio doxygen graphviz