IAP GITLAB

Commit 2b153304 authored by Ralf Ulrich's avatar Ralf Ulrich

added cmake find scripts

git-svn-id: https://devel-ik.fzk.de/svn/mc/crmc/trunk@6975 c7a5e08c-de06-0410-9364-b41cf42a0b17
parent 945da36d
##################################################################
# This module tries to find the Fastjet installation on your system.
# Usage:
# FIND_PACKAGE( fastjet [REQUIRED] [COMPONENTS ...] )
#
# It sets the following variables:
# ${FASTJET_FOUND}
# ${Fastjet_INCLUDE_DIRS}
# ${Fastjet_LIBRARY_DIRS}
# ${Fastjet_LIBRARIES}
#
##################################################################
MESSAGE(STATUS "Looking for fastjet...")
## try to find each Fastjet components in user defined path
FOREACH (COMPONENT ${Fastjet_FIND_COMPONENTS})
FIND_LIBRARY(${COMPONENT}_PATH
NAMES
${COMPONENT}
PATHS
/usr
/usr/local
${FASTJET_PREFIX}
${FASTJET_ROOT}
${FASTJET_ROOT_DIR}
${HEP_ROOT}
$ENV{FASTJET_PREFIX}
$ENV{FASTJET_ROOT}
$ENV{FASTJET_ROOT_DIR}
$ENV{HEP_ROOT}
PATH_SUFFIXES
lib
lib64
)
# set found flag
IF ({${${COMPONENT}_PATH} MATCHES "${COMPONENT}_PATH-NOTFOUND")
SET(FASTJET_FOUND FALSE)
ELSE ({${${COMPONENT}_PATH} MATCHES "${COMPONENT}_PATH-NOTFOUND")
MESSAGE (STATUS "Fastjet ${COMPONENT} library path found: ${${COMPONENT}_PATH}")
ENDIF ({${${COMPONENT}_PATH} MATCHES "${COMPONENT}_PATH-NOTFOUND")
ENDFOREACH (COMPONENT Fastjet_FIND_COMPONENTS)
## search for include path
FIND_PATH(Fastjet_INCLUDE_DIRS
NAMES
fastjet/PseudoJetStructureBase.hh
PATHS
/usr
/usr/local
${FASTJET_PREFIX}
${FASTJET_ROOT}
${FASTJET_ROOT_DIR}
${HEP_ROOT}
$ENV{FASTJET_PREFIX}
$ENV{FASTJET_ROOT}
$ENV{FASTJET_ROOT_DIR}
$ENV{HEP_ROOT}
# PATH_SUFFIXES
# include
)
# set found flag
IF (${Fastjet_INCLUDE_DIRS} MATCHES "Fastjet_INCLUDE_DIRS-NOTFOUND")
SET(FASTJET_FOUND FALSE)
ELSE (${Fastjet_INCLUDE_DIRS} MATCHES "Fastjet_INCLUDE_DIRS-NOTFOUND")
MESSAGE(STATUS "Fastjet include path found: " ${Fastjet_INCLUDE_DIRS} )
ENDIF (${Fastjet_INCLUDE_DIRS} MATCHES "Fastjet_INCLUDE_DIRS-NOTFOUND")
## final printout
# if not found
IF(${FASTJET_FOUND} MATCHES "FALSE")
IF (Fastjet_FIND_REQUIRED)
MESSAGE( FATAL_ERROR
"Fastjet shared library or includes not found\n"
"Please install Fastjet and/or set FASTJET_PREFIX environment\n"
)
ELSE (Fastjet_FIND_REQUIRED)
MESSAGE( WARNING
"Fastjet shared library or includes not found\n"
"Please install Fastjet and/or set FASTJET_PREFIX environment\n"
)
ENDIF (Fastjet_FIND_REQUIRED)
# end if not found
# if found :
ELSE(${FASTJET_FOUND} MATCHES "FALSE")
SET(FASTJET_FOUND TRUE)
#set Fastjet_LIBRARIES
FOREACH(COMPONENT ${Fastjet_FIND_COMPONENTS})
list(APPEND Fastjet_LIBRARIES ${${COMPONENT}_PATH})
ENDFOREACH(COMPONENT ${Fastjet_FIND_COMPONENTS})
ENDIF(${FASTJET_FOUND} MATCHES "FALSE")
# - Try to find Rivet
# Defines:
#
# RIVET_FOUND
# RIVET_CXXFLAGS
# RIVET_LDFLAGS
# RIVET_INCLUDE_DIR
# RIVET_INCLUDE_DIRS (not cached)
# RIVET_LIBRARY
# RIVET_LIBRARIES (not cached)
# RIVET_LIBRARY_DIRS (not cached)
find_library(RIVET_LIBRARY NAMES Rivet)
# the following disables all default paths (either from cmake, from environment)
FIND_PATH (RIVET_DIR rivet-config)
if (RIVET_DIR)
EXECUTE_PROCESS (COMMAND ${RIVET_DIR}/rivet-config --version
OUTPUT_VARIABLE RIVET_VERSION
)
# STRING (REGEX REPLACE "[ \t\r\n]+" "" ROOT_VERSION "${ROOT_VERSION}")
# STRING (REGEX REPLACE "/" "." ROOT_VERSION "${ROOT_VERSION}")
EXECUTE_PROCESS (COMMAND ${RIVET_DIR}/rivet-config --includedir
OUTPUT_VARIABLE RIVET_INCLUDE_DIR
)
EXECUTE_PROCESS (COMMAND ${RIVET_DIR}/rivet-config --cppflags
OUTPUT_VARIABLE RIVET_CXXFLAGS
)
EXECUTE_PROCESS (COMMAND ${RIVET_DIR}/rivet-config --ldflags
OUTPUT_VARIABLE RIVET_LDFLAGS
)
EXECUTE_PROCESS (COMMAND ${RIVET_DIR}/rivet-config --libs
OUTPUT_VARIABLE RIVET_LIBS
)
#set(RIVET_LIBRARIES ${RIVET_LIBRARY})
# mark_as_advanced(Rivet_FOUND)
SET(Rivet_FOUND TRUE)
MESSAGE (STATUS
"Compatible version of Rivet found: " ${RIVET_VERSION} " at " ${RIVET_DIR})
endif(RIVET_DIR)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment