Skip to content

Commit

Permalink
Fix CMake configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Dec 3, 2023
1 parent 21e41b1 commit c2436a7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ add_subdirectory(libraries)
add_subdirectory(doc)
#add_subdirectory(examples/cpp)

# Retrieve global properties.
get_property(_exported_targets GLOBAL PROPERTY _exported_targets)
get_property(_exported_dependencies GLOBAL PROPERTY _exported_dependencies)

if(NOT DEFINED _exported_targets)
set(_no_export NO_EXPORT)
endif()

if(DEFINED _exported_dependencies)
list(REMOVE_DUPLICATES _exported_dependencies)
endif()

# Store the package in the user registry.
set(CMAKE_EXPORT_PACKAGE_REGISTRY ON)

Expand All @@ -73,9 +85,11 @@ include(InstallBasicPackageFiles)
install_basic_package_files(AMOR_YARP_DEVICES
VERSION 0.1.0
COMPATIBILITY AnyNewerVersion
${_no_export}
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
NAMESPACE ROBOTICSLAB::)
NAMESPACE ROBOTICSLAB::
DEPENDENCIES "${_exported_dependencies}")

# Configure and create uninstall target.
include(AddUninstallTarget)
10 changes: 5 additions & 5 deletions libraries/YarpPlugins/AmorCartesianControl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
if(NOT DEFINED ENABLE_AmorCartesianControl OR ENABLE_AmorCartesianControl)
if(NOT TARGET AMOR::amor_api)
message(WARNING "amor_api target not found, disabling AmorCartesianControl")
elseif(NOT TARGET )
elseif(NOT TARGET ROBOTICSLAB::KinematicRepresentationLib)
message(WARNING "KinematicRepresentationLib target not found, disabling AmorCartesianControl")
elseif(NOT TARGET )
elseif(NOT TARGET ROBOTICSLAB::KinematicsDynamicsInterfaces)
message(WARNING "KinematicsDynamicsInterfaces target not found, disabling AmorCartesianControl")
endif()
endif()
Expand Down Expand Up @@ -32,9 +32,9 @@ if(NOT SKIP_AmorCartesianControl)
ROBOTICSLAB::KinematicsDynamicsInterfaces)

yarp_install(TARGETS AmorCartesianControl
LIBRARY DESTINATION ${AMOR-KINEMATICS-DYNAMICS_DYNAMIC_PLUGINS_INSTALL_DIR}
ARCHIVE DESTINATION ${AMOR-KINEMATICS-DYNAMICS_STATIC_PLUGINS_INSTALL_DIR}
YARP_INI DESTINATION ${AMOR-KINEMATICS-DYNAMICS_PLUGIN_MANIFESTS_INSTALL_DIR})
LIBRARY DESTINATION ${AMOR-YARP-DEVICES_DYNAMIC_PLUGINS_INSTALL_DIR}
ARCHIVE DESTINATION ${AMOR-YARP-DEVICES_STATIC_PLUGINS_INSTALL_DIR}
YARP_INI DESTINATION ${AMOR-YARP-DEVICES_PLUGIN_MANIFESTS_INSTALL_DIR})

else()

Expand Down

0 comments on commit c2436a7

Please sign in to comment.