CMakeLists.txt 6.52 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
set (BASE_LIB_SRC_FILES
34
  dataStructures/ActivitiesFairShareWeights.cpp
35
36
  dataStructures/AdminUser.cpp
  dataStructures/ArchiveFile.cpp
37
  dataStructures/ArchiveFileQueueCriteria.cpp
38
  dataStructures/ArchiveFileQueueCriteriaAndFileId.cpp
39
  dataStructures/ArchiveFileSummary.cpp
40
41
42
43
44
  dataStructures/ArchiveJob.cpp
  dataStructures/ArchiveRequest.cpp
  dataStructures/ArchiveRoute.cpp
  dataStructures/CancelRetrieveRequest.cpp
  dataStructures/DeleteArchiveRequest.cpp
45
  dataStructures/DesiredDriveState.cpp
46
  dataStructures/DiskFileInfo.cpp
47
  dataStructures/DriveState.cpp
48
  dataStructures/DriveStatus.cpp
49
  dataStructures/EntryLog.cpp
50
  dataStructures/FrontendReturnCode.cpp
51
  dataStructures/LifecycleTimings.cpp
52
  dataStructures/ListStorageClassRequest.cpp
53
  dataStructures/LogicalLibrary.cpp
54
  dataStructures/MountType.cpp
55
  dataStructures/MountPolicy.cpp
56
  dataStructures/OwnerIdentity.cpp
57
  dataStructures/QueueAndMountSummary.cpp
58
59
  dataStructures/ReadTestResult.cpp
  dataStructures/RepackInfo.cpp
60
  dataStructures/RequesterGroupMountRule.cpp
61
  dataStructures/RequesterIdentity.cpp
62
  dataStructures/RequesterMountRule.cpp
63
  dataStructures/RetrieveFileQueueCriteria.cpp
64
65
66
67
68
  dataStructures/RetrieveJob.cpp
  dataStructures/RetrieveRequest.cpp
  dataStructures/SecurityIdentity.cpp
  dataStructures/StorageClass.cpp
  dataStructures/Tape.cpp
69
  dataStructures/TapeFile.cpp
70
  dataStructures/TapeLog.cpp
71
  dataStructures/TestSourceType.cpp
72
  dataStructures/UpdateFileInfoRequest.cpp
73
  dataStructures/UpdateFileStorageClassRequest.cpp
74
  dataStructures/WriteTestResult.cpp
75
  dataStructures/utils.cpp
76
  checksum/ChecksumBlob.cpp
77
78
79
80
81
82
83
84
85
86
87
88
89
90
  exception/Backtrace.cpp
  exception/Exception.cpp
)

add_library (ctabase SHARED
  ${BASE_LIB_SRC_FILES})
set_property(TARGET ctabase PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctabase PROPERTY   VERSION "${CTA_LIBVERSION}")

install (TARGETS ctabase DESTINATION usr/${CMAKE_INSTALL_LIBDIR})

set_source_files_properties(CRC.cpp PROPERTIES COMPILE_FLAGS -O2)

set (COMMON_LIB_SRC_FILES
91
  exception/AcceptConnectionInterrupted.cpp
92
  exception/AcsQueryVolumeCmd.cpp
93
  exception/BadAlloc.cpp
94
  exception/CommandLineNotParsed.cpp
95
  exception/DismountFailed.cpp  
96
  exception/ForceDismountFailed.cpp
97
  exception/Errnum.cpp
98
  exception/InvalidArgument.cpp
99
  exception/InvalidConfigEntry.cpp
100
  exception/LostDatabaseConnection.cpp
101
  exception/Mismatch.cpp
102
  exception/MissingOperand.cpp
103
  exception/MountFailed.cpp
104
  exception/NoEntry.cpp
105
  exception/NonRetryableError.cpp
106
  exception/NoPortInRange.cpp
107
  exception/NotAnOwner.cpp
108
  exception/OutOfMemory.cpp
109
110
111
  exception/QueryVolumeFailed.cpp
  exception/RequestFailed.cpp
  exception/RetryableError.cpp
112
  exception/TimeOut.cpp
113
  exception/UserError.cpp
114
  exception/XrootCl.cpp
115
  log/DummyLogger.cpp
Eric Cano's avatar
Eric Cano committed
116
  log/FileLogger.cpp
117
118
  log/LogContext.cpp
  log/Logger.cpp
Steven Murray's avatar
Steven Murray committed
119
  log/LogLevel.cpp
120
121
122
123
  log/Message.cpp
  log/Param.cpp
  log/StringLogger.cpp
  log/SyslogLogger.cpp
124
  log/StdoutLogger.cpp
125
  log/TimingList.cpp
126
127
128
  priorities/DriveQuota.cpp
  priorities/MountCriteria.cpp
  priorities/UserGroup.cpp
129
  processCap/ProcessCap.cpp
130
  processCap/ProcessCapDummy.cpp
131
  processCap/SmartCap.cpp
132
133
134
  remoteFS/RemoteFileStatus.cpp
  remoteFS/RemotePath.cpp
  remoteFS/RemotePathAndStatus.cpp
Steven Murray's avatar
Steven Murray committed
135
  SmartFd.cpp
136
  SmartFILEPtr.cpp
137
  CRC.cpp
Eric Cano's avatar
Eric Cano committed
138
  threading/ChildProcess.cpp
139
  threading/CondVar.cpp
140
  threading/Daemon.cpp
Eric Cano's avatar
Eric Cano committed
141
  threading/Mutex.cpp
Steven Murray's avatar
Steven Murray committed
142
143
144
  threading/RWLock.cpp
  threading/RWLockRdLocker.cpp
  threading/RWLockWrLocker.cpp
145
  threading/SocketPair.cpp
146
  threading/System.cpp
147
  threading/Thread.cpp
148
  threading/Semaphores.cpp
149
  threading/SubProcess.cpp
150
  threading/Async.cpp
151
  utils/GetOptThreadSafe.cpp
Eric Cano's avatar
Eric Cano committed
152
  utils/Regex.cpp
153
  utils/utils.cpp
154
155
156
  utils/strerror_r_wrapper.cpp
  CreationLog.cpp
  Configuration.cpp
157
158
  ConfigurationFile.cpp
  SourcedParameter.cpp   
159
  Timer.cpp
160
  optional.cpp)
Eric Cano's avatar
Eric Cano committed
161

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

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

169
target_link_libraries (ctacommon
170
  ctabase
171
  XrdSsiPbEosCta
Steven Murray's avatar
Steven Murray committed
172
  pthread
173
  uuid
174
  z
175
  cap
176
177
  XrdCl
)
Eric Cano's avatar
Eric Cano committed
178

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