Skip to content
Snippets Groups Projects
Commit cb75dbe4 authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: add FindHepMC.cmake.

parent 68d425f1
No related branches found
No related tags found
No related merge requests found
# - Locate HepMC library
# Defines:
#
# HEPMC_FOUND
# HEPMC_INCLUDE_DIR
# HEPMC_INCLUDE_DIRS (not cached)
# HEPMC_<component>_LIBRARY
# HEPMC_LIBRARIES (not cached)
# HEPMC_LIBRARY_DIRS (not cached)
find_path(HEPMC_INCLUDE_DIR HepMC/GenEvent.h
HINTS ${HEPMC_ROOT_DIR}/include $ENV{HEPMC_ROOT_DIR}/include)
set(HEPMC_INCLUDE_DIRS ${HEPMC_INCLUDE_DIR})
if(NOT HepMC_FIND_COMPONENTS)
set(HepMC_FIND_COMPONENTS HepMC)
endif()
foreach(component ${HepMC_FIND_COMPONENTS})
find_library(HEPMC_${component}_LIBRARY
NAMES HepMC${component} ${component}
HINTS ${HEPMC_ROOT_DIR}/lib $ENV{HEPMC_ROOT_DIR}/lib)
mark_as_advanced(HEPMC_${component}_LIBRARY)
list(APPEND HEPMC_LIBRARIES ${HEPMC_${component}_LIBRARY})
get_filename_component(_comp_dir ${HEPMC_${component}_LIBRARY} PATH)
list(APPEND HEPMC_LIBRARY_DIRS ${_comp_dir})
endforeach()
if(HEPMC_LIBRARY_DIRS)
list(REMOVE_DUPLICATES HEPMC_LIBRARY_DIRS)
endif()
# handle the QUIETLY and REQUIRED arguments and set HEPMC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HepMC DEFAULT_MSG HEPMC_INCLUDE_DIR HEPMC_LIBRARIES)
mark_as_advanced(HEPMC_FOUND HEPMC_INCLUDE_DIR)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment