-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix FindROOT.cmake
in case thisroot.sh
wasn't sourced
#136
Conversation
Arguably one might want to error out same as for windows here. But given that `root-config` is enough to identify the bin directory of root, in theory it's enough for our purposes. Without the definition of `ROOTSYS` (i.e. `thisroot` wasn't sourced), hard to debug errors appear for people unfamiliar with ROOT & CMAKE
Thanks for this. It is my goal to remove the Now the way to find root is to call the standard cmake macro: Regarding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pipeline is green so for me is good to merge and solve installation problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FindROOT.cmake macro will be deprecated soon.
I guess it is fine to merge now. @nkx is using Windows, but I believe he will not get in troubles with this patch? |
I don't quite understand how that will work. If I understand the cmake docs correctly: https://cmake.org/cmake/help/latest/command/find_package.html it says that
Unless I made some mistake, nothing should change in case the ROOT installation is set up correctly. If it wasn't there probably would have been other errors for @nkx111. |
@Vindaar |
Ah, I had no idea cmake had such a feature. So that means also all binary installations of root include that cmake file? |
Yes, atleast the most recent ones. This also happens for Garfield, Geant4 and most modern c++ libraries/packages. |
No errors for me. Actually on Windows I only do the coding. When building REST I always switch to linux. |
Related to #133.
While helping @jovoy, we stumbled over the
FindROOT.cmake
script which currently:ROOTSYS
is defined (i.e. whetherthisroot.*
was sourced)root-config
to get all information it needs.So this PR:
ROOTSYS
is undefinedroot-config --bindir
on unix, as that is all we need to determine the path torootcint
.I'm neither a cmake expert, nor sure whether it's wise in the first place to continue if
ROOTSYS
is not defined. I can't foresee if later not having sourced the file leads to even harder to debug issues. Alternatively, we could also just check for the existence of the variable on unix and fatal error in the same way.If
FindROOT.cmake
is buried soon, just make sure the behavior of the alternative is sane & checks for this as well.@rest-for-physics/core_dev