CMakeLists.txt 6.44 KB
Newer Older
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/>.

Eric Cano's avatar
Eric Cano committed
17
18
cmake_minimum_required (VERSION 2.6)

19
20
21
find_package (binutils REQUIRED)
find_package (libattr REQUIRED)
find_package (libcap REQUIRED)
22
find_package (libuuid REQUIRED)
23
find_package(json-c REQUIRED)
24

25
26
add_subdirectory (exception)

27
28
include_directories (${XROOTD_INCLUDE_DIR})

29
30
31
32
33
#
# Compiled protocol buffers (used for ChecksumBlob serialization)
#
include_directories(${CMAKE_BINARY_DIR}/eos_cta ${PROTOBUF3_INCLUDE_DIRS})

34
35
36
set_source_files_properties(CRC.cpp PROPERTIES COMPILE_FLAGS -O2)

set (COMMON_LIB_SRC_FILES
37
  dataStructures/ActivitiesFairShareWeights.cpp
38
39
  dataStructures/AdminUser.cpp
  dataStructures/ArchiveFile.cpp
40
  dataStructures/ArchiveFileQueueCriteria.cpp
41
  dataStructures/ArchiveFileQueueCriteriaAndFileId.cpp
42
  dataStructures/ArchiveFileSummary.cpp
43
44
45
46
  dataStructures/ArchiveJob.cpp
  dataStructures/ArchiveRequest.cpp
  dataStructures/ArchiveRoute.cpp
  dataStructures/CancelRetrieveRequest.cpp
47
  dataStructures/DeletedArchiveFile.cpp
48
  dataStructures/DeleteArchiveRequest.cpp
49
  dataStructures/DesiredDriveState.cpp
50
  dataStructures/DiskFileInfo.cpp
51
  dataStructures/DriveState.cpp
52
  dataStructures/DriveStatus.cpp
53
  dataStructures/EntryLog.cpp
54
  dataStructures/FrontendReturnCode.cpp
55
  dataStructures/LifecycleTimings.cpp
56
  dataStructures/ListStorageClassRequest.cpp
57
  dataStructures/LogicalLibrary.cpp
58
  dataStructures/MountType.cpp
59
  dataStructures/MountPolicy.cpp
60
  dataStructures/OwnerIdentity.cpp
61
  dataStructures/QueueAndMountSummary.cpp
62
63
  dataStructures/ReadTestResult.cpp
  dataStructures/RepackInfo.cpp
64
  dataStructures/RequesterGroupMountRule.cpp
65
  dataStructures/RequesterIdentity.cpp
66
  dataStructures/RequesterMountRule.cpp
67
  dataStructures/RetrieveFileQueueCriteria.cpp
68
69
70
71
72
  dataStructures/RetrieveJob.cpp
  dataStructures/RetrieveRequest.cpp
  dataStructures/SecurityIdentity.cpp
  dataStructures/StorageClass.cpp
  dataStructures/Tape.cpp
73
  dataStructures/TapeFile.cpp
74
  dataStructures/TapeLog.cpp
75
  dataStructures/TestSourceType.cpp
76
  dataStructures/UpdateFileInfoRequest.cpp
77
  dataStructures/UpdateFileStorageClassRequest.cpp
78
  dataStructures/VirtualOrganization.cpp
79
  dataStructures/WriteTestResult.cpp
80
  dataStructures/utils.cpp
81
  checksum/ChecksumBlob.cpp
82
  exception/AcceptConnectionInterrupted.cpp
83
  exception/AcsQueryVolumeCmd.cpp
84
  exception/Backtrace.cpp
85
  exception/BadAlloc.cpp
86
  exception/CommandLineNotParsed.cpp
87
  exception/DismountFailed.cpp  
88
  exception/ForceDismountFailed.cpp
89
  exception/Errnum.cpp
90
  exception/Exception.cpp
91
  exception/InvalidArgument.cpp
92
  exception/InvalidConfigEntry.cpp
93
  exception/LostDatabaseConnection.cpp
94
  exception/Mismatch.cpp
95
  exception/MissingOperand.cpp
96
  exception/MountFailed.cpp
97
  exception/NoEntry.cpp
98
  exception/NonRetryableError.cpp
99
  exception/NoPortInRange.cpp
100
  exception/NotAnOwner.cpp
101
  exception/OutOfMemory.cpp
102
103
104
  exception/QueryVolumeFailed.cpp
  exception/RequestFailed.cpp
  exception/RetryableError.cpp
105
  exception/TimeOut.cpp
106
  exception/UserError.cpp
107
  exception/XrootCl.cpp
108
  json/parser/JSONCParser.cpp
109
  log/DummyLogger.cpp
Eric Cano's avatar
Eric Cano committed
110
  log/FileLogger.cpp
111
112
  log/LogContext.cpp
  log/Logger.cpp
Steven Murray's avatar
Steven Murray committed
113
  log/LogLevel.cpp
114
115
  log/Message.cpp
  log/Param.cpp
116
  log/PriorityMaps.cpp
117
118
  log/StringLogger.cpp
  log/SyslogLogger.cpp
119
  log/StdoutLogger.cpp
120
  log/TimingList.cpp
121
122
123
  priorities/DriveQuota.cpp
  priorities/MountCriteria.cpp
  priorities/UserGroup.cpp
124
  processCap/ProcessCap.cpp
125
  processCap/ProcessCapDummy.cpp
126
  processCap/SmartCap.cpp
127
128
129
  remoteFS/RemoteFileStatus.cpp
  remoteFS/RemotePath.cpp
  remoteFS/RemotePathAndStatus.cpp
Steven Murray's avatar
Steven Murray committed
130
  SmartFd.cpp
131
  SmartFILEPtr.cpp
132
  CRC.cpp
Eric Cano's avatar
Eric Cano committed
133
  threading/ChildProcess.cpp
134
  threading/CondVar.cpp
135
  threading/Daemon.cpp
Eric Cano's avatar
Eric Cano committed
136
  threading/Mutex.cpp
Steven Murray's avatar
Steven Murray committed
137
138
139
  threading/RWLock.cpp
  threading/RWLockRdLocker.cpp
  threading/RWLockWrLocker.cpp
140
  threading/SocketPair.cpp
141
  threading/System.cpp
142
  threading/Thread.cpp
143
  threading/Semaphores.cpp
144
  threading/SubProcess.cpp
145
  threading/Async.cpp
146
  utils/GetOptThreadSafe.cpp
Eric Cano's avatar
Eric Cano committed
147
  utils/Regex.cpp
148
  utils/utils.cpp
149
150
151
  utils/strerror_r_wrapper.cpp
  CreationLog.cpp
  Configuration.cpp
152
153
  ConfigurationFile.cpp
  SourcedParameter.cpp   
154
  Timer.cpp
155
  optional.cpp)
Eric Cano's avatar
Eric Cano committed
156

157
158
add_library (ctacommon SHARED
  ${COMMON_LIB_SRC_FILES})
Michael Davis's avatar
Michael Davis committed
159
160
161
set_property(TARGET ctacommon PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacommon PROPERTY   VERSION "${CTA_LIBVERSION}")

162
install (TARGETS ctacommon DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
Eric Cano's avatar
Eric Cano committed
163

164
target_link_libraries (ctacommon
165
  XrdSsiPbEosCta
Steven Murray's avatar
Steven Murray committed
166
  pthread
167
  uuid
168
  z
169
  cap
170
  XrdCl
171
  json-c 
172
)
Eric Cano's avatar
Eric Cano committed
173

174
set (COMMON_UNIT_TESTS_LIB_SRC_FILES
175
  checksum/ChecksumBlobTest.cpp
176
177
  ConfigurationFileTests.cpp
  SourcedParameterTests.cpp
178
  dataStructures/ArchiveFileTest.cpp
179
  dataStructures/LogicalLibraryTest.cpp
180
  dataStructures/StorageClassTest.cpp
181
  processCap/SmartCapTest.cpp
Eric Cano's avatar
Eric Cano committed
182
  log/FileLoggerTest.cpp
183
  log/LogContextTest.cpp
Steven Murray's avatar
Steven Murray committed
184
  log/LogLevelTest.cpp
185
186
  log/ParamTest.cpp
  log/SyslogLoggerTest.cpp
187
  log/StringLoggerTest.cpp
188
  remoteFS/RemotePathTest.cpp
Steven Murray's avatar
Steven Murray committed
189
  SmartFdTest.cpp
190
  SmartArrayPtrTest.cpp
191
  CRCTest.cpp
192
  threading/CondVarTest.cpp
193
  threading/DaemonTest.cpp
Steven Murray's avatar
Steven Murray committed
194
  threading/RWLockTest.cpp
195
  threading/SocketPairTest.cpp
196
197
198
199
  threading/ThreadingBlockingQTests.cpp
# threading/ThreadingMPTests.cpp is commented out because of errors caused by libust
  threading/ThreadingMTTests.cpp
  threading/ThreadingTests.cpp
200
  threading/AsyncTests.cpp
201
  threading/AtomicCounterTest.cpp
202
  utils/GetOptThreadSafeTest.cpp
Eric Cano's avatar
Eric Cano committed
203
  utils/RegexTest.cpp
204
  utils/UtilsTest.cpp
205
  optionalTest.cpp
206
207
208
  rangeTest.cpp
  json/parser/JSONCParserTest.cpp
)
Eric Cano's avatar
Eric Cano committed
209

210
211
add_library (ctacommonunittests SHARED
  ${COMMON_UNIT_TESTS_LIB_SRC_FILES})
Michael Davis's avatar
Michael Davis committed
212
213
set_property(TARGET ctacommonunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacommonunittests PROPERTY   VERSION "${CTA_LIBVERSION}")
214

215
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
216
add_executable(mutexLtrace threading/MutexLtrace.cpp)
217
target_link_libraries(mutexLtrace ctacommon)