Using ALICE_TARGET to define the system
[u/mrichter/AliRoot.git] / cmake / modules / FindGEANT3.cmake
CommitLineData
e969a926 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
11if (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)
16endif (GEANT3_INCLUDE_DIR AND GEANT3_LIBRARIES)
17
18FIND_PATH(GEANT3_SYSTEM_DIR NAMES TGeant3 PATHS
19 $ENV{ALICE}/geant3
20 NO_DEFAULT_PATH
21)
22
23FIND_PATH(GEANT3_INCLUDE_DIR NAMES TGeant3.h PATHS
24 $ENV{ALICE}/geant3/TGeant3
25 NO_DEFAULT_PATH
26)
27
28FIND_PATH(GEANT3_LIBRARY_DIR NAMES libgeant321.so PATHS
73713534 29 $ENV{ALICE}/geant3/lib/tgt_${ALICE_TARGET}
e969a926 30 NO_DEFAULT_PATH
31)
32
33FIND_LIBRARY(GEANT3_LIB NAMES geant321 PATHS
73713534 34 $ENV{ALICE}/geant3/lib/tgt_${ALICE_TARGET}
e969a926 35 NO_DEFAULT_PATH
36)
37
38SET(GEANT3_LIBRARIES ${GEANT3_LIB})
39
40if (GEANT3_INCLUDE_DIR AND GEANT3_LIBRARIES AND GEANT3_SYSTEM_DIR)
41 set(GEANT3_FOUND TRUE)
42endif (GEANT3_INCLUDE_DIR AND GEANT3_LIBRARIES AND GEANT3_SYSTEM_DIR)
43
44if (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)
49else (GEANT3_FOUND)
50 if (GEANT3_FIND_REQUIRED)
51 message(FATAL_ERROR "Looking for GEANT3... - Not found ")
52 endif (GEANT3_FIND_REQUIRED)
53endif (GEANT3_FOUND)
54