Skip to content

Commit

Permalink
remove thrift/ in include and fix compilation with YARP 3.2.101
Browse files Browse the repository at this point in the history
  • Loading branch information
lrapetti committed Nov 22, 2019
1 parent 6962fb9 commit aa991c5
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 84 deletions.
4 changes: 2 additions & 2 deletions devices/IWearRemapper/src/IWearRemapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "IWearRemapper.h"
#include "Wearable/IWear/IWear.h"
#include "Wearable/IWear/Sensors/impl/SensorsImpl.h"
#include "thrift/WearableData.h"
#include "thrift/WearableMetadataService.h"
#include "WearableData.h"
#include "WearableMetadataService.h"

#include <yarp/dev/PreciselyTimed.h>
#include <yarp/os/BufferedPort.h>
Expand Down
81 changes: 2 additions & 79 deletions msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,82 +1,5 @@
# Copyright (C) 2018 Istituto Italiano di Tecnologia (IIT). All rights reserved.
# Copyright (C) 2019 Istituto Italiano di Tecnologia (IIT). All rights reserved.
# This software may be modified and distributed under the terms of the
# GNU Lesser General Public License v2.1 or any later version.

# TODO: these libraries are enforced to be static. In order to let the devices
# find them on Windows from the build directory, their Release / Debug
# folder should be added to the PATH. However, this does not work as expected.

# ============
# WearableData
# ============

yarp_add_idl(WEARABLEDATA_FILES thrift/WearableData.thrift)

add_library(WearableData ${WEARABLEDATA_FILES} thrift/WearableData.thrift)
add_library(Wearable::WearableData ALIAS WearableData)
target_link_libraries(WearableData YARP::YARP_OS)

# Extract the include directory from the files names
foreach(file ${WEARABLEDATA_FILES})
STRING(REGEX MATCH ".+\\.h?h$" file ${file})
if(file)
get_filename_component(include_dir ${file} DIRECTORY)
list(APPEND WEARABLEDATA_INCLUDE_DIRS ${include_dir})
list(REMOVE_DUPLICATES WEARABLEDATA_INCLUDE_DIRS)
endif()
endforeach()

foreach(dir ${WEARABLEDATA_INCLUDE_DIRS})
get_filename_component(parent_dir_name ${dir} NAME)
if(${parent_dir_name} STREQUAL thrift)
list(REMOVE_ITEM WEARABLEDATA_INCLUDE_DIRS ${dir})
get_filename_component(parent_dir_path ${dir} DIRECTORY)
list(APPEND WEARABLEDATA_INCLUDE_DIRS ${parent_dir_path})
endif()
endforeach()

# Setup the include directories
target_include_directories(WearableData PUBLIC
$<BUILD_INTERFACE:${WEARABLEDATA_INCLUDE_DIRS}>)

install(TARGETS WearableData
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

# =======================
# XsensSuitControlService
# =======================

yarp_add_idl(XSENSSUITCONTROL thrift/XsensSuitControlService.thrift)

add_library(XsensSuitControl ${XSENSSUITCONTROL} thrift/XsensSuitControlService.thrift)
target_link_libraries(XsensSuitControl YARP::YARP_OS)

# Extract the include directory from the files names
foreach(file ${XSENSSUITCONTROL})
STRING(REGEX MATCH ".+\\.h?h$" file ${file})
if(file)
get_filename_component(include_dir ${file} DIRECTORY)
list(APPEND XSENSSUITCONTROL_INCLUDE_DIRS ${include_dir})
list(REMOVE_DUPLICATES XSENSSUITCONTROL_INCLUDE_DIRS)
endif()
endforeach()

foreach(dir ${XSENSSUITCONTROL_INCLUDE_DIRS})
get_filename_component(parent_dir_name ${dir} NAME)
if(${parent_dir_name} STREQUAL thrift)
list(REMOVE_ITEM XSENSSUITCONTROL_INCLUDE_DIRS ${dir})
get_filename_component(parent_dir_path ${dir} DIRECTORY)
list(APPEND XSENSSUITCONTROL_INCLUDE_DIRS ${parent_dir_path})
endif()
endforeach()

# Setup the include directories
target_include_directories(XsensSuitControl PUBLIC
$<BUILD_INTERFACE:${XSENSSUITCONTROL_INCLUDE_DIRS}>)

install(TARGETS XsensSuitControl
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
add_subdirectory(thrift)
84 changes: 84 additions & 0 deletions msgs/thrift/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Copyright (C) 2018 Istituto Italiano di Tecnologia (IIT). All rights reserved.
# This software may be modified and distributed under the terms of the
# GNU Lesser General Public License v2.1 or any later version.

# TODO: these libraries are enforced to be static. In order to let the devices
# find them on Windows from the build directory, their Release / Debug
# folder should be added to the PATH. However, this does not work as expected.

# ============
# WearableData
# ============

yarp_add_idl(WEARABLEDATA_FILES WearableData.thrift)

add_library(WearableData ${WEARABLEDATA_FILES} WearableData.thrift)
add_library(Wearable::WearableData ALIAS WearableData)
target_link_libraries(WearableData YARP::YARP_OS)

# Extract the include directory from the files names
foreach(file ${WEARABLEDATA_FILES})
STRING(REGEX MATCH ".+\\.h?h$" file ${file})
if(file)
get_filename_component(include_dir ${file} DIRECTORY)
list(APPEND WEARABLEDATA_INCLUDE_DIRS ${include_dir})
list(REMOVE_DUPLICATES WEARABLEDATA_INCLUDE_DIRS)
endif()
endforeach()

foreach(dir ${WEARABLEDATA_INCLUDE_DIRS})
get_filename_component(parent_dir_name ${dir} NAME)
if(${parent_dir_name} STREQUAL thrift)
list(REMOVE_ITEM WEARABLEDATA_INCLUDE_DIRS ${dir})
get_filename_component(parent_dir_path ${dir} DIRECTORY)
list(APPEND WEARABLEDATA_INCLUDE_DIRS ${parent_dir_path})
endif()
endforeach()

# Setup the include directories
target_include_directories(WearableData PUBLIC
$<BUILD_INTERFACE:${WEARABLEDATA_INCLUDE_DIRS}>)
target_include_directories(WearableData PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)

install(TARGETS WearableData
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

# =======================
# XsensSuitControlService
# =======================

yarp_add_idl(XSENSSUITCONTROL XsensSuitControlService.thrift)

add_library(XsensSuitControl ${XSENSSUITCONTROL} XsensSuitControlService.thrift)
target_link_libraries(XsensSuitControl YARP::YARP_OS)

# Extract the include directory from the files names
foreach(file ${XSENSSUITCONTROL})
STRING(REGEX MATCH ".+\\.h?h$" file ${file})
if(file)
get_filename_component(include_dir ${file} DIRECTORY)
list(APPEND XSENSSUITCONTROL_INCLUDE_DIRS ${include_dir})
list(REMOVE_DUPLICATES XSENSSUITCONTROL_INCLUDE_DIRS)
endif()
endforeach()

foreach(dir ${XSENSSUITCONTROL_INCLUDE_DIRS})
get_filename_component(parent_dir_name ${dir} NAME)
if(${parent_dir_name} STREQUAL thrift)
list(REMOVE_ITEM XSENSSUITCONTROL_INCLUDE_DIRS ${dir})
get_filename_component(parent_dir_path ${dir} DIRECTORY)
list(APPEND XSENSSUITCONTROL_INCLUDE_DIRS ${parent_dir_path})
endif()
endforeach()

# Setup the include directories
target_include_directories(XsensSuitControl PUBLIC
$<BUILD_INTERFACE:${XSENSSUITCONTROL_INCLUDE_DIRS}>)

install(TARGETS XsensSuitControl
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
4 changes: 2 additions & 2 deletions wrappers/IWear/src/IWearWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include "IWearWrapper.h"
#include "Wearable/IWear/IWear.h"
#include "thrift/WearableData.h"
#include "thrift/WearableMetadataService.h"
#include "WearableData.h"
#include "WearableMetadataService.h"

#include <yarp/dev/PreciselyTimed.h>
#include <yarp/os/BufferedPort.h>
Expand Down
2 changes: 1 addition & 1 deletion wrappers/IXsensMVNControl/src/IXsensMVNControlWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "IXsensMVNControlWrapper.h"
#include "IXsensMVNControl.h"

#include "thrift/XsensSuitControlService.h"
#include "XsensSuitControlService.h"

#include <yarp/os/BufferedPort.h>
#include <yarp/os/LogStream.h>
Expand Down

0 comments on commit aa991c5

Please sign in to comment.