Completely reengineered version of CMake build system (Johny)
[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 FATAL_ERROR)
7
8 ALICE_RootConfig(GEANT3_PLATFORM --arch)
9
10 find_path(GEANT3_SYSTEM_DIR NAMES TGeant3 PATHS ${ALICE}/geant3)
11 message(STATUS "GEANT3 system directory: ${GEANT3_SYSTEM_DIR}")
12
13 find_path(GEANT3_INCLUDE_DIR NAMES TGeant3.h PATHS ${ALICE}/geant3/TGeant3)
14 message(STATUS "GEANT3 include directory: ${GEANT3_INCLUDE_DIR}")
15 set(GEANT3_ROOT ${GEANT3_INCLUDE_DIR})
16
17 find_path(GEANT3_LIBRARY_DIR NAMES libgeant321.so PATHS ${ALICE}/geant3/lib/tgt_${GEANT3_PLATFORM})
18 message(STATUS "GEANT3 library directory: ${GEANT3_LIBRARY_DIR}")
19
20 find_library(GEANT3_LIB NAMES geant321 PATHS ${ALICE}/geant3/lib/tgt_${GEANT3_PLATFORM})
21
22 if (GEANT3_INCLUDE_DIR AND GEANT3_LIB AND GEANT3_SYSTEM_DIR)
23    set(GEANT3_FOUND TRUE)
24 endif (GEANT3_INCLUDE_DIR AND GEANT3_LIB AND GEANT3_SYSTEM_DIR)
25
26 if (GEANT3_FOUND)
27   message(STATUS "GEANT3 found")
28 else()
29   message(STATUS "GEANT3 not found")
30 endif (GEANT3_FOUND)