Warning, /geant4/cmake/Modules/FindPythia6.cmake is written in an unsupported language. File is not indexed.
0001 #[=======================================================================[.rst:
0002 FindPythia6
0003 ---------
0004
0005 Find the Pythia6 event generator library.
0006
0007 Imported Targets
0008 ^^^^^^^^^^^^^^^^
0009
0010 This module defines the following :prop_tgt:`IMPORTED` targets:
0011
0012 ``Pythia6::Pythia6``
0013 The Pythia6 ``pythia6`` library, if found.
0014
0015 Result Variables
0016 ^^^^^^^^^^^^^^^^
0017
0018 This module will set the following variables in your project:
0019
0020 ``Pythia6_FOUND``
0021 true if the Pythia6 headers and libraries were found.
0022
0023 Hints
0024 ^^^^^
0025
0026 A user may set ``Pythia6_ROOT`` to a Pythia6 installation root to tell this
0027 module where to look.
0028
0029 #]=======================================================================]
0030
0031 # WE DO NOT ALLOW USE OF THIS MODULE OUTSIDE GEANT4 AND EXAMPLES
0032 if(NOT PROJECT_NAME MATCHES "Geant4|HepMCEx0[1-2]|decayer6")
0033 message(FATAL_ERROR "This FindPythia6.cmake module is only supported for use in Geant4's HepMCEx0{1,2} "
0034 "and decayer6 extended examples. No support or extension of this module for use outside of these examples "
0035 "will be provided.")
0036 endif()
0037
0038 find_library(Pythia6_LIBRARY
0039 NAMES Pythia6 pythia6 pythia6-$ENV{PYTHIA6_VERSION}
0040 HINTS $ENV{PYTHIA6} $ENV{PYTHIA6}/lib $ENV{PYTHIA6}/lib64 ${Pythia6_ROOT}/lib ${Pythia6_ROOT}/lib64)
0041
0042 # handle the QUIETLY and REQUIRED arguments and set Pythia6_FOUND to TRUE if
0043 # all listed variables are TRUE
0044 include(FindPackageHandleStandardArgs)
0045 find_package_handle_standard_args(Pythia6 DEFAULT_MSG Pythia6_LIBRARY)
0046
0047 mark_as_advanced(Pythia6_LIBRARY)
0048
0049 if(Pythia6_FOUND)
0050 set(Pythia6_LIBRARIES ${Pythia6_LIBRARY})
0051 if(NOT TARGET Pythia6::Pythia6)
0052 add_library(Pythia6::Pythia6 UNKNOWN IMPORTED)
0053 set_target_properties(Pythia6::Pythia6 PROPERTIES
0054 IMPORTED_LOCATION ${Pythia6_LIBRARY})
0055 endif()
0056 endif()