]> git.uio.no Git - u/mrichter/AliRoot.git/blob - cmake/FindFASTJET.cmake
Fix if both FASTJET and FASTJET_ROOT are not set
[u/mrichter/AliRoot.git] / cmake / FindFASTJET.cmake
1 # AliRoot Build System Module to find and configure FASTJET
2 #
3 # Author: Marco van Leeuwen
4 #
5 # Simple first version; checks env variables and fastjet-config; does not verify that includes and libs are really present
6
7 cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
8
9 set(FASTJET_ROOT $ENV{FASTJET_ROOT})
10
11 if (NOT FASTJET_ROOT)
12   set(FASTJET_ROOT $ENV{FASTJET})
13 endif(NOT FASTJET_ROOT)
14
15 if (NOT FASTJET_ROOT)
16   execute_process (COMMAND fastjet-config --prefix OUTPUT_VARIABLE FASTJET_ROOT)
17   string (STRIP "${FASTJET_ROOT}" FASTJET_ROOT)
18 endif(NOT FASTJET_ROOT)
19
20 if (FASTJET_ROOT) 
21   message(STATUS "FASTJET found in ${FASTJET_ROOT}")
22   set (FASTJET_FOUND true)
23   set (FASTJET_INCLUDE_DIR ${FASTJET_ROOT}/include)
24   message(STATUS "FASTJET include directory: ${FASTJET_INCLUDE_DIR}")
25   set (FASTJET_DEFINITIONS -DHAVE_FASTJET)
26 else()
27   message(STATUS "FASTJET not found; make sure to set the FASTJET_ROOT environment variable or have fastjet-config in your path to use fastjet")
28 endif(FASTJET_ROOT)
29