Skip to content

Commit

Permalink
Update CMakeLists.txt in iCubDev to re-roder files and dirs tree and …
Browse files Browse the repository at this point in the history
…make compilation better
  • Loading branch information
MSECode committed Oct 10, 2024
1 parent 54a0125 commit 771458e
Show file tree
Hide file tree
Showing 22 changed files with 78 additions and 42 deletions.
14 changes: 7 additions & 7 deletions src/libraries/iCubDev/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ project(iCubDev)
# Add IDL files generation from thrift
set(idl_files include/iCub/rawValuesPublisher.thrift)
set(doc_files include/iCub/rawValuesPublisher.xml)
# yarp_add_idl(IDL_GEN_FILES ${idl_files})
yarp_idl_to_dir(INPUT_FILES ${idl_files} OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include/iCub PLACEMENT MERGED)

yarp_idl_to_dir(INPUT_FILES ${idl_files} OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/autogenerated PLACEMENT MERGED)

# Find .cpp and .h files automatically. This is a bit lazy,
# and in principle it would be better to list these files manually.
FILE(GLOB folder_source src/*.cpp)
FILE(GLOB folder_header include/iCub/*.h)
FILE(GLOB folder_idlgen include/iCub/*.cpp)
FILE(GLOB folder_idlgen autogenerated/iCub/*)

# Declare groups of source and header files -- makes things pretty in MSVC.
SOURCE_GROUP("Source Files" FILES ${folder_source})
Expand All @@ -24,12 +24,12 @@ SOURCE_GROUP("Header Files" FILES ${folder_header})
include_directories(${PROJECT_SOURCE_DIR}/include)

# Create everything needed to build our executable.
add_library(${PROJECT_NAME} ${folder_source} ${folder_header} ${folder_idlgen})#${IDL_GEN_FILES})
add_library(${PROJECT_NAME} ${folder_source} ${folder_header} ${folder_idlgen})
add_library(ICUB::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/iCub>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/autogenerated>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/iCub>")
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/autogenerated>")
target_link_libraries(${PROJECT_NAME} YARP::YARP_os
YARP::YARP_dev)
set_target_properties(${PROJECT_NAME} PROPERTIES
Expand All @@ -46,7 +46,7 @@ install(TARGETS ${PROJECT_NAME}
PUBLIC_HEADER
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/iCub")

install(FILES ${folder_idlgen} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/iCub")#${IDL_GEN_FILES}
install(FILES ${folder_idlgen} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/autogenerated/iCub")

icub_install_basic_package_files(${PROJECT_NAME}
DEPENDENCIES YARP_os
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
iCub/rawValuesDataVectorsMap.h
iCub/rawValuesDataVectorsMap.cpp
iCub/rawValuesKeyMetadata.h
iCub/rawValuesKeyMetadata.cpp
iCub/rawValuesKeyMetadataMap.h
iCub/rawValuesKeyMetadataMap.cpp
iCub/RawValuesPublisherMetadata.h
iCub/RawValuesPublisherMetadata.cpp
8 changes: 4 additions & 4 deletions src/libraries/iCubDev/include/iCub/IRawValuesPublisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#ifndef _ICUB_IRAWVALUESPUBLISHER_H_
#define _ICUB_IRAWVALUESPUBLISHER_H_

#include "rawValuesDataVectorsMap.h"
#include "rawValuesKeyMetadata.h"
#include "rawValuesKeyMetadataMap.h"
#include "RawValuesPublisherMetadata.h"
#include <iCub/rawValuesDataVectorsMap.h>
#include <iCub/rawValuesKeyMetadata.h>
#include <iCub/rawValuesKeyMetadataMap.h>
#include <iCub/RawValuesPublisherMetadata.h>

namespace iCub
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# rawValuePublisher.thrift

namespace yarp iCub
/**
* rawValuesDataVectorsMap
*
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/libraries/icubmod/embObjMotionControl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ yarp_prepare_plugin(embObjMotionControl

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

# yarp_add_plugin(embObjMotionControl embObjMotionControl.cpp embObjMotionControl.h usrcbk/eOcfg_nvsEP_mc_usrcbk_pippo.c )
yarp_add_plugin(embObjMotionControl embObjMotionControl.cpp embObjMotionControl.h eomcParser.cpp eomcParser.h measuresConverter.cpp measuresConverter.h eomcUtils.h)
TARGET_LINK_LIBRARIES(embObjMotionControl ethResources iCubDev)
icub_export_plugin(embObjMotionControl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ struct MCdiagnostics
};

using namespace yarp::dev;
using namespace iCub;


/**
Expand Down
10 changes: 5 additions & 5 deletions src/libraries/icubmod/fakeRawValuesPublisher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ yarp_prepare_plugin(fakeRawValuesPublisher

if(ENABLE_fakeRawValuesPublisher)
option(ALLOW_DEVICE_PARAM_PARSER_GENERATION "Generate the param parser for fakeRawValuesPublisher device" OFF)
yarp_add_plugin(yarp_fakeRawValuesPublisher)
yarp_add_plugin(fakeRawValuesPublisher)

target_sources(yarp_fakeRawValuesPublisher PRIVATE FakeRawValuesPublisher.cpp
target_sources(fakeRawValuesPublisher PRIVATE FakeRawValuesPublisher.cpp
FakeRawValuesPublisher.h
FakeRawValuesPublisher_ParamsParser.cpp
FakeRawValuesPublisher_ParamsParser.h
)

target_link_libraries(yarp_fakeRawValuesPublisher PRIVATE YARP::YARP_os
target_link_libraries(fakeRawValuesPublisher PRIVATE YARP::YARP_os
YARP::YARP_dev
ICUB::iCubDev)
list(APPEND YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS YARP_os
YARP_dev)

yarp_install(TARGETS yarp_fakeRawValuesPublisher
yarp_install(TARGETS fakeRawValuesPublisher
EXPORT YARP_${YARP_PLUGIN_MASTER}
COMPONENT ${YARP_PLUGIN_MASTER}
LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR}
Expand All @@ -36,5 +36,5 @@ if(ENABLE_fakeRawValuesPublisher)

set(YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS ${YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS} PARENT_SCOPE)

set_property(TARGET yarp_fakeRawValuesPublisher PROPERTY FOLDER "Plugins/Device")
set_property(TARGET fakeRawValuesPublisher PROPERTY FOLDER "Plugins/Device")
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
// ParamParser generated classes
#include "FakeRawValuesPublisher_ParamsParser.h"

using namespace iCub;
class FakeRawValuesPublisher :
public iCub::debugLibrary::IRawValuesPublisher,
public yarp::dev::DeviceDriver,
Expand Down
10 changes: 5 additions & 5 deletions src/libraries/icubmod/rawValuesPublisherClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ yarp_prepare_plugin(rawValuesPublisherClient

if(ENABLE_rawValuesPublisherClient)
option(ALLOW_DEVICE_PARAM_PARSER_GENERATION "Generate the param parser for rawValuesPublisherClient device" OFF)
yarp_add_plugin(yarp_rawValuesPublisherClient)
yarp_add_plugin(rawValuesPublisherClient)

target_sources(yarp_rawValuesPublisherClient PRIVATE RawValuesPublisherClient.cpp
target_sources(rawValuesPublisherClient PRIVATE RawValuesPublisherClient.cpp
RawValuesPublisherClient.h
RawValuesPublisherClient_ParamsParser.cpp
RawValuesPublisherClient_ParamsParser.h)

target_link_libraries(yarp_rawValuesPublisherClient PRIVATE YARP::YARP_os
target_link_libraries(rawValuesPublisherClient PRIVATE YARP::YARP_os
YARP::YARP_dev
ICUB::iCubDev
ethResources)
list(APPEND YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS YARP_os
YARP_dev)

yarp_install(TARGETS yarp_rawValuesPublisherClient
yarp_install(TARGETS rawValuesPublisherClient
EXPORT YARP_${YARP_PLUGIN_MASTER}
COMPONENT ${YARP_PLUGIN_MASTER}
LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR}
Expand All @@ -36,5 +36,5 @@ if(ENABLE_rawValuesPublisherClient)

set(YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS ${YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS} PARENT_SCOPE)

set_property(TARGET yarp_rawValuesPublisherClient PROPERTY FOLDER "Plugins/Device")
set_property(TARGET rawValuesPublisherClient PROPERTY FOLDER "Plugins/Device")
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// ParamParser generated classes
#include "RawValuesPublisherClient_ParamsParser.h"

using namespace iCub;
class RawValuesStreamingDataInputPort :
public yarp::os::BufferedPort<rawValuesDataVectorsMap>
{
Expand Down
10 changes: 5 additions & 5 deletions src/libraries/icubmod/rawValuesPublisherServer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ yarp_prepare_plugin(rawValuesPublisherServer

if(ENABLE_rawValuesPublisherServer)
option(ALLOW_DEVICE_PARAM_PARSER_GENERATION "Generate the param parser for rawValuesPublisherServer device" OFF)
yarp_add_plugin(yarp_rawValuesPublisherServer)
yarp_add_plugin(rawValuesPublisherServer)

target_sources(yarp_rawValuesPublisherServer PRIVATE RawValuesPublisherServer.cpp
target_sources(rawValuesPublisherServer PRIVATE RawValuesPublisherServer.cpp
RawValuesPublisherServer.h
RawValuesPublisherServer_ParamsParser.cpp
RawValuesPublisherServer_ParamsParser.h)

target_link_libraries(yarp_rawValuesPublisherServer PRIVATE YARP::YARP_os
target_link_libraries(rawValuesPublisherServer PRIVATE YARP::YARP_os
YARP::YARP_dev
ICUB::iCubDev)

list(APPEND YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS YARP_os
YARP_dev)

yarp_install(TARGETS yarp_rawValuesPublisherServer
yarp_install(TARGETS rawValuesPublisherServer
EXPORT YARP_${YARP_PLUGIN_MASTER}
COMPONENT ${YARP_PLUGIN_MASTER}
LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR}
Expand All @@ -39,5 +39,5 @@ if(ENABLE_rawValuesPublisherServer)

set(YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS ${YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS} PARENT_SCOPE)

set_property(TARGET yarp_rawValuesPublisherServer PROPERTY FOLDER "Plugins/Device")
set_property(TARGET rawValuesPublisherServer PROPERTY FOLDER "Plugins/Device")
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* See https://github.com/robotology/icub-main/tree/ab93283ba6d654396b92e081d960ace777a9e656/src/tools/depth2kin es example
*
* */
using namespace iCub;

class RawValuesPublisherServer :
public yarp::os::PeriodicThread,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ add_subdirectory(imageCropper)
add_subdirectory(embObjProtoTools/boardTransceiver)
add_subdirectory(wholeBodyPlayer)
add_subdirectory(motorTemperaturePublisher)

add_subdirectory(fakeRawDataPublisherTester)
add_subdirectory(canLoader)
add_subdirectory(ethLoader)
add_subdirectory(strainCalib)
Expand Down

0 comments on commit 771458e

Please sign in to comment.