Skip to content

[cmake] Ignore prefix when running genreflex during build - #23971

Open
ellert wants to merge 1 commit into
root-project:masterfrom
ellert:ignore-prefix-genreflex
Open

ellert wants to merge 1 commit into
root-project:masterfrom
ellert:ignore-prefix-genreflex

Conversation

@ellert

@ellert ellert commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

This Pull request:

Changes or fixes:

Ignore prefix when running binaries in the build tree during build.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

@ellert
ellert requested a review from bellenot as a code owner November 3, 2026 15:53
endif()
add_custom_command(
COMMAND ${ROOT_genreflex_CMD}
COMMAND ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" ${ROOT_genreflex_CMD}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ROOTIGNOREPREFIX=1 has to be set only when genreflex is running in the build tree. So it has to be inserted a few lines above only in the CMAKE_PROJECT_NAME STREQUAL ROOT branch:

  if(CMAKE_PROJECT_NAME STREQUAL ROOT)
    set(ROOT_genreflex_CMD ${CMAKE_COMMAND} -E env "ROOTIGNOREPREFIX=1" $<TARGET_FILE:genreflex>)
  elseif(TARGET ROOT::genreflex)

Would that work instead? Otherwise, we risk breaking use of the REFLEX_GENERATE_DICTIONARY macro by downstream projects.

This branch has not been deployed

No deployments
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