CMakeLists.txt 4.99 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
94
95
  log/DummyLogger.cpp
  log/LogContext.cpp
  log/Logger.cpp
Steven Murray's avatar
Steven Murray committed
96
  log/LogLevel.cpp
97
98
99
100
  log/Message.cpp
  log/Param.cpp
  log/StringLogger.cpp
  log/SyslogLogger.cpp
101
  log/StdoutLogger.cpp
102
103
104
  priorities/DriveQuota.cpp
  priorities/MountCriteria.cpp
  priorities/UserGroup.cpp
105
  processCap/ProcessCap.cpp
106
  processCap/ProcessCapDummy.cpp
107
  processCap/SmartCap.cpp
108
109
110
  remoteFS/RemoteFileStatus.cpp
  remoteFS/RemotePath.cpp
  remoteFS/RemotePathAndStatus.cpp
Steven Murray's avatar
Steven Murray committed
111
  SmartFd.cpp
112
  SmartFILEPtr.cpp
113
  CRC.cpp
Eric Cano's avatar
Eric Cano committed
114
  threading/ChildProcess.cpp
115
  threading/Daemon.cpp
Eric Cano's avatar
Eric Cano committed
116
  threading/Mutex.cpp
117
  threading/SocketPair.cpp
118
  threading/System.cpp
119
  threading/Threading.cpp
120
  threading/Semaphores.cpp
121
  threading/SubProcess.cpp
122
  utils/GetOptThreadSafe.cpp
Eric Cano's avatar
Eric Cano committed
123
  utils/Regex.cpp
124
  utils/utils.cpp
125
126
127
128
129
  utils/strerror_r_wrapper.cpp
  CreationLog.cpp
  Configuration.cpp
  TapePool.cpp
  Timer.cpp
130
  UserIdentity.cpp
131
  VO.cpp)
Eric Cano's avatar
Eric Cano committed
132

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

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

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

172
173
add_library (ctacommonunittests SHARED
  ${COMMON_UNIT_TESTS_LIB_SRC_FILES})
174

175
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
176