From bed02956c0b55a264fbf5812a4b4138ee7061812 Mon Sep 17 00:00:00 2001 From: Andreas Loeschcke Centeno Date: Wed, 16 Oct 2024 17:36:02 +0100 Subject: [PATCH] Updated CMakeLists file to allow to set xrootd include directory --- user/xrootd/module/CMakeLists.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/user/xrootd/module/CMakeLists.txt b/user/xrootd/module/CMakeLists.txt index 809c24021..99ac928ad 100644 --- a/user/xrootd/module/CMakeLists.txt +++ b/user/xrootd/module/CMakeLists.txt @@ -4,23 +4,21 @@ find_library(XRDCL_LIB XrdCl) # If XRootD is not found, allow the user to specify the directory manually if (NOT XROOTD_INCLUDE_DIR OR NOT XRDCL_LIB) - message(WARNING "XRootD not found automatically. Please specify the XRootD directory using -DXROOTD_DIRECTORY=.") + message(WARNING "XRootD not found automatically. Make sure to specify the XRootD directory using -DXROOTD_DIRECTORY=/path/to/xrootd/include/") - option(XROOTD_DIRECTORY "Path to the XRootD installation" "") + set(XROOTD_DIRECTORY "" CACHE PATH "Path to the XRootD installation include directory") if (XROOTD_DIRECTORY) # Set include and library paths from the user-defined option - set(XROOTD_INCLUDE_DIR ${XROOTD_DIRECTORY}) + set(XROOTD_INCLUDE_DIR ${XROOTD_DIRECTORY}/xrootd/) find_library(XRDCL_LIB XrdCl REQUIRED PATHS ${XROOTD_LIBRARY_DIR}) if (NOT EXISTS ${XROOTD_INCLUDE_DIR}/XrdCl/XrdClFile.hh) message(FATAL_ERROR "Invalid XRootD directory: Header file not found in ${XROOTD_INCLUDE_DIR}.") endif() - else() - message(FATAL_ERROR "XRootD not found and no directory specified. Please set -DXROOTD_DIRECTORY=.") endif() else() - message(STATUS "XRootD found automatically.") + message(STATUS "XRootD found") endif() # Add include directory and link library