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,