Fixed install target
[u/mrichter/AliRoot.git] / cmake / FindROOT.cmake
CommitLineData
6db31708 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 FATAL_ERROR)
7
dad683d0 8set(ROOTSYS $ENV{ROOTSYS})
9if(NOT ROOTSYS)
10 message(FATAL_ERROR "Environment variable $ROOTSYS is not set !")
11else()
12 get_filename_component(ROOTSYS "${ROOTSYS}" REALPATH)
13endif(NOT ROOTSYS)
6db31708 14find_program(ROOT_CONFIG NAMES root-config)
15find_program(ROOTCINT NAMES rootcint)
16if(NOT ROOT_CONFIG)
17 message(FATAL_ERROR "root-config is not installed on this system")
18endif(NOT ROOT_CONFIG)
19message(STATUS "Check for root-config: ${ROOT_CONFIG}")
20message(STATUS "Check for rootcint: ${ROOTCINT}")
21if(ROOT_CONFIG AND ROOTCINT)
22 set(ROOT_FOUND TRUE)
23 ALICE_RootConfig(ROOT_VERSION --version)
24 message(STATUS "ROOT ${ROOT_VERSION} found")
25 ALICE_RootConfig(ROOTLIBDIR --libdir)
26 ALICE_RootConfig(ROOTPLUGDIR --version)
27 string(REGEX REPLACE "(^.*/)[^/]+" "${ROOTLIBDIR}/\\1" ROOTPLUGDIR ${ROOTPLUGDIR})
28 ALICE_RootConfig(ROOTINCDIR --incdir)
29 ALICE_RootConfig(ROOTCLIBS --glibs)
30 ALICE_RootConfig(ROOTHASALIEN --has-alien)
31 ALICE_RootConfig(ROOTHASXML --has-xml)
32 set(ROOTCLIBS ${ROOTCLIBS} -lThread -lMinuit -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lXMLParser -lProof -lProofPlayer -lMLP -lSpectrum -L${ROOTPLUGDIR} )
33 set(ROOTPLIBS $ENV{ROOTPLIBS})
dad683d0 34 message(STATUS "ROOTSYS directory : ${ROOTSYS}")
6db31708 35 message(STATUS "ROOT include directory: ${ROOTINCDIR}")
36 message(STATUS "ROOT library directory: ${ROOTLIBDIR}")
37else()
38 message(FATAL_ERROR "rootcint not found ! Please check your ROOT installation.")
39endif(ROOT_CONFIG AND ROOTCINT)