CMakeLists.txt 5.13 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
52
  dataStructures/ReadTestResult.cpp
  dataStructures/RepackInfo.cpp
53
  dataStructures/RepackType.cpp
54
55
  dataStructures/RequesterGroupMountRule.cpp
  dataStructures/RequesterMountRule.cpp
56
57
58
59
60
  dataStructures/RetrieveJob.cpp
  dataStructures/RetrieveRequest.cpp
  dataStructures/SecurityIdentity.cpp
  dataStructures/StorageClass.cpp
  dataStructures/Tape.cpp
61
  dataStructures/TapeFile.cpp
62
  dataStructures/TapeLog.cpp
63
  dataStructures/TapePool.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
72
73
74
  admin/AdminHost.cpp
  admin/AdminUser.cpp
  archiveRoutes/ArchiveRoute.cpp
  checksum/Checksum.cpp
Eric Cano's avatar
Eric Cano committed
75
76
77
  exception/Backtrace.cpp
  exception/Errnum.cpp
  exception/Exception.cpp
78
  exception/NonRetryableError.cpp
79
80
  exception/RetryableError.cpp
  exception/UserError.cpp
81
  exception/AcceptConnectionInterrupted.cpp
82
  exception/BadAlloc.cpp
83
  exception/CommandLineNotParsed.cpp
84
  exception/InvalidArgument.cpp
85
  exception/InvalidConfigEntry.cpp
86
  exception/MissingOperand.cpp
87
  exception/NoEntry.cpp
88
  exception/NoPortInRange.cpp
89
  exception/NotAnOwner.cpp
90
  exception/OutOfMemory.cpp
91
  exception/TimeOut.cpp
92
  exception/XrootCl.cpp
93
  log/DummyLogger.cpp
Eric Cano's avatar
Eric Cano committed
94
  log/FileLogger.cpp
95
96
  log/LogContext.cpp
  log/Logger.cpp
Steven Murray's avatar
Steven Murray committed
97
  log/LogLevel.cpp
98
99
100
101
  log/Message.cpp
  log/Param.cpp
  log/StringLogger.cpp
  log/SyslogLogger.cpp
102
  log/StdoutLogger.cpp
103
104
105
  priorities/DriveQuota.cpp
  priorities/MountCriteria.cpp
  priorities/UserGroup.cpp
106
  processCap/ProcessCap.cpp
107
  processCap/ProcessCapDummy.cpp
108
  processCap/SmartCap.cpp
109
110
111
  remoteFS/RemoteFileStatus.cpp
  remoteFS/RemotePath.cpp
  remoteFS/RemotePathAndStatus.cpp
Steven Murray's avatar
Steven Murray committed
112
  SmartFd.cpp
113
  SmartFILEPtr.cpp
114
  CRC.cpp
Eric Cano's avatar
Eric Cano committed
115
  threading/ChildProcess.cpp
116
  threading/Daemon.cpp
Eric Cano's avatar
Eric Cano committed
117
  threading/Mutex.cpp
118
  threading/SocketPair.cpp
119
  threading/System.cpp
120
  threading/Thread.cpp
121
  threading/Semaphores.cpp
122
  threading/SubProcess.cpp
123
  utils/GetOptThreadSafe.cpp
Eric Cano's avatar
Eric Cano committed
124
  utils/Regex.cpp
125
  utils/utils.cpp
126
127
128
129
130
  utils/strerror_r_wrapper.cpp
  CreationLog.cpp
  Configuration.cpp
  TapePool.cpp
  Timer.cpp
131
  UserIdentity.cpp
132
  VO.cpp)
Eric Cano's avatar
Eric Cano committed
133

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

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

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

174
175
add_library (ctacommonunittests SHARED
  ${COMMON_UNIT_TESTS_LIB_SRC_FILES})
176

177
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
178

179
180
add_executable(mutexLtrace threading/MutexLtrace.cpp)
target_link_libraries (mutexLtrace ctacommon)