CMakeLists.txt 6.21 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
set_source_files_properties(CRC.cpp PROPERTIES COMPILE_FLAGS -O2)

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

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

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

157
target_link_libraries (ctacommon
Steven Murray's avatar
Steven Murray committed
158
  pthread
159
  uuid
160
  z
161
  cap
162
163
164
  XrdCl
  ${XROOTD_XRDCLIENT_LIB}
)
Eric Cano's avatar
Eric Cano committed
165

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

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

205
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
206
add_executable(mutexLtrace threading/MutexLtrace.cpp)
207
target_link_libraries(mutexLtrace ctacommon)