<PackageName>_ROOT vs <PackageName>_ROOT_DIR

Interesting question, I haven’t thought about this before. But the way I read the documentation now actually makes sense to me: Xxx_ROOT_DIR is the result variable that is (should be, for the sake of consistency/convention) set by the FindXxx.cmake module when/if Xxx is found, and Xxx_ROOT is the variable that FindXxx.cmake module will use to get a list of paths/prefixes of potential Xxx whereabouts to know where to look for it.

So, in other words (and with the right “order of use”):

  1. Xxx_ROOT contains the path(s) of where to look for Xxx;
  2. FindXxx.cmake attempts to find Xxx using those paths;
  3. If Xxx is found, then Xxx_ROOT_DIR is set.
2 Likes