|
| 1 | +# Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. |
| 2 | +# All rights reserved. |
| 3 | +# |
| 4 | +# For the licensing terms see $ROOTSYS/LICENSE. |
| 5 | +# For the list of contributors see $ROOTSYS/README/CREDITS. |
| 6 | + |
| 7 | +# File taken from ROOT project |
| 8 | + |
| 9 | +# - Locate pythia6 library |
| 10 | +# Defines: |
| 11 | +# |
| 12 | +# PYTHIA6_FOUND |
| 13 | +# PYTHIA6_INCLUDE_DIR |
| 14 | +# PYTHIA6_INCLUDE_DIRS (not cached) |
| 15 | +# PYTHIA6_LIBRARY |
| 16 | +# PYTHIA6_LIBRARY_DIR (not cached) |
| 17 | +# PYTHIA6_LIBRARIES (not cached) |
| 18 | + |
| 19 | +set(_pythia6dirs |
| 20 | + ${PYTHIA6} |
| 21 | + $ENV{PYTHIA6} |
| 22 | + ${PYTHIA6_DIR} |
| 23 | + $ENV{PYTHIA6_DIR}) |
| 24 | + |
| 25 | +find_path(PYTHIA6_INCLUDE_DIR general_pythia.inc |
| 26 | + HINTS ${_pythia6dirs} |
| 27 | + PATH_SUFFIXES include |
| 28 | + DOC "Specify the Pythia6 include dir here.") |
| 29 | + |
| 30 | +if(PYTHIA6_INCLUDE_DIR) |
| 31 | + set(PYTHIA6_INCLUDE_DIRS ${PYTHIA6_INCLUDE_DIR}) |
| 32 | +endif() |
| 33 | + |
| 34 | +find_library(PYTHIA6_LIBRARY NAMES pythia6 Pythia6 |
| 35 | + HINTS ${_pythia6dirs} |
| 36 | + PATH_SUFFIXES lib |
| 37 | + DOC "Specify the Pythia6 library here.") |
| 38 | + |
| 39 | +set(PYTHIA6_LIBRARIES ${PYTHIA6_LIBRARY}) |
| 40 | + |
| 41 | +foreach(lib rootinterface pythia6_dummy) |
| 42 | + find_library(PYTHIA6_${lib}_LIBRARY NAMES ${lib} |
| 43 | + HINTS ${_pythia6dirs} |
| 44 | + PATH_SUFFIXES lib |
| 45 | + DOC "Specify the Pythia rootinterface library here.") |
| 46 | + if(PYTHIA6_${lib}_LIBRARY) |
| 47 | + list(APPEND PYTHIA6_LIBRARIES ${PYTHIA6_${lib}_LIBRARY}) |
| 48 | + endif() |
| 49 | +endforeach() |
| 50 | + |
| 51 | +get_filename_component(PYTHIA6_LIBRARY_DIR ${PYTHIA6_LIBRARY} PATH) |
| 52 | + |
| 53 | +# handle the QUIETLY and REQUIRED arguments and set PHOTOS_FOUND to TRUE if |
| 54 | +# all listed variables are TRUE |
| 55 | + |
| 56 | +include(FindPackageHandleStandardArgs) |
| 57 | +find_package_handle_standard_args(Pythia6 DEFAULT_MSG PYTHIA6_LIBRARY) |
| 58 | + |
| 59 | +mark_as_advanced(PYTHIA6_INCLUDE_DIR |
| 60 | + PYTHIA6_LIBRARY |
| 61 | + PYTHIA6_rootinterface_LIBRARY) |
0 commit comments