From 03da540dcd9faeb5d65c239207f45a68b293e9e5 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 23 Mar 2021 18:40:25 +0100 Subject: [PATCH 1/5] Fixed the installation folder of CppAD. --- src/AutoDiff/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AutoDiff/CMakeLists.txt b/src/AutoDiff/CMakeLists.txt index d03add6497..5e4b063b22 100644 --- a/src/AutoDiff/CMakeLists.txt +++ b/src/AutoDiff/CMakeLists.txt @@ -9,6 +9,7 @@ if(FRAMEWORK_COMPILE_AutoDiffCppAD) PUBLIC_HEADERS include/BipedalLocomotion/AutoDiff/CppAD.h PUBLIC_LINK_LIBRARIES Eigen3::Eigen cppad IS_INTERFACE - SUBDIRECTORIES tests) + SUBDIRECTORIES tests + INSTALLATION_FOLDER AutoDiff) endif() From ff2b3c3cbf320cd15687e060253643bf72ccfa7e Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 23 Mar 2021 18:40:48 +0100 Subject: [PATCH 2/5] Added check between the installation and build path of public headers. --- cmake/AddBipedalLocomotionLibrary.cmake | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/cmake/AddBipedalLocomotionLibrary.cmake b/cmake/AddBipedalLocomotionLibrary.cmake index a1cc6c1f13..19c03d2e06 100644 --- a/cmake/AddBipedalLocomotionLibrary.cmake +++ b/cmake/AddBipedalLocomotionLibrary.cmake @@ -4,7 +4,7 @@ function(add_bipedal_locomotion_library) - set(options IS_INTERFACE) + set(options IS_INTERFACE SKIP_INSTALL_CHECK) set(oneValueArgs NAME INSTALLATION_FOLDER) set(multiValueArgs SOURCES @@ -25,6 +25,7 @@ function(add_bipedal_locomotion_library) set(name ${${prefix}_NAME}) set(installation_folder ${${prefix}_INSTALLATION_FOLDER}) set(is_interface ${${prefix}_IS_INTERFACE}) + set(skip_install_check ${${prefix}_SKIP_INSTALL_CHECK}) set(sources ${${prefix}_SOURCES}) set(public_headers ${${prefix}_PUBLIC_HEADERS}) set(private_headers ${${prefix}_PRIVATE_HEADERS}) @@ -108,6 +109,21 @@ function(add_bipedal_locomotion_library) endforeach() set_property(GLOBAL PROPERTY umbrella_includes "${umbrella_includes_list}") + if (NOT ${skip_install_check}) + foreach(header ${public_headers}) + get_filename_component(extension ${header} LAST_EXT) + if ((extension STREQUAL ".h") OR (extension STREQUAL ".hpp")) + get_filename_component(header_name ${header} NAME) + get_filename_component(header_path ${header} DIRECTORY) + string(REPLACE "include/BipedalLocomotion/" "" header_path_cleaned ${header_path}) + if (NOT(${header_path_cleaned} STREQUAL ${installation_folder})) + string(REPLACE "include/" "" header_no_include ${header}) + message(FATAL_ERROR "The file ${header_no_include} will have a different path when installed (it will become BipedalLocomotion/${installation_folder}/${header_name}), possibly causing issues in the client libraries.") + endif() + endif() + endforeach() + endif() + # add alias add_library(BipedalLocomotion::${name} ALIAS ${name}) From 8999458bc5cd079983be0a250ae94f7234fdcddf Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 23 Mar 2021 18:41:16 +0100 Subject: [PATCH 3/5] Added spdlog in the exported dependencies. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec22789801..2439595b33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,7 +92,7 @@ add_subdirectory(devices) #By including the file "BipedalLocomotion/Framework.h" it is possible to include all the headers automatically. include(AddBipedalLocomotionFrameworkTarget) -set(FRAMEWORK_PUBLIC_DEPENDENCIES "iDynTree 1.1.0" "Eigen3 3.2.92") +set(FRAMEWORK_PUBLIC_DEPENDENCIES "iDynTree 1.1.0" "Eigen3 3.2.92" spdlog) if (FRAMEWORK_USE_YARP) list(APPEND FRAMEWORK_PUBLIC_DEPENDENCIES YARP) From 611d23f3c29849ce1f6f2f115809cd754452d6e8 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 23 Mar 2021 18:46:07 +0100 Subject: [PATCH 4/5] Updated CHANGELOG. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1e9f5f330..a02f71e40b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project are documented in this file. - Implement `realsense-test` utility application. (https://github.com/dic-iit/bipedal-locomotion-framework/pull/165) - Implement the inverse kinematics component (https://github.com/dic-iit/bipedal-locomotion-framework/pull/229) - Implement LinearizedFrictionCone class (https://github.com/dic-iit/bipedal-locomotion-framework/pull/244) +- Added a check on whether the installed public headers have the correct folder structure (https://github.com/dic-iit/bipedal-locomotion-framework/pull/247) ### Changed - Move all the Contacts related classes in Contacts component (https://github.com/dic-iit/bipedal-locomotion-framework/pull/204) From 8aef41efb03698403ff7066204cb74ff113fbeec Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 23 Mar 2021 18:54:54 +0100 Subject: [PATCH 5/5] Checking alll the public headers files, not just .h and .hpp. --- cmake/AddBipedalLocomotionLibrary.cmake | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/cmake/AddBipedalLocomotionLibrary.cmake b/cmake/AddBipedalLocomotionLibrary.cmake index 19c03d2e06..3284f2630b 100644 --- a/cmake/AddBipedalLocomotionLibrary.cmake +++ b/cmake/AddBipedalLocomotionLibrary.cmake @@ -111,15 +111,12 @@ function(add_bipedal_locomotion_library) if (NOT ${skip_install_check}) foreach(header ${public_headers}) - get_filename_component(extension ${header} LAST_EXT) - if ((extension STREQUAL ".h") OR (extension STREQUAL ".hpp")) - get_filename_component(header_name ${header} NAME) - get_filename_component(header_path ${header} DIRECTORY) - string(REPLACE "include/BipedalLocomotion/" "" header_path_cleaned ${header_path}) - if (NOT(${header_path_cleaned} STREQUAL ${installation_folder})) - string(REPLACE "include/" "" header_no_include ${header}) - message(FATAL_ERROR "The file ${header_no_include} will have a different path when installed (it will become BipedalLocomotion/${installation_folder}/${header_name}), possibly causing issues in the client libraries.") - endif() + get_filename_component(header_name ${header} NAME) + get_filename_component(header_path ${header} DIRECTORY) + string(REPLACE "include/BipedalLocomotion/" "" header_path_cleaned ${header_path}) + if (NOT(${header_path_cleaned} STREQUAL ${installation_folder})) + string(REPLACE "include/" "" header_no_include ${header}) + message(FATAL_ERROR "The file ${header_no_include} will have a different path when installed (it will become BipedalLocomotion/${installation_folder}/${header_name}), possibly causing issues in the client libraries.") endif() endforeach() endif()