Skip to content

Commit

Permalink
yarprobotinterface pluginized
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Ruzzenenti committed Jun 27, 2018
1 parent e947568 commit 5053822
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ add_subdirectory(devices)
add_subdirectory(carriers)
add_subdirectory(libYARP_init)

option(CREATE_RFMODULE_LIBRARY_MODULES "compile rfmodule also as plugins" OFF)

if(YARP_COMPILE_EXECUTABLES)
# idl compilers (thrift and ros)
add_subdirectory(idls)

# executables

yarp_begin_plugin_library(yarprfmod)
add_subdirectory(yarpserver)
add_subdirectory(yarp)
add_subdirectory(yarp-config)
Expand All @@ -55,6 +59,21 @@ if(YARP_COMPILE_EXECUTABLES)
add_subdirectory(yarpmanager-console)
add_subdirectory(yarplogger-console)
add_subdirectory(yarpdatadumper)
yarp_end_plugin_library(yarprfmod)

add_library(YARP::yarprfmod ALIAS yarprfmod)
install(TARGETS yarprfmod
EXPORT YARP
COMPONENT runtime
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

if (YARP_LINK_PLUGINS)
set_property(GLOBAL APPEND PROPERTY YARP_LIBS yarprfmod ${yarprfmod_LIBRARIES})
endif()

set_property(TARGET yarprfmod PROPERTY FOLDER "Plugins/RFModules")

# Qt5 GUIs
add_subdirectory(yarpview)
Expand Down
29 changes: 29 additions & 0 deletions src/yarprobotinterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,42 @@ if(CREATE_YARPROBOTINTERFACE)
set(yarprobotinterface_IDLS
yarprobotinterface.thrift)


include(YarpIDL)
yarp_idl_to_dir(${yarprobotinterface_IDLS}
"${CMAKE_CURRENT_SOURCE_DIR}/idl_generated_code"
yarprobotinterface_IDLS_SRCS
yarprobotinterface_IDLS_HDRS
yarprobotinterface_IDLS_INCLUDE_DIRS)
include_directories("${yarprobotinterface_IDLS_INCLUDE_DIRS}")

yarp_prepare_plugin(yarprobotinterface
CATEGORY rfmodule
TYPE RobotInterface::Module
INCLUDE Module.h
EXTRA_CONFIG CODE=""
DEPENDS "CREATE_RFMODULE_LIBRARY_MODULES")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
yarp_add_plugin(robotinterface ${yarprobotinterface_SRCS}
${yarprobotinterface_HDRS}
${yarprobotinterface_IDLS_SRCS}
${yarprobotinterface_IDLS_HDRS})

target_link_libraries(robotinterface
YARP::YARP_OS
YARP::YARP_dev
YARP::YARP_init
${TinyXML_LIBRARIES})

yarp_install(TARGETS robotinterface
EXPORT YARP
COMPONENT runtime
LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR}
ARCHIVE DESTINATION ${YARP_STATIC_PLUGINS_INSTALL_DIR})
yarp_install(FILES yarprobotinterface.ini
COMPONENT runtime
DESTINATION ${YARP_PLUGIN_MANIFESTS_INSTALL_DIR})
set_property(TARGET robotinterface PROPERTY FOLDER "Plugins/RFModules")

add_executable(yarprobotinterface ${yarprobotinterface_SRCS}
${yarprobotinterface_HDRS}
Expand Down
4 changes: 4 additions & 0 deletions src/yarprobotinterface/RobotInterface.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[plugin yarprobotinterface]
type RFModule
name yarprobotinterface
library robotinterface
4 changes: 4 additions & 0 deletions src/yarprobotinterface/yarprobotinterface.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[plugin yarprobotinterface]
type RFModule
name yarprobotinterface
library robotinterface

0 comments on commit 5053822

Please sign in to comment.