coverity fix
[u/mrichter/AliRoot.git] / cmake / FindGEANT3.cmake
CommitLineData
6db31708 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
6b06712c 6cmake_minimum_required(VERSION 2.8.4 FATAL_ERROR)
6db31708 7
8902bb77 8set(GEANT3DIR $ENV{GEANT3DIR})
6db31708 9ALICE_RootConfig(GEANT3_PLATFORM --arch)
10
8902bb77 11find_path(GEANT3_SYSTEM_DIR NAMES TGeant3 PATHS ${ALICE}/geant3 ${GEANT3DIR})
6db31708 12message(STATUS "GEANT3 system directory: ${GEANT3_SYSTEM_DIR}")
13
8902bb77 14find_path(GEANT3_INCLUDE_DIR NAMES TGeant3.h PATHS ${ALICE}/geant3/TGeant3 ${GEANT3DIR}/TGeant3)
6db31708 15message(STATUS "GEANT3 include directory: ${GEANT3_INCLUDE_DIR}")
16set(GEANT3_ROOT ${GEANT3_INCLUDE_DIR})
17
8902bb77 18find_path(GEANT3_LIBRARY_DIR NAMES libgeant321.so PATHS ${ALICE}/geant3/lib/tgt_${GEANT3_PLATFORM} ${GEANT3DIR}/lib/tgt_${GEANT3_PLATFORM})
6db31708 19message(STATUS "GEANT3 library directory: ${GEANT3_LIBRARY_DIR}")
20
8902bb77 21find_library(GEANT3_LIB NAMES geant321 PATHS ${ALICE}/geant3/lib/tgt_${GEANT3_PLATFORM} ${GEANT3DIR}/lib/tgt_${GEANT3_PLATFORM})
6db31708 22
23if (GEANT3_INCLUDE_DIR AND GEANT3_LIB AND GEANT3_SYSTEM_DIR)
24 set(GEANT3_FOUND TRUE)
25endif (GEANT3_INCLUDE_DIR AND GEANT3_LIB AND GEANT3_SYSTEM_DIR)
26
27if (GEANT3_FOUND)
28 message(STATUS "GEANT3 found")
29else()
30 message(STATUS "GEANT3 not found")
31endif (GEANT3_FOUND)