Changes for Root6 (Mikolaj)
[u/mrichter/AliRoot.git] / cmake / FindROOT.cmake.old
CommitLineData
fffaf6a5 1# AliRoot Build System Module to find and configure ROOT
2#
3# Author: Johny Jose m(johny.jose@cern.ch)
4# Port of previous Makefile build to cmake
5
6cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
7
8# We don't care if ROOTSYS environment variable is set or not -
9# all we care about is that we can find root-config in our path
10# set(ROOTSYS $ENV{ROOTSYS} CACHE STRING "" FORCE)
11# if(NOT ROOTSYS)
12# message(FATAL_ERROR "Environment variable $ROOTSYS is not set !")
13# else()
14# get_filename_component(ROOTSYS "${ROOTSYS}" REALPATH)
15# endif(NOT ROOTSYS)
16find_program(ROOT_CONFIG NAMES root-config)
17find_program(ROOTCINT NAMES rootcint)
18if(NOT ROOT_CONFIG)
19 message(FATAL_ERROR "root-config is not installed on this system")
20endif(NOT ROOT_CONFIG)
21message(STATUS "Check for root-config: ${ROOT_CONFIG}")
22message(STATUS "Check for rootcint: ${ROOTCINT}")
23if(ROOT_CONFIG AND ROOTCINT)
24 set(ROOT_FOUND TRUE)
25 ALICE_RootConfig(ROOT_VERSION --version)
26 message(STATUS "ROOT ${ROOT_VERSION} found")
27 ALICE_RootConfig(ROOTLIBDIR --libdir)
28 ALICE_RootConfig(ROOTPLUGDIR --version)
29 string(REGEX REPLACE "(^.*/)[^/]+" "${ROOTLIBDIR}/\\1" ROOTPLUGDIR ${ROOTPLUGDIR})
30 ALICE_RootConfig(ROOTINCDIR --incdir)
31 ALICE_RootConfig(ROOTCLIBS --glibs)
32 ALICE_RootConfig(ROOTHASALIEN --has-alien)
33 ALICE_RootConfig(ROOTHASXML --has-xml)
34 # ALICE_RootConfig(ROOTHASVC --has-vc)
35# set(ROOTCLIBS "${ROOTCLIBS} -lThread -lMinuit -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lXMLParser -lProof -lProofPlayer -lMLP -lSpectrum -L${ROOTPLUGDIR}" )
36 set(ROOTCLIBS "${ROOTCLIBS} -lThread -lMinuit -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lXMLParser -lProof -lProofPlayer -lMLP -lSpectrum" )
37 # if(${ROOTHASVC} STREQUAL "yes")
38 # set(ROOTCLIBS "${ROOTCLIBS} -lVc")
39 # endif(${ROOTHASVC} STREQUAL "yes")
40 set(ROOTPLIBS $ENV{ROOTPLIBS})
41 if(NOT $ENV{ROOTSYS})
42 message(STATUS "ROOTSYS directory : ${ROOTSYS}")
43 else()
44 message(STATUS "ROOTSYS directory : not set - assume prefix build")
45 endif(NOT $ENV{ROOTSYS})
46 message(STATUS "ROOT include directory: ${ROOTINCDIR}")
47 message(STATUS "ROOT library directory: ${ROOTLIBDIR}")
48 # message(STATUS "ROOT libraries: ${ROOTCLIBS}")
49 # message(STATUS "ROOT has Vc: ${ROOTHASVC}")
50 # message(STATUS "ROOT has XML: ${ROOTHASXML}")
51 set(ROOT6_ALPHA "5.99.1")
52 string(REGEX REPLACE "/0*" "." ROOT_DOTVERSION ${ROOT_VERSION})
53 if(ROOT_DOTVERSION VERSION_GREATER ROOT6_ALPHA)
54 message(WARNING
55 "Compling and linking against ROOT6 alpha is highly experimental")
56 endif(ROOT_DOTVERSION VERSION_GREATER ROOT6_ALPHA)
57else()
58 message(FATAL_ERROR "rootcint not found ! Please check your ROOT installation.")
59endif(ROOT_CONFIG AND ROOTCINT)