CMakeLists.txt 5.23 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
Steven Murray's avatar
Steven Murray committed
34
  dataStructures/ArchiveFileQueueCriteria.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/TapePool.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
Eric Cano's avatar
Eric Cano committed
76
77
78
  exception/Backtrace.cpp
  exception/Errnum.cpp
  exception/Exception.cpp
79
  exception/NonRetryableError.cpp
80
81
  exception/RetryableError.cpp
  exception/UserError.cpp
82
  exception/AcceptConnectionInterrupted.cpp
83
  exception/BadAlloc.cpp
84
  exception/CommandLineNotParsed.cpp
85
  exception/InvalidArgument.cpp
86
  exception/InvalidConfigEntry.cpp
87
  exception/MissingOperand.cpp
88
  exception/NoEntry.cpp
89
  exception/NoPortInRange.cpp
90
  exception/NotAnOwner.cpp
91
  exception/OutOfMemory.cpp
92
  exception/TimeOut.cpp
93
  exception/XrootCl.cpp
94
  log/DummyLogger.cpp
Eric Cano's avatar
Eric Cano committed
95
  log/FileLogger.cpp
96
97
  log/LogContext.cpp
  log/Logger.cpp
Steven Murray's avatar
Steven Murray committed
98
  log/LogLevel.cpp
99
100
101
102
  log/Message.cpp
  log/Param.cpp
  log/StringLogger.cpp
  log/SyslogLogger.cpp
103
  log/StdoutLogger.cpp
104
105
106
  priorities/DriveQuota.cpp
  priorities/MountCriteria.cpp
  priorities/UserGroup.cpp
107
  processCap/ProcessCap.cpp
108
  processCap/ProcessCapDummy.cpp
109
  processCap/SmartCap.cpp
110
111
112
  remoteFS/RemoteFileStatus.cpp
  remoteFS/RemotePath.cpp
  remoteFS/RemotePathAndStatus.cpp
Steven Murray's avatar
Steven Murray committed
113
  SmartFd.cpp
114
  SmartFILEPtr.cpp
115
  CRC.cpp
Eric Cano's avatar
Eric Cano committed
116
  threading/ChildProcess.cpp
117
  threading/CondVar.cpp
118
  threading/Daemon.cpp
Eric Cano's avatar
Eric Cano committed
119
  threading/Mutex.cpp
120
  threading/SocketPair.cpp
121
  threading/System.cpp
122
  threading/Thread.cpp
123
  threading/Semaphores.cpp
124
  threading/SubProcess.cpp
125
  utils/GetOptThreadSafe.cpp
Eric Cano's avatar
Eric Cano committed
126
  utils/Regex.cpp
127
  utils/utils.cpp
128
129
130
131
132
  utils/strerror_r_wrapper.cpp
  CreationLog.cpp
  Configuration.cpp
  TapePool.cpp
  Timer.cpp
133
  UserIdentity.cpp
134
  VO.cpp)
Eric Cano's avatar
Eric Cano committed
135

136
137
add_library (ctacommon SHARED
  ${COMMON_LIB_SRC_FILES})
138
install (TARGETS ctacommon DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
Eric Cano's avatar
Eric Cano committed
139

140
target_link_libraries (ctacommon
141
  ctautils
Steven Murray's avatar
Steven Murray committed
142
  pthread
143
  uuid
144
  z
145
146
  cap
  XrdCl)
Eric Cano's avatar
Eric Cano committed
147

148
set (COMMON_UNIT_TESTS_LIB_SRC_FILES
149
  checksum/ChecksumTest.cpp
150
  dataStructures/ArchiveFileTest.cpp
151
  dataStructures/StorageClassTest.cpp
152
  processCap/SmartCapTest.cpp
Eric Cano's avatar
Eric Cano committed
153
  log/FileLoggerTest.cpp
154
  log/LogContextTest.cpp
Steven Murray's avatar
Steven Murray committed
155
  log/LogLevelTest.cpp
156
157
  log/ParamTest.cpp
  log/SyslogLoggerTest.cpp
158
  log/StringLoggerTest.cpp
159
  remoteFS/RemotePathTest.cpp
Steven Murray's avatar
Steven Murray committed
160
  SmartFdTest.cpp
161
  SmartArrayPtrTest.cpp
162
  CRCTest.cpp
163
  threading/CondVarTest.cpp
164
  threading/DaemonTest.cpp
165
  threading/SocketPairTest.cpp
166
167
168
169
170
  threading/ThreadingBlockingQTests.cpp
# threading/ThreadingMPTests.cpp is commented out because of errors caused by libust
  threading/ThreadingMTTests.cpp
  threading/ThreadingTests.cpp
  threading/AtomicCounterTest.cpp
171
  utils/GetOptThreadSafeTest.cpp
Eric Cano's avatar
Eric Cano committed
172
  utils/RegexTest.cpp
173
  utils/UtilsTest.cpp
174
175
  UserIdentityTest.cpp
  optionalTest.cpp)
Eric Cano's avatar
Eric Cano committed
176

177
178
add_library (ctacommonunittests SHARED
  ${COMMON_UNIT_TESTS_LIB_SRC_FILES})
179

180
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
181

182
183
add_executable(mutexLtrace threading/MutexLtrace.cpp)
target_link_libraries (mutexLtrace ctacommon)