Changes for Root6 (Mikolaj)
[u/mrichter/AliRoot.git] / cmake / FindGEANT3.cmake
1 # AliRoot Build System Module to find and configure GEANT3
2 #
3 # Author: Johny Jose (johny.jose@cern.ch)
4 #         Port of previous Makefile build to cmake
5
6 cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
7
8 set(GEANT3DIR $ENV{GEANT3DIR})
9 ALICE_RootConfig(GEANT3_PLATFORM --arch)
10
11 find_path(GEANT3_SYSTEM_DIR NAMES TGeant3 PATHS ${ALICE}/geant3 ${GEANT3DIR})
12 message(STATUS "GEANT3 system directory: ${GEANT3_SYSTEM_DIR}")
13
14 find_path(GEANT3_INCLUDE_DIR NAMES TGeant3.h PATHS ${ALICE}/geant3/TGeant3 ${GEANT3DIR}/TGeant3)
15 message(STATUS "GEANT3 include directory: ${GEANT3_INCLUDE_DIR}")
16 set(GEANT3_ROOT ${GEANT3_INCLUDE_DIR})
17
18 find_path(GEANT3_LIBRARY_DIR NAMES libgeant321.so PATHS ${ALICE}/geant3/lib/tgt_${GEANT3_PLATFORM} ${GEANT3DIR}/lib/tgt_${GEANT3_PLATFORM})
19 message(STATUS "GEANT3 library directory: ${GEANT3_LIBRARY_DIR}")
20
21 find_library(GEANT3_LIB NAMES geant321 PATHS ${ALICE}/geant3/lib/tgt_${GEANT3_PLATFORM} ${GEANT3DIR}/lib/tgt_${GEANT3_PLATFORM})
22
23 if (GEANT3_INCLUDE_DIR AND GEANT3_LIB AND GEANT3_SYSTEM_DIR)
24    set(GEANT3_FOUND TRUE)
25 endif (GEANT3_INCLUDE_DIR AND GEANT3_LIB AND GEANT3_SYSTEM_DIR)
26
27 if (GEANT3_FOUND)
28   message(STATUS "GEANT3 found")
29 else()
30   message(STATUS "GEANT3 not found")
31 endif (GEANT3_FOUND)