# FindXROOTD # -------- # # Find the XROOTD includes (header) # # IMPORTED Targets # ^^^^^^^^^^^^^^^^ # # This module defines no target as root links automatically against xrootd already! # The only purpose of this script is to know if we have build an external xrootd and where to find it. # # Result Variables # ^^^^^^^^^^^^^^^^ # # This module defines the following variables: # # :: # # XROOTD_FOUND - True if xrootd found. # # :: # # XROOTD_VERSION_STRING - The version of xrootd found (x.y.z) # XROOTD_VERSION_WORLD - The world version of xrootd # XROOTD_VERSION_MAJOR - The major version of xrootd # XROOTD_VERSION_MINOR - The minor version of xrootd # # Hints # ^^^^^ # # A user may set ``XROOTD_ROOT`` to a xrootd installation root to tell this # module where to look. # # manager COMET Software Group # author andreas.jansen@tu-dresden.de set(_XROOTD_SEARCHES) # Search XROOTD_ROOT first if it is set. if(XROOTD_ROOT) set(_XROOTD_SEARCH_ROOT PATHS ${XROOTD_ROOT} NO_DEFAULT_PATH) list(APPEND _XROOTD_SEARCHES _XROOTD_SEARCH_ROOT) endif() # Normal search. set(_XROOTD_SEARCH_NORMAL PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\xrootd;InstallPath]" "$ENV{PROGRAMFILES}/xrootd" ) list(APPEND _XROOTD_SEARCHES _XROOTD_SEARCH_NORMAL) # Try each search configuration. foreach(search ${_XROOTD_SEARCHES}) find_path(XROOTD_INCLUDE_DIR NAMES XrdVersion.hh ${${search}} PATH_SUFFIXES include include/xrootd) endforeach() # get version and set corrosponding variables if(XROOTD_INCLUDE_DIR AND EXISTS "${XROOTD_INCLUDE_DIR}/XrdVersion.hh" ) file(STRINGS "${XROOTD_INCLUDE_DIR}/XrdVersion.hh" XROOTD_VERSION_H REGEX "^#define[ \t]+XrdVERSION[ \t]+\"[^\"]+\".*$" ) string(REGEX REPLACE "^.*XrdVERSION[ \t]+\"v([0-9]+).*$" "\\1" XROOTD_VERSION_MAJOR "${XROOTD_VERSION_H}") string(REGEX REPLACE "^.*XrdVERSION[ \t]+\"v[0-9]+\\.([0-9]+).*$" "\\1" XROOTD_VERSION_MINOR "${XROOTD_VERSION_H}") string(REGEX REPLACE "^.*XrdVERSION[ \t]+\"v[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" XROOTD_VERSION_PATCH "${XROOTD_VERSION_H}") set(XROOTD_VERSION_STRING "${XROOTD_VERSION_MAJOR}.${XROOTD_VERSION_MINOR}.${XROOTD_VERSION_PATCH}") set(XROOTD_MAJOR_VERSION "${XROOTD_VERSION_MAJOR}") set(XROOTD_MINOR_VERSION "${XROOTD_VERSION_MINOR}") set(XROOTD_PATCH_VERSION "${XROOTD_VERSION_PATCH}") endif() # handle the QUIETLY and REQUIRED arguments and set XROOTD_FOUND to TRUE if # all listed variables are TRUE include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(XROOTD REQUIRED_VARS XROOTD_INCLUDE_DIR VERSION_VAR XROOTD_VERSION_STRING)