Skip to content

Add GENERATE_PARSER_OUTPUT_DIR argument to yarp_prepare_plugin function #3229

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

traversaro
Copy link
Member

@traversaro traversaro commented May 26, 2025

This parameter can be used to (optionally) generate the files related to device param parser in an arbitrary location. This is typically used to generate the files in the build directory instead of the source one, removing the need of committing generate files in the repo, avoiding problems such as the one discussed in icub-tech-iit/ergocub-software#310 and #3225 (comment) .

The change is completely backward compatible, and an example of its use can be found in traversaro/ergocub-software@d811e32, from which this snippet is extracted:

yarp_prepare_plugin(couplingXCubHandMk5
                    CATEGORY device
                    TYPE CouplingXCubHandMk5
                    INCLUDE CouplingXCubHandMk5.h
                    GENERATE_PARSER
                    GENERATE_PARSER_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}
                    DEFAULT ON)

if(ENABLE_couplingXCubHandMk5)
  yarp_add_plugin(yarp_couplingXCubHandMk5)

  if(MSVC)
    add_definitions(-D_USE_MATH_DEFINES)
  endif()

  target_sources(yarp_couplingXCubHandMk5 PRIVATE CouplingXCubHandMk5.cpp
                                                  CouplingXCubHandMk5.h
                                                  CouplingXCubHandMk5_ParamsParser.cpp
                                                  CouplingXCubHandMk5_ParamsParser.h)
                                                  ${CMAKE_CURRENT_BINARY_DIR}/CouplingXCubHandMk5_ParamsParser.cpp
                                                  ${CMAKE_CURRENT_BINARY_DIR}/CouplingXCubHandMk5_ParamsParser.h)

  target_include_directories(yarp_couplingXCubHandMk5 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})

I am aware that there is currently a PR freeze (see #3227 (comment)), but I preferred to open a PR before I moved to work on something else, to avoid forgetting about it, so that the PR will be ready once the PR will be accepted again.

fyi @pattacini @Nicogene @PeterBowman @MSECode

@randaz81 randaz81 force-pushed the supportarbitrarylocationforparamparsergen branch from 04e4b7f to 65b9270 Compare May 27, 2025 07:48
@randaz81 randaz81 temporarily deployed to code-analysis May 27, 2025 07:49 — with GitHub Actions Inactive
@randaz81 randaz81 temporarily deployed to code-analysis May 27, 2025 07:50 — with GitHub Actions Inactive
@randaz81 randaz81 force-pushed the supportarbitrarylocationforparamparsergen branch from 65b9270 to c2e4368 Compare May 29, 2025 22:30
@randaz81 randaz81 temporarily deployed to code-analysis May 29, 2025 23:29 — with GitHub Actions Inactive
This parameter can be used to (optionally) generate the files related to device param
parser in an arbitrary location. This is tipically used to generate the files
in the build directory instead of the source one, removing the need of committing
generate files in the repo.
@randaz81 randaz81 force-pushed the supportarbitrarylocationforparamparsergen branch from c2e4368 to 64c6ca0 Compare June 4, 2025 21:40
@randaz81 randaz81 temporarily deployed to code-analysis June 4, 2025 21:42 — with GitHub Actions Inactive
@randaz81 randaz81 temporarily deployed to code-analysis June 4, 2025 21:42 — with GitHub Actions Inactive
Copy link

sonarqubecloud bot commented Jun 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants