Moving required CMake version from 2.8.4 to 2.8.8
[u/mrichter/AliRoot.git] / cmake / FindFASTJET.cmake
CommitLineData
f4809a5d 1# AliRoot Build System Module to find and configure FASTJET
2#
3# Author: Marco van Leeuwen
4#
0c83a82d 5# Simple first version; checks env variables and fastjet-config; verifies that fastjet/PseudoJet.hh exists
f4809a5d 6
cbd58b9c 7cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
f4809a5d 8
0c83a82d 9# FASTJET_ROOT is a legacy env variable; could be removed
10if (NOT FASTJET)
11 set(FASTJET $ENV{FASTJET_ROOT})
12endif(NOT FASTJET)
f4809a5d 13
0c83a82d 14if (NOT FASTJET)
15 set(FASTJET $ENV{FASTJET})
16endif(NOT FASTJET)
f4809a5d 17
0c83a82d 18if (NOT FASTJET)
19 execute_process (COMMAND fastjet-config --prefix OUTPUT_VARIABLE FASTJET)
20 string (STRIP "${FASTJET}" FASTJET)
21endif(NOT FASTJET)
f4809a5d 22
0c83a82d 23# Check for one of the header files
24if (FASTJET)
25 find_path(FASTJET include/fastjet/PseudoJet.hh PATHS ${FASTJET})
26 if (FASTJET-NOTFOUND)
27 message(STATUS "Header file fastjet/PseudoJet.hh not found in ${FASTJET}/include")
28 endif (FASTJET-NOTFOUND)
29endif (FASTJET)
30
31if (FASTJET AND NOT FASTJET-NOTFOUND)
32 message(STATUS "FASTJET found in ${FASTJET}")
f4809a5d 33 set (FASTJET_FOUND true)
0c83a82d 34 set (FASTJET_INCLUDE_DIR ${FASTJET}/include)
f4809a5d 35 message(STATUS "FASTJET include directory: ${FASTJET_INCLUDE_DIR}")
36 set (FASTJET_DEFINITIONS -DHAVE_FASTJET)
37else()
38 message(STATUS "FASTJET not found; make sure to set the FASTJET_ROOT environment variable or have fastjet-config in your path to use fastjet")
f0c10128 39 set (FASTJET)
0c83a82d 40endif(FASTJET AND NOT FASTJET-NOTFOUND)
f4809a5d 41