Skip to content
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

Check on if the install and build paths coincide #247

Merged
merged 5 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 17 additions & 1 deletion cmake/AddBipedalLocomotionLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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})
Expand Down Expand Up @@ -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"))
prashanthr05 marked this conversation as resolved.
Show resolved Hide resolved
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})

Expand Down
3 changes: 2 additions & 1 deletion src/AutoDiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()