CMakeLists.txt 5.93 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
32
33
  dataStructures/AdminHost.cpp
  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/ListStorageClassRequest.cpp
49
  dataStructures/LogicalLibrary.cpp
50
  dataStructures/MountType.cpp
51
  dataStructures/MountPolicy.cpp
52
  dataStructures/QueueAndMountSummary.cpp
53
54
  dataStructures/ReadTestResult.cpp
  dataStructures/RepackInfo.cpp
55
  dataStructures/RepackType.cpp
56
57
  dataStructures/RequesterGroupMountRule.cpp
  dataStructures/RequesterMountRule.cpp
58
59
60
61
62
  dataStructures/RetrieveJob.cpp
  dataStructures/RetrieveRequest.cpp
  dataStructures/SecurityIdentity.cpp
  dataStructures/StorageClass.cpp
  dataStructures/Tape.cpp
63
  dataStructures/TapeFile.cpp
64
  dataStructures/TapeLog.cpp
65
  dataStructures/TestSourceType.cpp
66
  dataStructures/UpdateFileInfoRequest.cpp
67
  dataStructures/UpdateFileStorageClassRequest.cpp
68
69
70
  dataStructures/UserIdentity.cpp
  dataStructures/VerifyInfo.cpp
  dataStructures/WriteTestResult.cpp
71
  dataStructures/utils.cpp
72
73
74
75
  admin/AdminHost.cpp
  admin/AdminUser.cpp
  archiveRoutes/ArchiveRoute.cpp
  checksum/Checksum.cpp
76
  exception/AcceptConnectionInterrupted.cpp
77
78
  exception/AcsQueryVolumeCmd.cpp
  exception/Backtrace.cpp
79
  exception/BadAlloc.cpp
80
  exception/CommandLineNotParsed.cpp
81
  exception/DatabaseConstraintError.cpp  
Steven Murray's avatar
Steven Murray committed
82
  exception/DatabasePrimaryKeyError.cpp  
83
84
85
  exception/DismountFailed.cpp  
  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
114
115
  priorities/DriveQuota.cpp
  priorities/MountCriteria.cpp
  priorities/UserGroup.cpp
116
  processCap/ProcessCap.cpp
117
  processCap/ProcessCapDummy.cpp
118
  processCap/SmartCap.cpp
119
120
121
  remoteFS/RemoteFileStatus.cpp
  remoteFS/RemotePath.cpp
  remoteFS/RemotePathAndStatus.cpp
Steven Murray's avatar
Steven Murray committed
122
  SmartFd.cpp
123
  SmartFILEPtr.cpp
124
  CRC.cpp
Eric Cano's avatar
Eric Cano committed
125
  threading/ChildProcess.cpp
126
  threading/CondVar.cpp
127
  threading/Daemon.cpp
Eric Cano's avatar
Eric Cano committed
128
  threading/Mutex.cpp
129
  threading/SocketPair.cpp
130
  threading/System.cpp
131
  threading/Thread.cpp
132
  threading/Semaphores.cpp
133
  threading/SubProcess.cpp
134
  utils/GetOptThreadSafe.cpp
Eric Cano's avatar
Eric Cano committed
135
  utils/Regex.cpp
136
  utils/utils.cpp
137
138
139
  utils/strerror_r_wrapper.cpp
  CreationLog.cpp
  Configuration.cpp
140
141
  ConfigurationFile.cpp
  SourcedParameter.cpp   
142
143
  TapePool.cpp
  Timer.cpp
144
  UserIdentity.cpp
145
  VO.cpp)
Eric Cano's avatar
Eric Cano committed
146

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

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

154
target_link_libraries (ctacommon
Steven Murray's avatar
Steven Murray committed
155
  pthread
156
  uuid
157
  z
158
159
  cap
  XrdCl)
Eric Cano's avatar
Eric Cano committed
160

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

192
193
add_library (ctacommonunittests SHARED
  ${COMMON_UNIT_TESTS_LIB_SRC_FILES})
Michael Davis's avatar
Michael Davis committed
194
195
set_property(TARGET ctacommonunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacommonunittests PROPERTY   VERSION "${CTA_LIBVERSION}")
196

197
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
198
add_executable(mutexLtrace threading/MutexLtrace.cpp)
199
200
target_link_libraries(mutexLtrace ctacommon)