Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/cmake/FindPythia8.cmake is written in an unsupported language. File is not indexed.

0001 # Find the Pythia8 includes and libraries.
0002 #
0003 # This module defines the `Pythia8` imported target that encodes all
0004 # necessary information in its target properties.
0005 
0006 find_library(
0007     Pythia8_LIBRARY
0008     NAMES Pythia8 pythia8
0009     HINTS
0010     ENV PYTHIA8_DIR
0011     PYTHIA8
0012     PATHS /opt/pythia8 /usr/local
0013     DOC "The Pythia8 library"
0014 )
0015 find_path(
0016     Pythia8_INCLUDE_DIR
0017     NAMES Pythia8/Pythia.h
0018     HINTS
0019     ENV PYTHIA8_DIR
0020     PYTHIA8
0021     PATHS /opt/pythia8 /usr/local
0022     DOC "The Pythia8 include directory"
0023 )
0024 
0025 file(READ "${Pythia8_INCLUDE_DIR}/Pythia8/Pythia.h" Pythia8_VERSION_FILE)
0026 string(
0027     REGEX MATCH "#define PYTHIA_VERSION (8\.[0-9]+)"
0028     _
0029     ${Pythia8_VERSION_FILE}
0030 )
0031 set(Pythia8_VERSION ${CMAKE_MATCH_1})
0032 
0033 find_package_handle_standard_args(
0034     Pythia8
0035     REQUIRED_VARS Pythia8_LIBRARY Pythia8_INCLUDE_DIR
0036     VERSION_VAR Pythia8_VERSION
0037 )
0038 
0039 if(NOT TARGET Pythia8::Pythia8)
0040     add_library(Pythia8 SHARED IMPORTED)
0041     set_property(TARGET Pythia8 PROPERTY IMPORTED_LOCATION ${Pythia8_LIBRARY})
0042     set_property(
0043         TARGET Pythia8
0044         PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Pythia8_INCLUDE_DIR}
0045     )
0046 
0047     add_library(Pythia8::Pythia8 ALIAS Pythia8)
0048 endif()
0049 
0050 mark_as_advanced(Pythia8_FOUND Pythia8_INCLUDE_DIR Pythia8_LIBRARY)