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

Rename iDynTree::idyntree-modelio-urdf imported cmake target in iDynTree::idyntree-modelio target #930

Merged
merged 4 commits into from
Nov 1, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion bindings/pybind11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
13 changes: 12 additions & 1 deletion src/estimation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ add_library(iDynTree::${libraryname} ALIAS ${libraryname})
target_include_directories(${libraryname} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")

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})
Expand All @@ -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)
2 changes: 1 addition & 1 deletion src/high-level/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ add_library(iDynTree::${libraryname} ALIAS ${libraryname})
target_include_directories(${libraryname} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")

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})
Expand Down
2 changes: 1 addition & 1 deletion src/high-level/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
2 changes: 1 addition & 1 deletion src/model_io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# 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
# or the GNU Lesser General Public License v2.1 :
# 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
Expand All @@ -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} $<TARGET_OBJECTS:idyntree-private-fpconv>)
add_library(${libraryname} ${IDYNTREE_MODELIO_SOURCES} ${IDYNTREE_MODELIO_HEADERS} ${IDYNTREE_MODELIO_PRIVATE_HEADERS} $<TARGET_OBJECTS:idyntree-private-fpconv>)
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)
Expand All @@ -72,7 +64,7 @@ target_include_directories(${libraryname} PRIVATE $<TARGET_PROPERTY:idyntree-pri

target_compile_options(${libraryname} PRIVATE ${IDYNTREE_WARNING_FLAGS})

set_property(TARGET ${libraryname} PROPERTY PUBLIC_HEADER ${IDYNTREE_MODELIO_URDF_HEADERS})
set_property(TARGET ${libraryname} PROPERTY PUBLIC_HEADER ${IDYNTREE_MODELIO_HEADERS})

install(TARGETS ${libraryname}
EXPORT iDynTree
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ macro(add_modelio_urdf_unit_test classname)
set(testbinary ${classname}UnitTest)
set(testname UnitTest${classname})
add_executable(${testbinary} ${testsrc})
target_link_libraries(${testbinary} PRIVATE idyntree-modelio-urdf idyntree-testmodels Eigen3::Eigen)
target_link_libraries(${testbinary} PRIVATE idyntree-modelio idyntree-testmodels Eigen3::Eigen)
add_test(NAME ${testname} COMMAND ${testbinary})

if(IDYNTREE_RUN_VALGRIND_TESTS)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ macro(add_benchmark benchmarkName)
set(testsrc ${benchmarkName}Benchmark.cpp)
set(testbinary ${benchmarkName}Benchmark)
add_executable(${testbinary} ${testsrc})
target_link_libraries(${testbinary} PRIVATE idyntree-modelio-urdf idyntree-modelio-urdf-kdl idyntree-core
target_link_libraries(${testbinary} PRIVATE idyntree-modelio idyntree-modelio-kdl idyntree-core
idyntree-kdl idyntree-model idyntree-testmodels Eigen3::Eigen)
endmacro()

Expand Down
6 changes: 3 additions & 3 deletions src/tests/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ macro(add_integration_test testname)
set(testbinary ${testname}IntegrationTest)
set(testtarget IntegrationTest${testname})
add_executable(${testbinary} ${testsrc})
target_link_libraries(${testbinary} PRIVATE idyntree-core idyntree-model idyntree-modelio-urdf
target_link_libraries(${testbinary} PRIVATE idyntree-core idyntree-model idyntree-modelio
idyntree-high-level idyntree-sensors idyntree-estimation
idyntree-solid-shapes idyntree-testmodels Eigen3::Eigen)
# Setting explicitly the WORKING_DIRECTORY is necessary to make sure that meshes are correctly loaded,
Expand All @@ -28,7 +28,7 @@ macro(add_integration_test_no_valgrind testname)
set(testbinary ${testname}IntegrationTest)
set(testtarget IntegrationTest${testname})
add_executable(${testbinary} ${testsrc})
target_link_libraries(${testbinary} PRIVATE idyntree-core idyntree-model idyntree-modelio-urdf
target_link_libraries(${testbinary} PRIVATE idyntree-core idyntree-model idyntree-modelio
idyntree-high-level idyntree-sensors idyntree-estimation
idyntree-solid-shapes idyntree-testmodels Eigen3::Eigen)
add_test(NAME ${testtarget} COMMAND ${testbinary})
Expand All @@ -39,7 +39,7 @@ macro(add_integration_exe testname)
set(testbinary ${testname}IntegrationTest)
set(testtarget IntegrationTest${testname})
add_executable(${testbinary} ${testsrc})
target_link_libraries(${testbinary} PRIVATE idyntree-core idyntree-model idyntree-modelio-urdf
target_link_libraries(${testbinary} PRIVATE idyntree-core idyntree-model idyntree-modelio
idyntree-high-level idyntree-testmodels Eigen3::Eigen)
endmacro()

Expand Down
2 changes: 1 addition & 1 deletion src/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ macro(IDYNTREE_ADD_TOOL tool_name tool_code)
target_link_libraries(${tool_name} PRIVATE idyntree-core
idyntree-model
idyntree-high-level
idyntree-modelio-urdf
idyntree-modelio
idyntree-visualization
Eigen3::Eigen)
target_compile_options(${tool_name} PRIVATE ${IDYNTREE_WARNING_FLAGS})
Expand Down
2 changes: 1 addition & 1 deletion src/visualization/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ macro(add_unit_test classname)
set(testbinary ${classname}UnitTest)
set(testname UnitTest${classname})
add_executable(${testbinary} ${testsrc})
target_link_libraries(${testbinary} PRIVATE idyntree-sensors idyntree-modelio-urdf idyntree-visualization idyntree-testmodels Eigen3::Eigen)
target_link_libraries(${testbinary} PRIVATE idyntree-sensors idyntree-modelio idyntree-visualization idyntree-testmodels Eigen3::Eigen)
add_test(NAME ${testname} COMMAND ${testbinary})

if(IDYNTREE_RUN_VALGRIND_TESTS)
Expand Down