CMakeLists.txt 3.18 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
43
44
  objectstore/RetrieveToFileRequest.cpp
  objectstore/RetrieveToFileRequest.hpp
  objectstore/RootEntry.hpp
  objectstore/SchedulerGlobalLock.hpp
  objectstore/Tape.hpp
  objectstore/TapePool.hpp
45
46
  objectstore/TapeQueue.hpp
  objectstore/TapePoolQueue.hpp
47
48
49
50
51
52
53
  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
54
add_library (ctaobjectstore SHARED
55
  ${CTAProtoSources}
56
57
58
  RootEntry.cpp
  Agent.cpp
  AgentRegister.cpp
59
  AgentWatchdog.cpp
60
  TapePool.cpp
61
  Tape.cpp
62
63
  TapePoolQueue.cpp
  TapeQueue.cpp
64
  ArchiveToFileRequest.cpp
Daniele Kruse's avatar
Daniele Kruse committed
65
  ArchiveRequest.cpp
66
  RetrieveToFileRequest.cpp
67
  RetrieveRequest.cpp
Eric Cano's avatar
Eric Cano committed
68
  DriveRegister.cpp
69
  BackendVFS.cpp
70
  BackendRados.cpp
71
  BackendPopulator.cpp
72
  BackendFactory.cpp
73
  ProtocolBuffersAlgorithms.cpp
74
  GenericObject.cpp
75
76
  GarbageCollector.cpp
  SchedulerGlobalLock.cpp)
77
target_link_libraries(ctaobjectstore Utils rados json-c ctautils)
78
set_source_files_properties(BackendRados.cpp PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations)
Eric Cano's avatar
Eric Cano committed
79
install (TARGETS ctaobjectstore DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
80

81
set(ObjectStoreUnitTests
82
83
  BackendTest.cpp
  RootEntryTest.cpp
84
  TapeTest.cpp
85
  GarbageCollectorTest.cpp
86
  ArchiveToFileRequestTest.cpp
87
)
88

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

add_executable(makeMinimalVFS makeMinimalVFS.cpp)
target_link_libraries(makeMinimalVFS
96
  protobuf ctaobjectstore ctacommon ctautils)
97
98
99

add_executable(listObjectStore listObjectStore.cpp)
target_link_libraries(listObjectStore
Eric Cano's avatar
Eric Cano committed
100
  protobuf ctaobjectstore ctacommon)
Eric Cano's avatar
Eric Cano committed
101
102
103

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