diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f9987880f9..93f2e55dd34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated - The `iDynTree::Visualizer::enviroment()` was deprecated. Please use the `iDynTree::Visualizer::environment()` method instead (https://github.com/robotology/idyntree/pull/903). +- The `iDynTree::idyntree-modelio-urdf` CMake imported target used when using classes such as `iDynTree::ModelLoader` and `iDynTree::ModelExporter` was deprecated. Please use the `iDynTree::idyntree-modelio` imported target instead. ### Fixed - Fixed the conversion from irrlicht pixels to iDynTree pixels. Fixed a typo in the environment method of the visualizer. Fixed the running of two visualizer instances in the same process (https://github.com/robotology/idyntree/pull/903). diff --git a/bindings/pybind11/CMakeLists.txt b/bindings/pybind11/CMakeLists.txt index 21efe98cc85..898021d2364 100644 --- a/bindings/pybind11/CMakeLists.txt +++ b/bindings/pybind11/CMakeLists.txt @@ -9,7 +9,7 @@ pybind11_add_module(pybind11_idyntree SYSTEM idyntree.cpp target_link_libraries(pybind11_idyntree PUBLIC idyntree-core idyntree-model idyntree-sensors - idyntree-modelio-urdf) + idyntree-modelio) # The generated Python dynamic module must have the same name as the pybind11 # module, i.e. `bindings`. diff --git a/src/estimation/CMakeLists.txt b/src/estimation/CMakeLists.txt index fb79f91c05a..e079c551bab 100644 --- a/src/estimation/CMakeLists.txt +++ b/src/estimation/CMakeLists.txt @@ -50,7 +50,7 @@ add_library(iDynTree::${libraryname} ALIAS ${libraryname}) target_include_directories(${libraryname} PUBLIC "$" "$") -target_link_libraries(${libraryname} PUBLIC idyntree-core idyntree-model idyntree-sensors idyntree-modelio-urdf +target_link_libraries(${libraryname} PUBLIC idyntree-core idyntree-model idyntree-sensors idyntree-modelio PRIVATE Eigen3::Eigen) target_compile_options(${libraryname} PRIVATE ${IDYNTREE_WARNING_FLAGS}) @@ -68,6 +68,17 @@ install(TARGETS ${libraryname} set_property(GLOBAL APPEND PROPERTY ${VARS_PREFIX}_TARGETS ${libraryname}) +# Create deprecated target idyntree-modelio-urdf +add_library(idyntree-modelio-urdf INTERFACE) +add_library(iDynTree::idyntree-modelio-urdf ALIAS idyntree-modelio-urdf) +target_link_libraries(idyntree-modelio-urdf INTERFACE idyntree-modelio) +install(TARGETS idyntree-modelio-urdf + EXPORT iDynTree) +if(CMAKE_VERSION VERSION_GREATER 3.17) + set_target_properties(idyntree-modelio-urdf + PROPERTIES DEPRECATION "Do not use deprecated target iDynTree::idyntree-modelio-urdf, use iDynTree::idyntree-modelio instead.") +endif() + if(IDYNTREE_COMPILE_TESTS) add_subdirectory(tests) endif(IDYNTREE_COMPILE_TESTS) diff --git a/src/high-level/CMakeLists.txt b/src/high-level/CMakeLists.txt index 099d022fc79..9a23d93b60d 100644 --- a/src/high-level/CMakeLists.txt +++ b/src/high-level/CMakeLists.txt @@ -21,7 +21,7 @@ add_library(iDynTree::${libraryname} ALIAS ${libraryname}) target_include_directories(${libraryname} PUBLIC "$" "$") -target_link_libraries(${libraryname} PUBLIC idyntree-core idyntree-model idyntree-sensors idyntree-modelio-urdf +target_link_libraries(${libraryname} PUBLIC idyntree-core idyntree-model idyntree-sensors idyntree-modelio PRIVATE Eigen3::Eigen) set_property(TARGET ${libraryname} PROPERTY PUBLIC_HEADER ${IDYNTREE_HIGH_LEVEL_HEADERS}) diff --git a/src/high-level/tests/CMakeLists.txt b/src/high-level/tests/CMakeLists.txt index d4c39795bfb..d601ade8b95 100644 --- a/src/high-level/tests/CMakeLists.txt +++ b/src/high-level/tests/CMakeLists.txt @@ -3,7 +3,7 @@ macro(add_unit_test_hl classname) set(testbinary ${classname}UnitTest) set(testname UnitTest${classname}) add_executable(${testbinary} ${testsrc}) - target_link_libraries(${testbinary} PRIVATE idyntree-core idyntree-model idyntree-high-level idyntree-modelio-urdf + target_link_libraries(${testbinary} PRIVATE idyntree-core idyntree-model idyntree-high-level idyntree-modelio idyntree-testmodels Eigen3::Eigen) add_test(NAME ${testname} COMMAND ${testbinary}) diff --git a/src/model_io/CMakeLists.txt b/src/model_io/CMakeLists.txt index 8dc9b9645e2..0dae1e1bac4 100644 --- a/src/model_io/CMakeLists.txt +++ b/src/model_io/CMakeLists.txt @@ -10,4 +10,4 @@ set(IDYNTREE_MODELIO_TESTFILES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests/format_examples) add_subdirectory(xml) -add_subdirectory(urdf) +add_subdirectory(codecs) diff --git a/src/model_io/urdf/CMakeLists.txt b/src/model_io/codecs/CMakeLists.txt similarity index 80% rename from src/model_io/urdf/CMakeLists.txt rename to src/model_io/codecs/CMakeLists.txt index 33a92c2370a..86e8ec79a76 100644 --- a/src/model_io/urdf/CMakeLists.txt +++ b/src/model_io/codecs/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2015 Fondazione Istituto Italiano di Tecnologia +# Copyright (C) 2021 Fondazione Istituto Italiano di Tecnologia # # Licensed under either the GNU Lesser General Public License v3.0 : # https://www.gnu.org/licenses/lgpl-3.0.html @@ -6,14 +6,12 @@ # https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html # at your option. -project(iDynTree_ModelIO_URDF CXX) - -set(IDYNTREE_MODELIO_URDF_HEADERS include/iDynTree/ModelIO/URDFDofsImport.h +set(IDYNTREE_MODELIO_HEADERS include/iDynTree/ModelIO/URDFDofsImport.h include/iDynTree/ModelIO/ModelLoader.h include/iDynTree/ModelIO/ModelExporter.h include/iDynTree/ModelIO/ModelCalibrationHelper.h) -set(IDYNTREE_MODELIO_URDF_PRIVATE_HEADERS include/private/URDFDocument.h +set(IDYNTREE_MODELIO_PRIVATE_HEADERS include/private/URDFDocument.h include/private/InertialElement.h include/private/JointElement.h include/private/LinkElement.h @@ -39,23 +37,17 @@ set(IDYNTREE_MODELIO_URDF_XMLELEMENTS_SOURCES src/URDFDocument.cpp src/VisualElement.cpp src/GeometryElement.cpp) -set(IDYNTREE_MODELIO_URDF_SOURCES src/URDFDofsImport.cpp +set(IDYNTREE_MODELIO_SOURCES src/URDFDofsImport.cpp src/ModelLoader.cpp src/ModelExporter.cpp src/ModelCalibrationHelper.cpp src/URDFModelExport.cpp) -SOURCE_GROUP("Source Files" FILES ${IDYNTREE_MODELIO_URDF_SOURCES}) -SOURCE_GROUP("Source Files\\XML Elements" FILES ${IDYNTREE_MODELIO_URDF_XMLELEMENTS_SOURCES}) -SOURCE_GROUP("Header Files" FILES ${IDYNTREE_MODELIO_URDF_HEADERS}) -SOURCE_GROUP("Private Header Files" FILES ${IDYNTREE_MODELIO_URDF_PRIVATE_HEADERS}) - -list(APPEND IDYNTREE_MODELIO_URDF_SOURCES ${IDYNTREE_MODELIO_URDF_XMLELEMENTS_SOURCES}) +list(APPEND IDYNTREE_MODELIO_SOURCES ${IDYNTREE_MODELIO_URDF_XMLELEMENTS_SOURCES}) -# share headers with all iDynTree targets -set(libraryname idyntree-modelio-urdf) +set(libraryname idyntree-modelio) -add_library(${libraryname} ${IDYNTREE_MODELIO_URDF_SOURCES} ${IDYNTREE_MODELIO_URDF_HEADERS} ${IDYNTREE_MODELIO_URDF_PRIVATE_HEADERS} $) +add_library(${libraryname} ${IDYNTREE_MODELIO_SOURCES} ${IDYNTREE_MODELIO_HEADERS} ${IDYNTREE_MODELIO_PRIVATE_HEADERS} $) add_library(iDynTree::${libraryname} ALIAS ${libraryname}) target_compile_features(${libraryname} PRIVATE cxx_auto_type cxx_delegating_constructors cxx_final cxx_lambdas cxx_lambda_init_captures) @@ -72,7 +64,7 @@ target_include_directories(${libraryname} PRIVATE $