ROOT 6.20 will require update of CMakeLists.txt
Problem
After pulling and recompiliing the latest ROOT version and then also recompiling Corryvreckan, I stumbled over this CMake Error:
CMake Error at /home/jens/software/root/cmake/modules/RootNewMacros.cmake:1 (include):
include could not find load file:
RootMacros
Call Stack (most recent call first):
src/objects/CMakeLists.txt:14 (INCLUDE)
CMake Deprecation Warning at /home/jens/software/root/cmake/modules/RootNewMacros.cmake:3 (message):
RootNewMacros.cmake has been renamed to RootMacros.cmake and is deprecated.
Including this file is no longer necessary, as ROOT macros are now
available after a call to find_package(ROOT). Please use
'include(${ROOT_USE_FILE})' if you still need to inherit compilation
options from ROOT as well as enabling the macros.
Hint
This is related to the ROOT Release 6.20 (see here for release notes):
The file
RootNewMacros.cmake
has been renamed toRootMacros.cmake
. Including the old file by name is deprecated and will generate a warning. IncludingRootMacros.cmake
is not necessary, as now it is already included when callingfind_package(ROOT)
. If you still need to inheritROOT
’s compile options, however, you may useinclude(${ROOT_USE_FILE}
) as before.
This is related to this block in src/objects/CMakeLists.txt
:
# Find the RootNewMacros.cmake file and include it
GET_FILENAME_COMPONENT(ROOT_CMAKE_DIR "${ROOT_USE_FILE}" DIRECTORY)
FIND_FILE(ROOT_MACROS_FILE
NAMES RootNewMacros.cmake
HINTS ${ROOT_CMAKE_DIR}/modules/ $ENV{ROOTSYS}/../cmake/modules $ENV{ROOTSYS}/cmake/modules)
IF(NOT ROOT_MACROS_FILE)
MESSAGE(WARNING "Cannot find ROOT macros, including generic file as fallback.")
INCLUDE("${ROOT_USE_FILE}")
ELSE()
INCLUDE(${ROOT_MACROS_FILE})
ENDIF()
I pulled and compiled the latest master
from ROOT and not a particular tag. However, release 6.20 only seems to be planned for November 2019 and is not yet out.
So for now I went back to tag v6-18-04
which should work fine (WIP testing, compilation takes forever).
However, we'll have to address this. Once release 6.20 is out the simple check
# Check ROOT version
IF (NOT ${ROOT_VERSION} VERSION_GREATER "6.0")
MESSAGE(FATAL_ERROR "ROOT versions below 6.0 are not supported")
ENDIF()
will not be sufficient anymore.