Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Merge pull request #2 from hegner/master
Browse files Browse the repository at this point in the history
add Herwig and Blackhat MC generators
  • Loading branch information
hegner committed Oct 29, 2015
2 parents 71e166f + f8ec6c3 commit 83fcc7c
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
35 changes: 35 additions & 0 deletions modules/FindBlackhat.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# - Locate Blackhat libraries
# Defines:
#
# BLACKHAT_FOUND
# BLACKHAT_INCLUDE_DIR
# BLACKHAT_LIBRARIES

find_path(BLACKHAT_INCLUDE_DIR blackhat/BH_interface.h
HINTS $ENV{BLACKHAT_ROOT_DIR}/include ${BLACKHAT_ROOT_DIR}/include)
find_path(BLACKHAT_BIN_DIR blackhat-config
HINTS $ENV{BLACKHAT_ROOT_DIR}/bin ${BLACKHAT_ROOT_DIR}/bin)

set(BLACKHAT_INCLUDE_DIRS ${BLACKHAT_INCLUDE_DIR})

#Compose library list from the output of blackhat-config:

execute_process(COMMAND ${BLACKHAT_BIN_DIR}/blackhat-config --libs OUTPUT_VARIABLE bliblist0)
string(REGEX MATCHALL "-l[A-Za-z0-9_-]+" bliblist0 "${bliblist0}")
list(REMOVE_ITEM bliblist0 "-lqd")
set(BLACKHAT_LIBRARIES "")
foreach(_c ${bliblist0})
string(REPLACE "-l" "" _c ${_c})
find_library(libi NAMES ${_c}
HINTS $ENV{BLACKHAT_ROOT_DIR}/lib/blackhat ${BLACKHAT_ROOT_DIR}/lib/blackhat)
list(APPEND BLACKHAT_LIBRARIES "${libi}")
unset(libi CACHE)
endforeach()
message(STATUS "blackhat libraries list for linking: ${BLACKHAT_LIBRARIES}")

# handle the QUIETLY and REQUIRED arguments and set BLACKHAT_FOUND to TRUE if
# all listed variables are TRUE

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Blackhat DEFAULT_MSG BLACKHAT_INCLUDE_DIR BLACKHAT_BIN_DIR BLACKHAT_LIBRARIES)
mark_as_advanced(BLACKHAT_FOUND BLACKHAT_INCLUDE_DIR BLACKHAT_BIN_DIR BLACKHAT_LIBRARIES)
35 changes: 35 additions & 0 deletions modules/FindHerwig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# - Locate herwig libraries and includes
# Defines:
#
# HERWIG_FOUND
# HERWIG_INCLUDE_DIR
# HERWIG_INCLUDE_DIRS (not cached)
# HERWIG_LIBRARY
# HERWIG_LIBRARY_DIR (not cached)
# HERWIG_LIBRARIES (not cached)


find_path(HERWIG_INCLUDE_DIR HERWIG65.INC
HINTS $ENV{HERWIG_ROOT_DIR}/include ${HERWIG_ROOT_DIR}/include)

find_library(HERWIG_LIBRARY NAMES herwig Herwig
HINTS $ENV{HERWIG_ROOT_DIR}/lib ${HERWIG_ROOT_DIR}/lib)

find_library(HERWIG_dummy_LIBRARY NAMES herwig_dummy Herwig_dummy
HINTS $ENV{HERWIG_ROOT_DIR}/lib ${HERWIG_ROOT_DIR}/lib)

find_library(HERWIG_pdfdummy_LIBRARY NAMES herwig_pdfdummy Herwig_pdfdummy
HINTS $ENV{HERWIG_ROOT_DIR}/lib ${HERWIG_ROOT_DIR}/lib)


set(HERWIG_INCLUDE_DIRS ${HERWIG_INCLUDE_DIR})
set(HERWIG_LIBRARIES ${HERWIG_LIBRARY} ${HERWIG_dummy_LIBRARY} ${HERWIG_pdfdummy_LIBRARY})
get_filename_component(HERWIG_LIBRARY_DIR ${HERWIG_LIBRARY} PATH)

# handle the QUIETLY and REQUIRED arguments and set HERWIG_FOUND to TRUE if
# all listed variables are TRUE

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Herwig DEFAULT_MSG HERWIG_INCLUDE_DIR HERWIG_LIBRARY HERWIG_dummy_LIBRARY HERWIG_pdfdummy_LIBRARY)

mark_as_advanced(HERWIG_FOUND HERWIG_INCLUDE_DIR HERWIG_LIBRARY HERWIG_dummy_LIBRARY HERWIG_pdfdummy_LIBRARY)

0 comments on commit 83fcc7c

Please sign in to comment.