Skip to content

Commit

Permalink
[unix] do not use $ROOTSYS, use root-config --bindir
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Vindaar committed Feb 14, 2022
1 parent 071f2af commit b7bcef5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmake/FindROOT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ else()
OUTPUT_VARIABLE ROOT_LIBRARY_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)


set(ROOTCINT_EXECUTABLE $ENV{ROOTSYS}/bin/rootcint)
set(GENREFLEX_EXECUTABLE $ENV{ROOTSYS}/bin/genreflex)

execute_process(
COMMAND ${ROOT_CONFIG_EXECUTABLE} --version
OUTPUT_VARIABLE ROOT_VERSION
Expand All @@ -85,6 +81,8 @@ else()
OUTPUT_VARIABLE ROOT_BIN_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)

set(ROOTCINT_EXECUTABLE ${ROOT_BIN_DIR}/rootcint)
set(GENREFLEX_EXECUTABLE ${ROOT_BIN_DIR}/genreflex)

# Make variables changeble to the advanced user
mark_as_advanced(ROOT_CONFIG_EXECUTABLE)
Expand Down

0 comments on commit b7bcef5

Please sign in to comment.