Removal of some CMake targets in Root 6.36

In some project depending on Root, built with CMake, I was using (in a few locations, mainly tests), constructs like :


add_test(
...
 ENVIRONMENT_MODIFICATION   PATH=path_list_prepend:$<TARGET_FILE_DIR:ROOT::root>:${PROJECT_BINARY_DIR}/stage/bin)

to get access to the Root installation directory, using only target-relate functions (i.e not using variables).

Since [cmake] Don't export all executables by bellenot · Pull Request #17531 · root-project/root · GitHub this is no longer working. In the example above I solved it by changing ROOT::root to ROOT::rootcling but I wonder what would now be the recommended way to get e.g. the path to the root executable itself, for instance to run root -q -b somemacro.C in a ctest test ? (which I would have attempted as $<TARGET_FILE::ROOT::root> previously)

Thanks,

Hello @laurent.aphecetche,

using rootcling was the right decision. On the discussion of the corresponding issue, everybody agreed that rootcling is used by external projects.
However, I would say that you rightfully could have expected to reach the root executable in the same way. @bellenot, would you agree that we should at least put root(.exe) back into the export set?

Hi, I have absolutely no strong opinion on this, as I had no strong opinion on the original discussion, so fine with me to put root[.exe] back. But I just don’t want to have a ping-pong between people wanting it in and other wanting it out. So I’ll put it back next week and I’ll consider the issue closed.

@StephanH here is the pull request: [cmake] Export root and root.exe by bellenot · Pull Request #19353 · root-project/root · GitHub

1 Like