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

Fix configuration and compilation against assimp 5 #661

Merged
merged 6 commits into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@ jobs:
unzip vcpkg-robotology.zip -d C:/robotology/vcpkg
# Overwrite the VCPKG_INSTALLATION_ROOT env variable defined by GitHub Actions to point to our vcpkg
echo "::set-env name=VCPKG_INSTALLATION_ROOT::C:/robotology/vcpkg"


- name: Additional vcpkg Dependencies [Windows]
if: matrix.os == 'windows-latest'
shell: bash
run: |
# Install dependencies that are not included in the robotology-superbuild-dependencies-vcpkg archive (for now)
${VCPKG_INSTALLATION_ROOT}/vcpkg.exe install assimp:x64-windows

- name: Dependencies [macOS]
if: matrix.os == 'macOS-latest'
run: |
Expand Down Expand Up @@ -146,9 +152,8 @@ jobs:
mkdir -p build
cd build
# ipopt disabled until https://github.com/robotology/idyntree/issues/274 is fixed
# assimp disabled until https://github.com/robotology/idyntree/issues/601 is fixed
cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \
-DIDYNTREE_COMPILE_TESTS:BOOL=ON -DIDYNTREE_USES_YARP:BOOL=OFF -DIDYNTREE_USES_ICUB_MAIN:BOOL=OFF -DIDYNTREE_RUN_VALGRIND_TESTS:BOOL=ON \
-DIDYNTREE_COMPILE_TESTS:BOOL=ON -DIDYNTREE_USES_ASSIMP:BOOL=ON -DIDYNTREE_USES_YARP:BOOL=OFF -DIDYNTREE_USES_ICUB_MAIN:BOOL=OFF -DIDYNTREE_RUN_VALGRIND_TESTS:BOOL=ON \
-DIDYNTREE_USES_PYTHON:BOOL=OFF -DIDYNTREE_USES_OCTAVE:BOOL=OFF -DIDYNTREE_USES_IPOPT:BOOL=OFF -DIDYNTREE_USES_ASSIMP:BOOL=OFF \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..

Expand All @@ -158,7 +163,7 @@ jobs:
run: |
mkdir -p build
cd build
# IDYNTREE_USES_ASSIMP set to OFF as a workaround for https://github.com/robotology/idyntree/issues/599
# Assimp is disabled as workaround for https://github.com/robotology/idyntree/issues/599
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps -DIDYNTREE_COMPILE_TESTS:BOOL=ON -DIDYNTREE_USES_YARP:BOOL=ON \
-DIDYNTREE_USES_ICUB_MAIN:BOOL=ON -DIDYNTREE_USES_Qt5:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DIDYNTREE_USES_ASSIMP:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
Expand All @@ -167,7 +172,8 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
cd build
cmake -DIDYNTREE_USES_OCTAVE:BOOL=ON -DIDYNTREE_USES_PYTHON:BOOL=ON -DIDYNTREE_RUN_VALGRIND_TESTS:BOOL=ON -DIDYNTREE_USES_KDL:BOOL=ON .
# Assimp is disabled on Ubuntu as a workaround for https://github.com/robotology/idyntree/issues/663
cmake -DIDYNTREE_USES_OCTAVE:BOOL=ON -DIDYNTREE_USES_PYTHON:BOOL=ON -DIDYNTREE_RUN_VALGRIND_TESTS:BOOL=ON -DIDYNTREE_USES_KDL:BOOL=ON -DIDYNTREE_USES_ASSIMP:BOOL=OFF .
# For some reason, Ubuntu 18.04 image in GitHub Actions contain OpenBLAS 0.3.5, that is affected by https://github.com/xianyi/OpenBLAS/issues/2003
# As a workaround, we test against the regular blas instead of openblas
sudo apt-get install libblas-dev libatlas-base-dev
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.3] - 2020-04-01

### Fixed
- Fixed configuration and compilation with Assimp >= 5.0.0 .

## [1.0.2] - 2020-02-21

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion cmake/iDynTreeDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ if(IDYNTREE_USES_ALGLIB AND ALGLIB_FOUND)
endif()
idyntree_handle_dependency(WORHP DO_NOT_SILENTLY_SEARCH)
# Workaround for https://github.com/robotology/idyntree/issues/599
idyntree_handle_dependency(ASSIMP DO_NOT_SILENTLY_SEARCH MAIN_TARGET assimp::assimp)
idyntree_handle_dependency(assimp DO_NOT_SILENTLY_SEARCH MAIN_TARGET assimp::assimp)
13 changes: 10 additions & 3 deletions src/solid-shapes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ target_include_directories(${libraryname} PRIVATE ${EIGEN3_INCLUDE_DIR})

if (IDYNTREE_USES_ASSIMP)
target_compile_definitions(${libraryname} PRIVATE IDYNTREE_USES_ASSIMP)
target_include_directories(${libraryname} PRIVATE "${ASSIMP_INCLUDE_DIRS}")
link_directories("${ASSIMP_LIBRARY_DIRS}")
target_link_libraries(${libraryname} PRIVATE "${ASSIMP_LIBRARIES}")
# Depending on the assimp version, the way of consuming assimp changes
# In assimp 5.0, only the imported assimp::assimp target is defined, in earlier
# versions (that do no export the version to CMake) the ASSIMP_* variables are defined
if(assimp_VERSION AND assimp_VERSION VERSION_GREATER_EQUAL 5.0)
target_link_libraries(${libraryname} PRIVATE "${ASSIMP_LIBRARIES}")
else()
target_include_directories(${libraryname} PRIVATE "${ASSIMP_INCLUDE_DIRS}")
link_directories("${ASSIMP_LIBRARY_DIRS}")
target_link_libraries(${libraryname} PRIVATE "${ASSIMP_LIBRARIES}")
endif()
endif()

set_property(TARGET ${libraryname} PROPERTY PUBLIC_HEADER ${IDYNTREE_SOLID_SHAPES_HEADERS})
Expand Down