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

35
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/VerifyInfo.cpp
77
  dataStructures/WriteTestResult.cpp
78
  dataStructures/utils.cpp
79
  checksum/Checksum.cpp
80
81
  checksum/ChecksumBlob.cpp
  ${CMAKE_BINARY_DIR}/eos_cta/cta_common.pb.cc
82
  exception/AcceptConnectionInterrupted.cpp
83
84
  exception/AcsQueryVolumeCmd.cpp
  exception/Backtrace.cpp
85
  exception/BadAlloc.cpp
86
  exception/CommandLineNotParsed.cpp
87
  exception/DatabaseConstraintError.cpp  
Steven Murray's avatar
Steven Murray committed
88
  exception/DatabasePrimaryKeyError.cpp  
89
  exception/DismountFailed.cpp  
90
  exception/ForceDismountFailed.cpp
91
92
  exception/Errnum.cpp
  exception/Exception.cpp
93
  exception/InvalidArgument.cpp
94
  exception/InvalidConfigEntry.cpp
95
  exception/LostDatabaseConnection.cpp
96
  exception/Mismatch.cpp
97
  exception/MissingOperand.cpp
98
  exception/MountFailed.cpp
99
  exception/NoEntry.cpp
100
  exception/NonRetryableError.cpp
101
  exception/NoPortInRange.cpp
102
  exception/NotAnOwner.cpp
103
  exception/OutOfMemory.cpp
104
105
106
  exception/QueryVolumeFailed.cpp
  exception/RequestFailed.cpp
  exception/RetryableError.cpp
107
  exception/TimeOut.cpp
108
  exception/UserError.cpp
109
  exception/XrootCl.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
117
118
  log/Message.cpp
  log/Param.cpp
  log/StringLogger.cpp
  log/SyslogLogger.cpp
119
  log/StdoutLogger.cpp
120
  log/TimingList.cpp
121
122
123
  priorities/DriveQuota.cpp
  priorities/MountCriteria.cpp
  priorities/UserGroup.cpp
124
  processCap/ProcessCap.cpp
125
  processCap/ProcessCapDummy.cpp
126
  processCap/SmartCap.cpp
127
128
129
  remoteFS/RemoteFileStatus.cpp
  remoteFS/RemotePath.cpp
  remoteFS/RemotePathAndStatus.cpp
Steven Murray's avatar
Steven Murray committed
130
  SmartFd.cpp
131
  SmartFILEPtr.cpp
132
  CRC.cpp
Eric Cano's avatar
Eric Cano committed
133
  threading/ChildProcess.cpp
134
  threading/CondVar.cpp
135
  threading/Daemon.cpp
Eric Cano's avatar
Eric Cano committed
136
  threading/Mutex.cpp
Steven Murray's avatar
Steven Murray committed
137
138
139
  threading/RWLock.cpp
  threading/RWLockRdLocker.cpp
  threading/RWLockWrLocker.cpp
140
  threading/SocketPair.cpp
141
  threading/System.cpp
142
  threading/Thread.cpp
143
  threading/Semaphores.cpp
144
  threading/SubProcess.cpp
145
  threading/Async.cpp
146
  utils/GetOptThreadSafe.cpp
Eric Cano's avatar
Eric Cano committed
147
  utils/Regex.cpp
148
  utils/utils.cpp
149
150
151
  utils/strerror_r_wrapper.cpp
  CreationLog.cpp
  Configuration.cpp
152
153
  ConfigurationFile.cpp
  SourcedParameter.cpp   
154
  Timer.cpp
155
  optional.cpp)
Eric Cano's avatar
Eric Cano committed
156

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

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

164
target_link_libraries (ctacommon
Steven Murray's avatar
Steven Murray committed
165
  pthread
166
  uuid
167
  z
168
  cap
169
170
171
  XrdCl
  ${XROOTD_XRDCLIENT_LIB}
)
Eric Cano's avatar
Eric Cano committed
172

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

207
208
add_library (ctacommonunittests SHARED
  ${COMMON_UNIT_TESTS_LIB_SRC_FILES})
Michael Davis's avatar
Michael Davis committed
209
210
set_property(TARGET ctacommonunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacommonunittests PROPERTY   VERSION "${CTA_LIBVERSION}")
211

212
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
213
add_executable(mutexLtrace threading/MutexLtrace.cpp)
214
target_link_libraries(mutexLtrace ctacommon ${PROTOBUF3_LIBRARIES})