CMakeLists.txt 2.96 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
set (CTAProtoDependants objectstore/Agent.hpp
Daniele Kruse's avatar
Daniele Kruse committed
33
  objectstore/ArchiveRequest.hpp
34
35
36
  objectstore/CreationLog.hpp
  objectstore/GenericObject.hpp
  objectstore/ObjectOps.hpp
37
  objectstore/RetrieveRequest.hpp
38
39
  objectstore/RootEntry.hpp
  objectstore/SchedulerGlobalLock.hpp
40
  objectstore/TapeQueue.hpp
41
  objectstore/ArchiveQueue.hpp
42
43
  objectstore/UserIdentity.hpp
  objectstore/ValueCountMap.hpp)
44
45
46
47
48
49

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

74
set(ObjectStoreUnitTests
75
76
  BackendTest.cpp
  RootEntryTest.cpp
77
  RetrieveQueueTest.cpp
78
  GarbageCollectorTest.cpp
79
)
80

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

add_executable(makeMinimalVFS makeMinimalVFS.cpp)
target_link_libraries(makeMinimalVFS
88
  protobuf ctaobjectstore ctacommon ctautils)
89
90
91

add_executable(listObjectStore listObjectStore.cpp)
target_link_libraries(listObjectStore
Eric Cano's avatar
Eric Cano committed
92
  protobuf ctaobjectstore ctacommon)
Eric Cano's avatar
Eric Cano committed
93
94
95

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