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

Update Buildrobometry.cmake after the addition of IRawValuesPublisher #1738

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

Nicogene
Copy link
Member

@Nicogene Nicogene commented Nov 11, 2024

In telemetryDeviceDumper it has been added the usage of IRawValuesPublisher by @MSECode, this made the device dependent also by ICUB 2.7.0 or higher.

I am unsure if the superbuild compiles the device right now, because if the dependencies are not found the compilation of the device is skipped.

See:

cc @traversaro @S-Dafarra @valegagge

In `telemetryDeviceDumper` it has been added the usage of `IRawValuesPublisher` by @MSECode, this made the device dependent also by ICUB 2.7.0 or higher.

cc @traversaro @S-Dafarra @valegagge
@Nicogene Nicogene self-assigned this Nov 11, 2024
@traversaro
Copy link
Member

traversaro commented Nov 11, 2024

I am unsure if the superbuild compiles the device right now, because if the dependencies are not found the compilation of the device is skipped.

Not a big problem, but is not ideal, as if for any reason the dependencies are not found the requested device is silently not compiled instead of raising an error.

What I typically do is to have an option that users can be enabled or disabled, and set its default value based on the output of the optional find_package calls, something like:

set(ROBOMETRY_COMPILE_TELEMETRYDEVICEDUMPER_DEFAULT_VALUE OFF)
if(NOT DEFINED ROBOMETRY_COMPILE_TELEMETRYDEVICEDUMPER)
    find_package(iCubDev 2.7.0 QUIET)
    set(ROBOMETRY_COMPILE_TELEMETRYDEVICEDUMPER_DEFAULT_VALUE ${iCubDev_FOUND})
endif()
option(ROBOMETRY_COMPILE_TELEMETRYDEVICEDUMPER "If ON, compile telemetryDeviceDumper YARP device (requires YARP and ICUB)" ${ROBOMETRY_COMPILE_TELEMETRYDEVICEDUMPER_DEFAULT_VALUE })
if(ROBOMETRY_COMPILE_TELEMETRYDEVICEDUMPER)
    find_package(iCubDev 2.7.0 REQUIRED)
    add_subdirectory(telemetryDeviceDumper)
endif()

in this way, in the superbuild we could set ROBOMETRY_COMPILE_TELEMETRYDEVICEDUMPER:BOOL=ON and get a clear error if iCubDev is not found, while if no option is set the behavior is exactly the same as before.

@traversaro
Copy link
Member

Having said that, the change seems to work, let's merge.

@traversaro traversaro merged commit b55f198 into master Nov 11, 2024
27 checks passed
@traversaro traversaro deleted the Nicogene-patch-1 branch November 11, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants