CMakeLists.txt 3.11 KB
Newer Older
Steven Murray's avatar
Steven Murray committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# The CERN Tape Archive(CTA) project
# Copyright(C) 2015  CERN
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

17
18
cmake_minimum_required (VERSION 2.6)

19
20
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../middletier)
21

22

Steven Murray's avatar
Steven Murray committed
23
find_package(json-c REQUIRED)
Steven Murray's avatar
Steven Murray committed
24
find_package(librados2 REQUIRED)
25
find_package(Protobuf REQUIRED)
26
27
28
29
30
31

set (CTAProtoFiles
  cta.proto)

PROTOBUF_GENERATE_CPP(CTAProtoSources CTAProtoHeaders ${CTAProtoFiles})

32
33
set (CTAProtoDependants objectstore/Agent.hpp
  objectstore/ArchiveToFileRequest.hpp
Daniele Kruse's avatar
Daniele Kruse committed
34
  objectstore/ArchiveRequest.hpp
35
36
37
  objectstore/CreationLog.hpp
  objectstore/GenericObject.hpp
  objectstore/ObjectOps.hpp
38
  objectstore/RetrieveRequest.hpp
39
40
41
42
  objectstore/RetrieveToFileRequest.cpp
  objectstore/RetrieveToFileRequest.hpp
  objectstore/RootEntry.hpp
  objectstore/SchedulerGlobalLock.hpp
43
  objectstore/TapeQueue.hpp
44
  objectstore/ArchiveQueue.hpp
45
46
47
48
49
50
51
  objectstore/UserIdentity.hpp)

SET_SOURCE_FILES_PROPERTIES(${CTAProtoHeaders} PROPERTIES HEADER_FILE_ONLY TRUE)
SET_SOURCE_FILES_PROPERTIES(${CTAProtoDependants} 
  PROPERTIES OBJECT_DEPENDS ${CTAProtoHeaders})


Eric Cano's avatar
Eric Cano committed
52
add_library (ctaobjectstore SHARED
53
  ${CTAProtoSources}
54
55
56
  RootEntry.cpp
  Agent.cpp
  AgentRegister.cpp
57
  AgentWatchdog.cpp
58
59
  ArchiveQueue.cpp
  RetrieveQueue.cpp
60
  ArchiveToFileRequest.cpp
Daniele Kruse's avatar
Daniele Kruse committed
61
  ArchiveRequest.cpp
62
  RetrieveToFileRequest.cpp
63
  RetrieveRequest.cpp
Eric Cano's avatar
Eric Cano committed
64
  DriveRegister.cpp
65
  BackendVFS.cpp
66
  BackendRados.cpp
67
  BackendPopulator.cpp
68
  BackendFactory.cpp
69
  ProtocolBuffersAlgorithms.cpp
70
  GenericObject.cpp
71
72
  GarbageCollector.cpp
  SchedulerGlobalLock.cpp)
73
target_link_libraries(ctaobjectstore Utils rados json-c ctautils)
74
set_source_files_properties(BackendRados.cpp PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations)
Eric Cano's avatar
Eric Cano committed
75
install (TARGETS ctaobjectstore DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
76

77
set(ObjectStoreUnitTests
78
79
  BackendTest.cpp
  RootEntryTest.cpp
80
  RetrieveQueueTest.cpp
81
  GarbageCollectorTest.cpp
82
  ArchiveToFileRequestTest.cpp
83
)
84

Eric Cano's avatar
Eric Cano committed
85
86
add_library(ctaobjectstoreunittests SHARED ${ObjectStoreUnitTests})
target_link_libraries(ctaobjectstoreunittests
Steven Murray's avatar
Steven Murray committed
87
  protobuf rados ctacommon gtest ctaobjectstore)
88
install(TARGETS ctaobjectstoreunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
89
90
91

add_executable(makeMinimalVFS makeMinimalVFS.cpp)
target_link_libraries(makeMinimalVFS
92
  protobuf ctaobjectstore ctacommon ctautils)
93
94
95

add_executable(listObjectStore listObjectStore.cpp)
target_link_libraries(listObjectStore
Eric Cano's avatar
Eric Cano committed
96
  protobuf ctaobjectstore ctacommon)
Eric Cano's avatar
Eric Cano committed
97
98
99

add_executable(dumpObject dumpObject.cpp)
target_link_libraries(dumpObject
Steven Murray's avatar
Steven Murray committed
100
  protobuf ctaobjectstore ctacommon)