Skip to content
Snippets Groups Projects
Commit cca8c59a authored by Michael Davis's avatar Michael Davis
Browse files

[xrd_ssi] Removes duplicate Find*.cmake files

parent 80bfebb7
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,7 @@ ELSE(DEFINED PackageOnly)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/xrootd-ssi-protobuf-interface/cmake)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include(GNUInstallDirs)
set(CMAKE_INSTALL_PREFIX "/")
......
# From, https://raw.githubusercontent.com/Kitware/CMake/master/Modules/FindProtobuf.cmake
# cut down to solve our problem and nothing more
#=============================================================================
# Copyright 2009 Kitware, Inc.
# Copyright 2009-2011 Philip Lowman <philip@yhbt.com>
# Copyright 2008 Esben Mose Hansen, Ange Optimization ApS
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
set(PROTOBUF3_RPATH /usr/lib64/protobuf3)
message(STATUS "PROTOBUF3_RPATH=${PROTOBUF3_RPATH}")
find_program(PROTOBUF3_PROTOC3_EXECUTABLE
NAMES protoc3
DOC "Version 3 of The Google Protocol Buffers Compiler"
)
message(STATUS "protoc3 is at ${PROTOBUF3_PROTOC3_EXECUTABLE} ")
find_path(PROTOBUF3_INCLUDE_DIRS
google/protobuf/message.h
PATHS /usr/include/protobuf3
NO_DEFAULT_PATH)
message(STATUS "PROTOBUF3_INCLUDE_DIRS=${PROTOBUF3_INCLUDE_DIRS}")
find_library(PROTOBUF3_LIBRARIES
NAME protobuf
PATHS ${PROTOBUF3_RPATH}
NO_DEFAULT_PATH)
message(STATUS "PROTOBUF3_LIBRARIES=${PROTOBUF3_LIBRARIES}")
function(PROTOBUF3_GENERATE_CPP SRCS HDRS)
if(NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF3_GENERATE_CPP() called without any proto files")
return()
endif()
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
set(${SRCS})
set(${HDRS})
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
COMMAND ${PROTOBUF3_PROTOC3_EXECUTABLE}
ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
DEPENDS ${ABS_FIL}
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
VERBATIM )
endforeach()
set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
set(${SRCS} ${${SRCS}} PARENT_SCOPE)
set(${HDRS} ${${HDRS}} PARENT_SCOPE)
endfunction()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Protobuf3 DEFAULT_MSG
PROTOBUF3_INCLUDE_DIRS PROTOBUF3_LIBRARIES PROTOBUF3_RPATH)
# - Find xroot
# Finds the header files of xrootd-devel by searching for XrdVersion.hh
# Finds the header files of xrootd-private-devel by searching for XrdOssApi.hh
#
# XROOTD_FOUND - true if xrootd has been found
# XROOTD_INCLUDE_DIR - location of the xrootd-devel header files
# XROOTD_PRIVATE_INCLUDE_DIR - location of the private xrootd files, in other
# words the header files that do not contribute to
# the xrootd ABI.
# XROOTD_XRDCL_LIB - location of the XrdCl library
# XROOTD_XRDCLIENT_LIB - location of the XrdClient library
# XROOTD_XRDSERVER_LIB - location of the XrdServer library
# XROOTD_XRDUTILS_LIB - location of the XrdUtils library
# XROOTD_XRDPOSIX_LIB - location of the XrdPosix library
# Be silent if XROOTD_INCLUDE_DIR is already cached
if (XROOTD_INCLUDE_DIR)
set(XROOTD_FIND_QUIETLY TRUE)
endif (XROOTD_INCLUDE_DIR)
find_path (XROOTD_INCLUDE_DIR XrdVersion.hh
PATH_SUFFIXES include/xrootd
)
find_path (XROOTD_PRIVATE_INCLUDE_DIR XrdOss/XrdOssApi.hh
PATH_SUFFIXES include/xrootd/private
)
find_library (XROOTD_XRDCL_LIB XrdCl)
find_library (XROOTD_XRDCLIENT_LIB XrdClient)
find_library (XROOTD_XRDSERVER_LIB XrdServer)
find_library (XROOTD_XRDUTILS_LIB XrdUtils)
find_library (XROOTD_XRDPOSIX_LIB XrdPosixPreload)
message (STATUS "XROOTD_INCLUDE_DIR = ${XROOTD_INCLUDE_DIR}")
message (STATUS "XROOTD_PRIVATE_INCLUDE_DIR = ${XROOTD_PRIVATE_INCLUDE_DIR}")
message (STATUS "XROOTD_XRDCL_LIB = ${XROOTD_XRDCL_LIB}")
message (STATUS "XROOTD_XRDCLIENT_LIB = ${XROOTD_XRDCLIENT_LIB}")
message (STATUS "XROOTD_XRDSERVER_LIB = ${XROOTD_XRDSERVER_LIB}")
message (STATUS "XROOTD_XRDPOSIX_LIB = ${XROOTD_XRDPOSIX_LIB}")
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (xrootd DEFAULT_MSG
XROOTD_INCLUDE_DIR
XROOTD_PRIVATE_INCLUDE_DIR
XROOTD_XRDCL_LIB
XROOTD_XRDCLIENT_LIB
XROOTD_XRDSERVER_LIB
XROOTD_XRDUTILS_LIB
XROOTD_XRDPOSIX_LIB)
\ No newline at end of file
# - Find xrootclient
# Finds the header files of xrootd-devel by searching for XrdVersion.hh
#
# XROOTD_FOUND - true if xrootd has been found
# XROOTD_INCLUDE_DIR - location of the xrootd-devel header files
# words the header files that do not contribute to
# the xrootd ABI.
# XROOTD_XRDCL_LIB - location of the XrdCl library
# XROOTD_XRDCLIENT_LIB - location of the XrdClient library
# Be silent if XROOTD_INCLUDE_DIR is already cached
if (XROOTD_INCLUDE_DIR)
set(XROOTD_FIND_QUIETLY TRUE)
endif (XROOTD_INCLUDE_DIR)
find_path (XROOTD_INCLUDE_DIR XrdVersion.hh
PATH_SUFFIXES include/xrootd
)
find_library (XROOTD_XRDCL_LIB XrdCl)
find_library (XROOTD_XRDCLIENT_LIB XrdClient)
message (STATUS "XROOTD_INCLUDE_DIR = ${XROOTD_INCLUDE_DIR}")
message (STATUS "XROOTD_XRDCL_LIB = ${XROOTD_XRDCL_LIB}")
message (STATUS "XROOTD_XRDCLIENT_LIB = ${XROOTD_XRDCLIENT_LIB}")
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (xrootd DEFAULT_MSG
XROOTD_INCLUDE_DIR
XROOTD_XRDCL_LIB
XROOTD_XRDCLIENT_LIB)
......@@ -16,10 +16,10 @@
cmake_minimum_required (VERSION 2.6)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(xrootdclient REQUIRED)
find_package(xrootd REQUIRED)
find_package(Protobuf3 REQUIRED)
# Cryptopp can be dropped when we get rid of eoscta_stub
find_package(cryptopp REQUIRED)
#
......@@ -38,7 +38,7 @@ include_directories(${CMAKE_SOURCE_DIR}/${XRD_SSI_PB_DIR}/include ${CMAKE_SOURCE
include_directories(${CMAKE_BINARY_DIR}/${XRD_SSI_PB_DIR}/eos_cta/protobuf ${PROTOBUF3_INCLUDE_DIRS})
#
# eosctastub is a drop-in replacement for "cta archive|retrieve|delete"
# eoscta_stub is a drop-in replacement for "cta archive|retrieve|delete"
#
add_executable(eoscta_stub EosCtaStub.cpp Configuration.cpp)
target_link_libraries(eoscta_stub cryptopp ctacommon XrdSsiPbEosCta XrdSsi-4 XrdSsiLib)
......@@ -57,8 +57,6 @@ set_property (TARGET cta-admin APPEND PROPERTY INSTALL_RPATH ${PROTOBUF3_RPATH})
#target_compile_definitions(cta-admin PUBLIC XRDSSI_DEBUG)
install(TARGETS cta-admin DESTINATION usr/bin)
#include_directories(${CMAKE_SOURCE_DIR}/tapeserver)
#include_directories(${XROOTD_INCLUDE_DIR} ${CMAKE_SOURCE_DIR})
add_executable(cta.deprecated CTACmdMain.cpp Configuration.cpp)
target_link_libraries(cta.deprecated ${XROOTD_XRDCL_LIB} cryptopp)
install(TARGETS cta.deprecated DESTINATION usr/bin)
......
......@@ -16,7 +16,6 @@
cmake_minimum_required (VERSION 2.6)
list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(xrootd REQUIRED)
find_package(Protobuf3 REQUIRED)
......
Subproject commit 8d93bc4b3a2abdd7e44a7e7ab6c808154db5d402
Subproject commit d0edce3d03d584b2a52c577aa4fc681c69d2fe4c
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