Skip to content

Fix ROOT's CMake macros

When FindPackage(ROOT ...) is called, it provides a path to a CMake module with useful macros or functions such as ROOT_GENERATE_DICTIONARY in the ROOT_USE_FILE environment variable.

Unfortunately, this module relies on environment variables that are set by FindPackage(ROOT ...) and will be reset by other calls to FindPackage, such as the _thisdir environment variable.

There are two ways to resolve this: duplicate the FindPackage statement close to the import of ROOT_USE_FILE or import ROOT_USE_FILE right after calling FindPackage. This MR goes for the latter, but can switch to the former if there is demand

Merge request reports