Completely reengineered version of CMake build system (Johny)
[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
8find_program(ROOT_CONFIG NAMES root-config)
9find_program(ROOTCINT NAMES rootcint)
10if(NOT ROOT_CONFIG)
11 message(FATAL_ERROR "root-config is not installed on this system")
12endif(NOT ROOT_CONFIG)
13message(STATUS "Check for root-config: ${ROOT_CONFIG}")
14message(STATUS "Check for rootcint: ${ROOTCINT}")
15if(ROOT_CONFIG AND ROOTCINT)
16 set(ROOT_FOUND TRUE)
17 ALICE_RootConfig(ROOT_VERSION --version)
18 message(STATUS "ROOT ${ROOT_VERSION} found")
19 ALICE_RootConfig(ROOTLIBDIR --libdir)
20 ALICE_RootConfig(ROOTPLUGDIR --version)
21 string(REGEX REPLACE "(^.*/)[^/]+" "${ROOTLIBDIR}/\\1" ROOTPLUGDIR ${ROOTPLUGDIR})
22 ALICE_RootConfig(ROOTINCDIR --incdir)
23 ALICE_RootConfig(ROOTCLIBS --glibs)
24 ALICE_RootConfig(ROOTHASALIEN --has-alien)
25 ALICE_RootConfig(ROOTHASXML --has-xml)
26 set(ROOTCLIBS ${ROOTCLIBS} -lThread -lMinuit -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lXMLParser -lProof -lProofPlayer -lMLP -lSpectrum -L${ROOTPLUGDIR} )
27 set(ROOTPLIBS $ENV{ROOTPLIBS})
28 message(STATUS "ROOT include directory: ${ROOTINCDIR}")
29 message(STATUS "ROOT library directory: ${ROOTLIBDIR}")
30else()
31 message(FATAL_ERROR "rootcint not found ! Please check your ROOT installation.")
32endif(ROOT_CONFIG AND ROOTCINT)