CMakeLists.txt 6.28 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

24
25
add_subdirectory (exception)

26
27
include_directories (${XROOTD_INCLUDE_DIR})

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

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

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

153
154
add_library (ctacommon SHARED
  ${COMMON_LIB_SRC_FILES})
Michael Davis's avatar
Michael Davis committed
155
156
157
set_property(TARGET ctacommon PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacommon PROPERTY   VERSION "${CTA_LIBVERSION}")

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

160
target_link_libraries (ctacommon
161
  XrdSsiPbEosCta
Steven Murray's avatar
Steven Murray committed
162
  pthread
163
  uuid
164
  z
165
  cap
166
167
  XrdCl
)
Eric Cano's avatar
Eric Cano committed
168

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

203
204
add_library (ctacommonunittests SHARED
  ${COMMON_UNIT_TESTS_LIB_SRC_FILES})
Michael Davis's avatar
Michael Davis committed
205
206
set_property(TARGET ctacommonunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacommonunittests PROPERTY   VERSION "${CTA_LIBVERSION}")
207

208
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
209
add_executable(mutexLtrace threading/MutexLtrace.cpp)
210
target_link_libraries(mutexLtrace ctacommon)