Commit 2f9952da authored by Steven Murray's avatar Steven Murray
Browse files

Moved to protocol buffer rpms built by koji

parent caef663a
......@@ -15,15 +15,27 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
find_program(PROTOBUF_PROTOC_EXECUTABLE
NAMES protoc
DOC "The Google Protocol Buffers Compiler"
find_program(PROTOBUF3_PROTOC3_EXECUTABLE
NAMES protoc3
DOC "Version 3 of The Google Protocol Buffers Compiler"
)
message(STATUS "protoc3 is at ${PROTOBUF3_PROTOC3_EXECUTABLE} ")
message(STATUS "protoc is at ${PROTOBUF_PROTOC_EXECUTABLE} ")
function(PROTOBUF_GENERATE_CPP SRCS HDRS)
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 /usr/lib64/protobuf3
NO_DEFAULT_PATH)
message(STATUS "PROTOBUF3_LIBRARIES=${PROTOBUF3_LIBRARIES}")
function(PROTOBUF3_GENERATE_CPP SRCS HDRS)
if(NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files")
message(SEND_ERROR "Error: PROTOBUF3_GENERATE_CPP() called without any proto files")
return()
endif()
......@@ -41,7 +53,7 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
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}"
......@@ -51,4 +63,8 @@ function(PROTOBUF_GENERATE_CPP SRCS HDRS)
set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
set(${SRCS} ${${SRCS}} PARENT_SCOPE)
set(${HDRS} ${${HDRS}} PARENT_SCOPE)
endfunction()
\ No newline at end of file
endfunction()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Protobuf3 DEFAULT_MSG
PROTOBUF3_INCLUDE_DIRS PROTOBUF3_LIBRARIES)
......@@ -42,7 +42,7 @@ BuildRequires: xrootd-devel = 1:4.4.1
BuildRequires: xrootd-server-devel = 1:4.4.1
BuildRequires: xrootd-private-devel = 1:4.4.1
BuildRequires: librados-devel >= 11.0, libradosstriper-devel >= 11.0,
BuildRequires: protobuf3-compiler = 3.2.0 protobuf3-devel = 3.2.0
BuildRequires: protobuf3-compiler >= 3.3.1 protobuf3-devel >= 3.3.1
BuildRequires: gmock-devel >= 1.5.0 gtest-devel >= 1.5.0
BuildRequires: sqlite-devel >= 3.6
BuildRequires: libcap-devel >= 2.16
......
......@@ -15,14 +15,17 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required (VERSION 2.6)
find_package(Protobuf REQUIRED)
find_package(Protobuf3 REQUIRED)
file(GLOB ProtoFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.proto")
PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
PROTOBUF3_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
foreach(PROTO_SRC ${ProtoSources})
set_property(SOURCE ${PROTO_SRC} PROPERTY COMPILE_FLAGS " -Wno-missing-field-initializers")
endforeach(PROTO_SRC)
set (CTA_FRONT_END_MESSAGES_SRC_FILES ${ProtoSources})
include_directories(${PROTOBUF3_INCLUDE_DIRS})
add_library (ctaeosmessages ${CTA_FRONT_END_MESSAGES_SRC_FILES})
target_link_libraries (ctaeosmessages
protobuf)
${PROTOBUF3_LIBRARIES})
......@@ -16,11 +16,11 @@
cmake_minimum_required (VERSION 2.6)
find_package(openssl REQUIRED)
find_package(Protobuf REQUIRED)
find_package(Protobuf3 REQUIRED)
find_package(zeromq REQUIRED)
file(GLOB ProtoFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.proto")
PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
PROTOBUF3_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
set (MEDIACHANGER_LIB_SRC_FILES
AcsLibrarySlot.cpp
......@@ -52,12 +52,13 @@ set (MEDIACHANGER_LIB_SRC_FILES
ZmqMsg.cpp
ZmqSocket.cpp)
include_directories (${PROTOBUF3_INCLUDE_DIRS})
add_library (ctamediachanger SHARED
${MEDIACHANGER_LIB_SRC_FILES})
target_link_libraries (ctamediachanger
ctacommon
protobuf
${PROTOBUF3_LIBRARIES}
ssl
zmq)
......
......@@ -22,12 +22,12 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../middletier)
find_package(json-c REQUIRED)
find_package(librados2 REQUIRED)
find_package(Protobuf REQUIRED)
find_package(Protobuf3 REQUIRED)
set (CTAProtoFiles
cta.proto)
PROTOBUF_GENERATE_CPP(CTAProtoSources CTAProtoHeaders ${CTAProtoFiles})
PROTOBUF3_GENERATE_CPP(CTAProtoSources CTAProtoHeaders ${CTAProtoFiles})
set (CTAProtoDependants objectstore/Agent.hpp
objectstore/ArchiveRequest.hpp
......@@ -46,7 +46,7 @@ SET_SOURCE_FILES_PROPERTIES(${CTAProtoHeaders} PROPERTIES HEADER_FILE_ONLY TRUE)
SET_SOURCE_FILES_PROPERTIES(${CTAProtoDependants}
PROPERTIES OBJECT_DEPENDS ${CTAProtoHeaders})
include_directories (${PROTOBUF3_INCLUDE_DIRS})
add_library (ctaobjectstore SHARED
${CTAProtoSources}
RootEntry.cpp
......@@ -83,24 +83,24 @@ set(ObjectStoreUnitTests
add_library(ctaobjectstoreunittests SHARED ${ObjectStoreUnitTests})
target_link_libraries(ctaobjectstoreunittests
protobuf rados ctacommon gtest ctaobjectstore)
${PROTOBUF3_LIBRARIES} rados ctacommon gtest ctaobjectstore)
install(TARGETS ctaobjectstoreunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
add_executable(cta-objectstore-initialize cta-objectstore-initialize.cpp)
target_link_libraries(cta-objectstore-initialize
protobuf ctaobjectstore ctacommon ctautils)
${PROTOBUF3_LIBRARIES} ctaobjectstore ctacommon ctautils)
add_executable(cta-objectstore-list cta-objectstore-list.cpp)
target_link_libraries(cta-objectstore-list
protobuf ctaobjectstore ctacommon)
${PROTOBUF3_LIBRARIES} ctaobjectstore ctacommon)
add_executable(cta-objectstore-dump-object cta-objectstore-dump-object.cpp)
target_link_libraries(cta-objectstore-dump-object
protobuf ctaobjectstore ctacommon)
${PROTOBUF3_LIBRARIES} ctaobjectstore ctacommon)
add_executable(cta-objectstore-unfollow-agent cta-objectstore-unfollow-agent.cpp)
target_link_libraries(cta-objectstore-unfollow-agent
protobuf ctaobjectstore ctacommon)
${PROTOBUF3_LIBRARIES} ctaobjectstore ctacommon)
install(TARGETS cta-objectstore-initialize cta-objectstore-list cta-objectstore-dump-object
DESTINATION usr/bin)
......@@ -21,11 +21,13 @@ set (CTA_SCHEDULER_SRC_FILES
OStoreDB/OStoreDBWithAgent.cpp
LabelMount.cpp)
find_package(Protobuf3 REQUIRED)
include_directories (${PROTOBUF3_INCLUDE_DIRS})
add_library (ctascheduler SHARED
${CTA_SCHEDULER_SRC_FILES})
install (TARGETS ctascheduler DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
target_link_libraries (ctascheduler ctacommon ctaobjectstore protobuf ctautils ctaeos)
target_link_libraries (ctascheduler ctacommon ctaobjectstore ${PROTOBUF3_LIBRARIES} ctautils ctaeos)
#add_library (ctaschedulerutils SHARED
# _old_prototype_DummyScheduler.cpp)
......
......@@ -10,8 +10,9 @@ add_subdirectory (session)
# from the previous one to create a single library).
add_executable (cta-taped cta-taped.cpp)
find_package(Protobuf3 REQUIRED)
target_link_libraries(cta-taped
ctatapedaemon ctacommon protobuf)
ctatapedaemon ctacommon ${PROTOBUF3_LIBRARIES})
install (TARGETS cta-taped DESTINATION usr/bin)
install (FILES TPCONFIG.example DESTINATION /etc/cta)
install (FILES cta-taped.1cta DESTINATION /usr/share/man/man1)
......
......@@ -21,12 +21,13 @@ include_directories(${PROJECT_SOURCE_DIR}/tapeserver)
include_directories(${PROJECT_BINARY_DIR}/tapeserver)
find_package(openssl REQUIRED)
find_package(Protobuf REQUIRED)
find_package(Protobuf3 REQUIRED)
find_package(zeromq REQUIRED)
file(GLOB ProtoFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.proto")
PROTOBUF_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
PROTOBUF3_GENERATE_CPP(ProtoSources ProtoHeaders ${ProtoFiles})
include_directories (${PROTOBUF3_INCLUDE_DIRS})
add_library(ctamessagesprotobuf
${ProtoSources})
......@@ -52,5 +53,5 @@ target_link_libraries(ctamessages
ctamediachanger
ctautils
ctatapesession
protobuf
${PROTOBUF3_LIBRARIES}
ssl)
......@@ -26,7 +26,7 @@ include_directories(${PROJECT_BINARY_DIR}/tapeserver)
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${PROJECT_BINARY_DIR})
find_package(Protobuf REQUIRED)
find_package(Protobuf3 REQUIRED)
find_package( ZLIB REQUIRED )
set(CTATAPESERVERDAEMON_LIBRARY_SRCS
......@@ -76,9 +76,10 @@ endif(CMAKE_COMPILER_IS_GNUCC)
add_library(ctaTapeServerDaemon
${CTATAPESERVERDAEMON_LIBRARY_SRCS})
target_link_libraries(ctaTapeServerDaemon ctamessages ctacommon protobuf ctascheduler ctalegacymsg ctacatalogue TapeDrive)
target_link_libraries(ctaTapeServerDaemon ctamessages ctacommon ${PROTOBUF3_LIBRARIES} ctascheduler ctalegacymsg ctacatalogue TapeDrive)
add_dependencies(ctaTapeServerDaemon ctamessagesprotobuf)
include_directories(${PROTOBUF3_INCLUDE_DIRS})
add_library(ctatapeserverdaemonunittests SHARED
DataTransferSessionTest.cpp
DiskReadTaskTest.cpp
......
cmake_minimum_required (VERSION 2.6)
find_package(Protobuf REQUIRED)
find_package(Protobuf3 REQUIRED)
include_directories(${PROJECT_BINARY_DIR}/tapeserver)
PROTOBUF_GENERATE_CPP(WDMsgSources WDMsgHeaders WatchdogMessage.proto)
PROTOBUF3_GENERATE_CPP(WDMsgSources WDMsgHeaders WatchdogMessage.proto)
SET_SOURCE_FILES_PROPERTIES(${WDMsgHeaders} PROPERTIES HEADER_FILE_ONLY TRUE)
SET_SOURCE_FILES_PROPERTIES(DriveHandler.cpp PROPERTIES OBJECT_DEPENDS ${WDMsgHeaders})
include_directories(${PROTOBUF3_INCLUDE_DIRS})
add_library(ctatapedaemon
${WDMsgSources}
CommandLineParams.cpp
......
......@@ -56,13 +56,15 @@ add_executable(cta-unitTests-multiProcess
unit_tests.cpp
${GMOCK_SRC})
find_package(Protobuf3 REQUIRED)
target_link_libraries(cta-unitTests-multiProcess
ctadaemonunittests-multiprocess
ctacommon
${GMOCK_LIB}
gtest
pthread
protobuf
${PROTOBUF3_LIBRAIRES}
sqlite3)
add_library(unitTestHelper
......
......@@ -22,8 +22,10 @@ include_directories(${XROOTD_INCLUDE_DIR} ${XROOTD_PRIVATE_INCLUDE_DIR})
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/tapeserver)
find_package(Protobuf3 REQUIRED)
include_directories(${PROTOBUF3_INCLUDE_DIRS})
add_library (XrdCtaOfs MODULE XrdCtaFilesystem.cpp XrdCtaFile.cpp XrdCtaDir.cpp)
target_link_libraries (XrdCtaOfs ctacatalogue ctaeosmessages ctascheduler ctacommon protobuf ctaobjectstore cryptopp)
target_link_libraries (XrdCtaOfs ctacatalogue ctaeosmessages ctascheduler ctacommon ${PROTOBUF3_LIBRARIES} ctaobjectstore cryptopp)
INSTALL (TARGETS XrdCtaOfs DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
INSTALL (FILES xrootd-cta.cfg DESTINATION /etc/xrootd/)
......
Supports Markdown
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