CMakeLists.txt 6.5 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
109
  json/object/JSONObject.cpp
  json/object/JSONCObject.cpp
110
  log/DummyLogger.cpp
Eric Cano's avatar
Eric Cano committed
111
  log/FileLogger.cpp
112
113
  log/LogContext.cpp
  log/Logger.cpp
Steven Murray's avatar
Steven Murray committed
114
  log/LogLevel.cpp
115
116
  log/Message.cpp
  log/Param.cpp
117
  log/PriorityMaps.cpp
118
119
  log/StringLogger.cpp
  log/SyslogLogger.cpp
120
  log/StdoutLogger.cpp
121
  log/TimingList.cpp
122
123
124
  priorities/DriveQuota.cpp
  priorities/MountCriteria.cpp
  priorities/UserGroup.cpp
125
  processCap/ProcessCap.cpp
126
  processCap/ProcessCapDummy.cpp
127
  processCap/SmartCap.cpp
128
129
130
  remoteFS/RemoteFileStatus.cpp
  remoteFS/RemotePath.cpp
  remoteFS/RemotePathAndStatus.cpp
Steven Murray's avatar
Steven Murray committed
131
  SmartFd.cpp
132
  SmartFILEPtr.cpp
133
  CRC.cpp
Eric Cano's avatar
Eric Cano committed
134
  threading/ChildProcess.cpp
135
  threading/CondVar.cpp
136
  threading/Daemon.cpp
Eric Cano's avatar
Eric Cano committed
137
  threading/Mutex.cpp
Steven Murray's avatar
Steven Murray committed
138
139
140
  threading/RWLock.cpp
  threading/RWLockRdLocker.cpp
  threading/RWLockWrLocker.cpp
141
  threading/SocketPair.cpp
142
  threading/System.cpp
143
  threading/Thread.cpp
144
  threading/Semaphores.cpp
145
  threading/SubProcess.cpp
146
  threading/Async.cpp
147
  utils/GetOptThreadSafe.cpp
Eric Cano's avatar
Eric Cano committed
148
  utils/Regex.cpp
149
  utils/utils.cpp
150
151
152
  utils/strerror_r_wrapper.cpp
  CreationLog.cpp
  Configuration.cpp
153
154
  ConfigurationFile.cpp
  SourcedParameter.cpp   
155
  Timer.cpp
156
  optional.cpp)
Eric Cano's avatar
Eric Cano committed
157

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

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

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

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

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

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