diff --git a/CHANGELOG.md b/CHANGELOG.md index f39d6015c7f..723cb91b9ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Remove spurious inclusion of Eigen headers in ExtendedKalmanFilter.h public header, that could create probles when using that header in a downstream project that does not use Eigen (https://github.com/robotology/idyntree/pull/639). +- Added find_dependency(OsqpEigen) and find_dependency(LibXml2) when iDynTree is compiled as a static library, fixing the use of iDynTree on Windows (https://github.com/robotology/idyntree/pull/642). + +### Changed +- To reduce the possible unexpected problems, the automatic set of the `IDYNTREE_USES_` CMake variable when the `` CMake package is available in the system has been removed for Irrlicht and WORHP, as it was already disabled for ASSIMP and ALGLIB (https://github.com/robotology/idyntree/pull/642). To use this dependencies it is now compulsory to set manually the `IDYNTREE_USES_` variable to `ON`. ## [1.0.1] - 2020-01-14 diff --git a/CMakeLists.txt b/CMakeLists.txt index f2495d51e57..9319f287e3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ if(NOT IDYNTREE_ONLY_DOCS) # add the actual components of the library add_subdirectory(src) - # List exported dependencies + # List exported CMake package dependencies set(_IDYNTREE_EXPORTED_DEPENDENCIES "") if(IDYNTREE_USES_YARP) list(APPEND _IDYNTREE_EXPORTED_DEPENDENCIES YARP) @@ -68,6 +68,13 @@ if(NOT IDYNTREE_ONLY_DOCS) list(APPEND _IDYNTREE_EXPORTED_DEPENDENCIES orocos_kdl) endif() + # List exported CMake package dependencies when the library is compiled as static + set(_IDYNTREE_EXPORTED_DEPENDENCIES_ONLY_STATIC "") + list(APPEND _IDYNTREE_EXPORTED_DEPENDENCIES_ONLY_STATIC LibXml2) + if(IDYNTREE_USES_OSQPEIGEN) + list(APPEND _IDYNTREE_EXPORTED_DEPENDENCIES_ONLY_STATIC OsqpEigen) + endif() + include(InstallBasicPackageFiles) install_basic_package_files(iDynTree VARS_PREFIX ${VARS_PREFIX} VERSION ${${VARS_PREFIX}_VERSION} @@ -75,7 +82,8 @@ if(NOT IDYNTREE_ONLY_DOCS) TARGETS_PROPERTY ${VARS_PREFIX}_TARGETS NO_CHECK_REQUIRED_COMPONENTS_MACRO ENABLE_COMPATIBILITY_VARS - DEPENDENCIES ${_IDYNTREE_EXPORTED_DEPENDENCIES}) + DEPENDENCIES ${_IDYNTREE_EXPORTED_DEPENDENCIES} + PRIVATE_DEPENDENCIES ${_IDYNTREE_EXPORTED_DEPENDENCIES_ONLY_STATIC}) include(AddUninstallTarget) diff --git a/cmake/iDynTreeDependencies.cmake b/cmake/iDynTreeDependencies.cmake index 23b12991a82..faff4d11bb0 100644 --- a/cmake/iDynTreeDependencies.cmake +++ b/cmake/iDynTreeDependencies.cmake @@ -86,7 +86,7 @@ if (IDYNTREE_USES_ICUB) endif () idyntree_handle_dependency(IPOPT) -idyntree_handle_dependency(Irrlicht) +idyntree_handle_dependency(Irrlicht DO_NOT_SILENTLY_SEARCH) idyntree_handle_dependency(Qt5 COMPONENTS Qml Quick Widgets) idyntree_handle_dependency(OsqpEigen MAIN_TARGET OsqpEigen::OsqpEigen) idyntree_handle_dependency(ALGLIB DO_NOT_SILENTLY_SEARCH) @@ -96,6 +96,6 @@ if(IDYNTREE_USES_ALGLIB AND ALGLIB_FOUND) message(FATAL_ERROR "Exactly ALGLIB version ${ALGLIB_REQUIRED_VERSION} is required, but ${ALGLIB_VERSION} is available.") endif() endif() -idyntree_handle_dependency(WORHP) +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)