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

143
144
add_library (ctacommon SHARED
  ${COMMON_LIB_SRC_FILES})
Michael Davis's avatar
Michael Davis committed
145
146
147
set_property(TARGET ctacommon PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacommon PROPERTY   VERSION "${CTA_LIBVERSION}")

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

150
target_link_libraries (ctacommon
Steven Murray's avatar
Steven Murray committed
151
  pthread
152
  uuid
153
  z
154
155
  cap
  XrdCl)
Eric Cano's avatar
Eric Cano committed
156

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

188
189
add_library (ctacommonunittests SHARED
  ${COMMON_UNIT_TESTS_LIB_SRC_FILES})
Michael Davis's avatar
Michael Davis committed
190
191
set_property(TARGET ctacommonunittests PROPERTY SOVERSION "${CTA_SOVERSION}")
set_property(TARGET ctacommonunittests PROPERTY   VERSION "${CTA_LIBVERSION}")
192

193
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
194
add_executable(mutexLtrace threading/MutexLtrace.cpp)
195
196
target_link_libraries(mutexLtrace ctacommon)