Update: removed request of 4 points in ITS (Renu)
[u/mrichter/AliRoot.git] / cmake / modules / FindGEANT3.cmake
1 # -*- mode: cmake -*-
2 # - Try to find GEANT3
3 # Once done this will define
4 #
5 #  GEANT3_FOUND - system has GEANT3
6 #  GEANT3_INCLUDE_DIR - the GEANT3 include directory
7 #  GEANT_LIBRARIES - The libraries needed to use GEANT3
8 #  GEANT_DEFINITIONS - Compiler switches required for using GEANT3
9 #  GEANT3_SYSTEM_DIR - Base directory of the GEANT3 installation, needed for GCALOR
10
11 if (GEANT3_INCLUDE_DIR AND GEANT3_LIBRARIES)
12   SET (GEANT3_INCLUDE_DIR GEANT3_INCLUDE_DIR-NOTFOUND)
13   SET (GEANT3_LIB GEANT3_LIB-NOTFOUND)
14   SET (GEANT3_DUMMY_LIB GEANT3_DUMMY_LIB-NOTFOUND)
15   SET (GEANT3_SYSTEM_DIR GEANT3_SYSTEM_DIR-NOTFOUND)
16 endif (GEANT3_INCLUDE_DIR AND GEANT3_LIBRARIES)
17
18 FIND_PATH(GEANT3_SYSTEM_DIR NAMES TGeant3 PATHS
19   $ENV{ALICE}/geant3
20   NO_DEFAULT_PATH
21 )
22
23 FIND_PATH(GEANT3_INCLUDE_DIR NAMES TGeant3.h PATHS
24   $ENV{ALICE}/geant3/TGeant3
25   NO_DEFAULT_PATH
26 )
27
28 FIND_PATH(GEANT3_LIBRARY_DIR NAMES libgeant321.so PATHS
29   $ENV{ALICE}/geant3/lib/tgt_${ALICE_TARGET}
30   NO_DEFAULT_PATH
31 )
32
33 FIND_LIBRARY(GEANT3_LIB NAMES geant321 PATHS
34   $ENV{ALICE}/geant3/lib/tgt_${ALICE_TARGET}
35   NO_DEFAULT_PATH
36 )
37
38 SET(GEANT3_LIBRARIES ${GEANT3_LIB})
39
40 if (GEANT3_INCLUDE_DIR AND GEANT3_LIBRARIES AND GEANT3_SYSTEM_DIR)
41    set(GEANT3_FOUND TRUE)
42 endif (GEANT3_INCLUDE_DIR AND GEANT3_LIBRARIES AND GEANT3_SYSTEM_DIR)
43
44 if (GEANT3_FOUND)
45   if (NOT GEANT3_FIND_QUIETLY)
46     MESSAGE(STATUS "Found GEANT3 in ${GEANT3_LIBRARIES}")
47     SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${GEANT3_LIBRARY_DIR})
48   endif (NOT GEANT3_FIND_QUIETLY)
49 else (GEANT3_FOUND)
50   if (GEANT3_FIND_REQUIRED)
51     message(FATAL_ERROR "Looking for GEANT3... - Not found ")
52   endif (GEANT3_FIND_REQUIRED)
53 endif (GEANT3_FOUND)
54