CMakeLists.txt 6.53 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
47
  dataStructures/ArchiveJob.cpp
  dataStructures/ArchiveRequest.cpp
  dataStructures/ArchiveRoute.cpp
  dataStructures/CancelRetrieveRequest.cpp
  dataStructures/DeleteArchiveRequest.cpp
48
  dataStructures/DesiredDriveState.cpp
49
  dataStructures/DiskFileInfo.cpp
50
  dataStructures/DriveState.cpp
51
  dataStructures/DriveStatus.cpp
52
  dataStructures/EntryLog.cpp
53
  dataStructures/FileRecycleLog.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
Michael Davis's avatar
Michael Davis committed
64
  dataStructures/RepackQueueType.cpp
65
  dataStructures/RequesterGroupMountRule.cpp
66
  dataStructures/RequesterIdentity.cpp
67
  dataStructures/RequesterMountRule.cpp
68
  dataStructures/RetrieveFileQueueCriteria.cpp
69
70
71
72
73
  dataStructures/RetrieveJob.cpp
  dataStructures/RetrieveRequest.cpp
  dataStructures/SecurityIdentity.cpp
  dataStructures/StorageClass.cpp
  dataStructures/Tape.cpp
74
  dataStructures/TapeFile.cpp
75
  dataStructures/TapeLog.cpp
76
  dataStructures/TestSourceType.cpp
77
  dataStructures/UpdateFileInfoRequest.cpp
78
  dataStructures/UpdateFileStorageClassRequest.cpp
79
  dataStructures/VirtualOrganization.cpp
80
  dataStructures/WriteTestResult.cpp
81
  dataStructures/utils.cpp
82
  checksum/ChecksumBlob.cpp
83
  exception/AcceptConnectionInterrupted.cpp
84
  exception/AcsQueryVolumeCmd.cpp
85
  exception/Backtrace.cpp
86
  exception/BadAlloc.cpp
87
  exception/CommandLineNotParsed.cpp
88
  exception/DismountFailed.cpp  
89
  exception/ForceDismountFailed.cpp
90
  exception/Errnum.cpp
91
  exception/Exception.cpp
92
  exception/InvalidArgument.cpp
93
  exception/InvalidConfigEntry.cpp
94
  exception/LostDatabaseConnection.cpp
95
  exception/Mismatch.cpp
96
  exception/MissingOperand.cpp
97
  exception/MountFailed.cpp
98
  exception/NoEntry.cpp
99
  exception/NonRetryableError.cpp
100
  exception/NoPortInRange.cpp
101
  exception/NotAnOwner.cpp
102
  exception/OutOfMemory.cpp
103
104
105
  exception/QueryVolumeFailed.cpp
  exception/RequestFailed.cpp
  exception/RetryableError.cpp
106
  exception/TimeOut.cpp
107
  exception/UserError.cpp
108
  exception/XrootCl.cpp
109
110
  json/object/JSONObject.cpp
  json/object/JSONCObject.cpp
111
  log/DummyLogger.cpp
Eric Cano's avatar
Eric Cano committed
112
  log/FileLogger.cpp
113
114
  log/LogContext.cpp
  log/Logger.cpp
Steven Murray's avatar
Steven Murray committed
115
  log/LogLevel.cpp
116
117
  log/Message.cpp
  log/Param.cpp
118
  log/PriorityMaps.cpp
119
120
  log/StringLogger.cpp
  log/SyslogLogger.cpp
121
  log/StdoutLogger.cpp
122
  log/TimingList.cpp
123
124
125
  priorities/DriveQuota.cpp
  priorities/MountCriteria.cpp
  priorities/UserGroup.cpp
126
  processCap/ProcessCap.cpp
127
  processCap/ProcessCapDummy.cpp
128
  processCap/SmartCap.cpp
129
130
131
  remoteFS/RemoteFileStatus.cpp
  remoteFS/RemotePath.cpp
  remoteFS/RemotePathAndStatus.cpp
Steven Murray's avatar
Steven Murray committed
132
  SmartFd.cpp
133
  SmartFILEPtr.cpp
134
  CRC.cpp
Eric Cano's avatar
Eric Cano committed
135
  threading/ChildProcess.cpp
136
  threading/CondVar.cpp
137
  threading/Daemon.cpp
Eric Cano's avatar
Eric Cano committed
138
  threading/Mutex.cpp
Steven Murray's avatar
Steven Murray committed
139
140
141
  threading/RWLock.cpp
  threading/RWLockRdLocker.cpp
  threading/RWLockWrLocker.cpp
142
  threading/SocketPair.cpp
143
  threading/System.cpp
144
  threading/Thread.cpp
145
  threading/Semaphores.cpp
146
  threading/SubProcess.cpp
147
  threading/Async.cpp
148
  utils/GetOptThreadSafe.cpp
Eric Cano's avatar
Eric Cano committed
149
  utils/Regex.cpp
150
  utils/utils.cpp
151
152
153
  utils/strerror_r_wrapper.cpp
  CreationLog.cpp
  Configuration.cpp
154
155
  ConfigurationFile.cpp
  SourcedParameter.cpp   
156
  Timer.cpp
157
  optional.cpp)
Eric Cano's avatar
Eric Cano committed
158

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

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

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

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

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

218
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
219
add_executable(mutexLtrace threading/MutexLtrace.cpp)
220
target_link_libraries(mutexLtrace ctacommon)