# - ROOT_LIBMAP - path to rlibmap executable
# - ROOT_FEATURES - list of build features for ROOT
# - ROOT_LIBDIR - full path to ROOT library folder
+# - ROOT_ETCDIR - full path to the ROOT's configuration directory
# - ROOT_LIBRARIES - libraries needed for the package to be used
# - ROOT_GLIBRARIES - regular + GUI ROOT libraries + path to be used during linking
# - ROOT_INCLUDE_DIR - full path to ROOT include folder
endif(NOT ROOT_CONFIG)
# Check for rlibmap
- find_program(ROOT_LIBMAP NAMES rlibmap PATHS ${ROOTSYS}/bin NO_DEFAULT_PATH)
+ find_program(ROOT_LIBMAP NAMES rlibmap rootcling PATHS ${ROOTSYS}/bin NO_DEFAULT_PATH)
if(ROOT_LIBMAP)
message(STATUS "Found ${ROOT_LIBMAP}")
else()
if(error)
message(FATAL_ERROR "Error retrieving ROOT version : ${error}")
endif(error)
- string(STRIP ${ROOT_VERSION} ROOT_VERSION)
+ string(STRIP "${ROOT_VERSION}" ROOT_VERSION)
# Extract major, minor, and patch versions from
string(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1" ROOT_VERSION_MAJOR "${ROOT_VERSION}")
if(error)
message(FATAL_ERROR "Error retrieving ROOT features : ${error}")
else()
- message(STATUS "ROOT was build with the following features: ${ROOT_FEATURES}")
+ message(STATUS "ROOT was built with the following features: ${ROOT_FEATURES}")
endif(error)
- string(STRIP ${ROOT_FEATURES} ROOT_FEATURES)
+ string(STRIP "${ROOT_FEATURES}" ROOT_FEATURES)
# Checking for ROOT libdir
execute_process(COMMAND ${ROOT_CONFIG} --libdir OUTPUT_VARIABLE ROOT_LIBDIR ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
message(FATAL_ERROR "Error retrieving ROOT libdir: ${error}")
endif(error)
- string(STRIP ${ROOT_LIBDIR} ROOT_LIBDIR)
+ string(STRIP "${ROOT_LIBDIR}" ROOT_LIBDIR)
+
+ # Checking for ROOT etcdir
+ execute_process(COMMAND ${ROOT_CONFIG} --etcdir OUTPUT_VARIABLE ROOT_ETCDIR ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(error)
+ message(FATAL_ERROR "Error retrieving ROOT etcdir: ${error}")
+ endif(error)
+ string(STRIP "${ROOT_ETCDIR}" ROOT_ETCDIR)
# Checking for ROOT libs
execute_process(COMMAND ${ROOT_CONFIG} --noldflags --libs OUTPUT_VARIABLE ROOT_LIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
message(FATAL_ERROR "Error retrieving ROOT libdir: ${error}")
endif(error)
- string(STRIP ${ROOT_LIBS} ROOT_LIBS)
+ string(STRIP "${ROOT_LIBS}" ROOT_LIBS)
foreach(lib ${ROOT_LIBS})
string(REPLACE "-rdynamic" "" new_lib ${lib})
string(REPLACE "-l" "" lib ${new_lib})
set(ROOT_LIBRARIES ${ROOT_LIBRARIES} ${lib})
endforeach()
- string(STRIP ${ROOT_LIBRARIES} ROOT_LIBRARIES)
+ string(STRIP "${ROOT_LIBRARIES}" ROOT_LIBRARIES)
separate_arguments(ROOT_LIBRARIES)
# Checking for ROOT incdir
if(error)
message(FATAL_ERROR "Error retrieving ROOT incdir: ${error}")
endif(error)
- string(STRIP ${ROOT_INCDIR} ROOT_INCDIR)
+ string(STRIP "${ROOT_INCDIR}" ROOT_INCDIR)
set(ROOT_INCLUDE_DIR ${ROOT_INCDIR})
# Checking for glibs
endif(error)
# Checking for glibs
- string(STRIP ${ROOT_GLIBS} ROOT_GLIBS)
+ string(STRIP "${ROOT_GLIBS}" ROOT_GLIBS)
foreach(lib ${ROOT_GLIBS})
string(REPLACE "-rdynamic" "" new_lib "${lib}")
string(REPLACE "-l" "" lib "${new_lib}")
set(ROOT_GLIBRARIES ${ROOT_GLIBRARIES} ${lib})
endforeach()
- string(STRIP ${ROOT_GLIBRARIES} ROOT_GLIBRARIES)
+ string(STRIP "${ROOT_GLIBRARIES}" ROOT_GLIBRARIES)
separate_arguments(ROOT_GLIBRARIES)
# Checking for AliEn support
+ # If AliEn support is enabled we need to point to AliEn
execute_process(COMMAND ${ROOT_CONFIG} --has-alien OUTPUT_VARIABLE ROOT_HASALIEN ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
- message(FATAL_ERROR "Error checking if ROOT was build with AliEn support: ${error}")
+ message(FATAL_ERROR "Error checking if ROOT was built with AliEn support: ${error}")
endif(error)
#if defined
if(ROOT_HASALIEN)
- string(STRIP ${ROOT_HASALIEN} ROOT_HASALIEN)
+ string(STRIP "${ROOT_HASALIEN}" ROOT_HASALIEN)
if(ROOT_HASALIEN STREQUAL "yes")
+ if(ALIEN)
add_definitions(-DWITHALIEN)
+
+ # AliEn might bring some system libraries, we need to use them
+ if(EXISTS "${ALIEN}/lib")
+ link_directories(${ALIEN}/lib)
+ endif()
+
+ # api/lib should always exists
+ if(EXISTS "${ALIEN}/api/lib")
+ link_directories(${ALIEN}/api/lib)
+ endif()
+
+ # include for AliEn
+ if(EXISTS "${ALIEN}/include")
+ include_directories(SYSTEM ${ALIEN}/include)
+ endif()
+
+ # api/include always exists
+ if(EXISTS "${ALIEN}/api/include")
+ include_directories(SYSTEM ${ALIEN}/api/include)
+ endif()
+
+ set(ROOT_HASALIEN TRUE)
+ else(ALIEN)
+ message(FATAL_ERROR "ROOT was built with AliEn support but no AliEn installation found. Please set \"ALIEN\" to point to your AliEn installation.")
+ endif(ALIEN)
+ else()
+ set(ROOT_HASALIEN FALSE)
endif()
endif(ROOT_HASALIEN)
# Checking for xml support
execute_process(COMMAND ${ROOT_CONFIG} --has-xml OUTPUT_VARIABLE ROOT_HASXML ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
- message(FATAL_ERROR "Error checking if ROOT was build with xml support: ${error}")
+ message(FATAL_ERROR "Error checking if ROOT was built with xml support: ${error}")
endif(error)
# if defined
if(ROOT_HASXML)
- string(STRIP ${ROOT_HASXML} ROOT_HASXML)
+ string(STRIP "${ROOT_HASXML}" ROOT_HASXML)
if(ROOT_HASXML STREQUAL "yes")
add_definitions(-DWITHXML)
+ set(ROOT_HASXML TRUE)
+ else()
+ set(ROOT_HASXML FALSE)
endif()
endif(ROOT_HASXML)
# Checking for OpenGL support
execute_process(COMMAND ${ROOT_CONFIG} --has-opengl OUTPUT_VARIABLE ROOT_HASOPENGL ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
- message(FATAL_ERROR "Error checking if ROOT was build with OpenGL support: ${error}")
+ message(FATAL_ERROR "Error checking if ROOT was built with OpenGL support: ${error}")
endif(error)
- string(STRIP ${ROOT_HASOPENGL} ROOT_HASOPENGL)
+
+ if(ROOT_HASOPENGL)
+ string(STRIP "${ROOT_HASOPENGL}" ROOT_HASOPENGL)
+ if(ROOT_HASOPENGL STREQUAL "yes")
+ set(ROOT_HASOPENGL TRUE)
+ else()
+ set(ROOT_HASOPENGL FALSE)
+ endif()
+ endif()
+
# Checking for fortran compiler
execute_process(COMMAND ${ROOT_CONFIG} --f77 OUTPUT_VARIABLE ROOT_FORTRAN ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE )
if(error)
message(FATAL_ERROR "Error checking ROOT fortran compiler: ${error}")
endif(error)
- string(STRIP ${ROOT_FORTRAN} ROOT_FORTRAN)
+ string(STRIP "${ROOT_FORTRAN}" ROOT_FORTRAN)
# adding the libraries and the inc dir
link_directories(${ROOT_LIBDIR})
- include_directories(${ROOT_INCLUDE_DIR})
+ include_directories(SYSTEM ${ROOT_INCLUDE_DIR})
set(ROOT_FOUND TRUE)
# Workaround misssing XML, VMC, Minuit from ROOT static library
if(ALIROOT_STATIC)
message(WARNING "AliRoot static build enabled! libRootExtra.a will be created.\nPlease remove when ROOT https://sft.its.cern.ch/jira/browse/ROOT-6904 issue is fixed")
- # ROOT needs xml2 but it is not build with the static version so we have to add it
+ # ROOT needs xml2 but it is not built with the static version so we have to add it
find_package(LibXml2)
if(LIBXML2_FOUND)
endif(ALIROOT_STATIC)
else()
message(FATAL_ERROR "ROOT installation not found! Please point to the ROOT installation using -DROOTSYS=ROOT_INSTALL_DIR.")
-endif(ROOTSYS)
\ No newline at end of file
+endif(ROOTSYS)