CMakeLists.txt 4.68 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
set_source_files_properties(CRC.cpp PROPERTIES COMPILE_FLAGS -O2)

28
set (COMMON_LIB_SRC_FILES
29
30
31
  dataStructures/AdminHost.cpp
  dataStructures/AdminUser.cpp
  dataStructures/ArchiveFile.cpp
Steven Murray's avatar
Steven Murray committed
32
  dataStructures/ArchiveFileQueueCriteria.cpp
33
  dataStructures/ArchiveFileSummary.cpp
34
35
36
37
38
  dataStructures/ArchiveJob.cpp
  dataStructures/ArchiveRequest.cpp
  dataStructures/ArchiveRoute.cpp
  dataStructures/CancelRetrieveRequest.cpp
  dataStructures/DeleteArchiveRequest.cpp
39
  dataStructures/DiskFileInfo.cpp
40
  dataStructures/DriveState.cpp
41
  dataStructures/DriveStatus.cpp
42
  dataStructures/EntryLog.cpp
43
  dataStructures/FrontendReturnCode.cpp
44
  dataStructures/ListStorageClassRequest.cpp
45
  dataStructures/LogicalLibrary.cpp
46
  dataStructures/MountType.cpp
47
  dataStructures/MountPolicy.cpp
48
49
  dataStructures/ReadTestResult.cpp
  dataStructures/RepackInfo.cpp
50
  dataStructures/RepackType.cpp
51
52
  dataStructures/RequesterGroupMountRule.cpp
  dataStructures/RequesterMountRule.cpp
53
54
55
56
57
  dataStructures/RetrieveJob.cpp
  dataStructures/RetrieveRequest.cpp
  dataStructures/SecurityIdentity.cpp
  dataStructures/StorageClass.cpp
  dataStructures/Tape.cpp
58
  dataStructures/TapeFile.cpp
59
  dataStructures/TapeLog.cpp
60
  dataStructures/TapePool.cpp
61
  dataStructures/TestSourceType.cpp
62
  dataStructures/UpdateFileInfoRequest.cpp
63
  dataStructures/UpdateFileStorageClassRequest.cpp
64
65
66
  dataStructures/UserIdentity.cpp
  dataStructures/VerifyInfo.cpp
  dataStructures/WriteTestResult.cpp
67
  dataStructures/utils.cpp
68
69
70
71
  admin/AdminHost.cpp
  admin/AdminUser.cpp
  archiveRoutes/ArchiveRoute.cpp
  checksum/Checksum.cpp
Eric Cano's avatar
Eric Cano committed
72
73
74
  exception/Backtrace.cpp
  exception/Errnum.cpp
  exception/Exception.cpp
75
  exception/NonRetryableError.cpp
76
77
  exception/RetryableError.cpp
  exception/UserError.cpp
78
  exception/AcceptConnectionInterrupted.cpp
79
  exception/BadAlloc.cpp
80
  exception/CommandLineNotParsed.cpp
81
  exception/InvalidArgument.cpp
82
  exception/InvalidConfigEntry.cpp
83
  exception/MissingOperand.cpp
84
  exception/NoEntry.cpp
85
  exception/NoPortInRange.cpp
86
  exception/NotAnOwner.cpp
87
  exception/OutOfMemory.cpp
88
  exception/TimeOut.cpp
89
90
91
92
93
94
95
  log/DummyLogger.cpp
  log/LogContext.cpp
  log/Logger.cpp
  log/Message.cpp
  log/Param.cpp
  log/StringLogger.cpp
  log/SyslogLogger.cpp
96
  log/StdoutLogger.cpp
97
98
99
  priorities/DriveQuota.cpp
  priorities/MountCriteria.cpp
  priorities/UserGroup.cpp
100
  processCap/ProcessCap.cpp
101
  processCap/ProcessCapDummy.cpp
102
  processCap/SmartCap.cpp
103
104
105
  remoteFS/RemoteFileStatus.cpp
  remoteFS/RemotePath.cpp
  remoteFS/RemotePathAndStatus.cpp
Steven Murray's avatar
Steven Murray committed
106
  SmartFd.cpp
107
  CRC.cpp
Eric Cano's avatar
Eric Cano committed
108
  threading/ChildProcess.cpp
109
  threading/Daemon.cpp
Eric Cano's avatar
Eric Cano committed
110
  threading/Mutex.cpp
111
  threading/SocketPair.cpp
112
  threading/System.cpp
113
  threading/Threading.cpp
114
  threading/Semaphores.cpp
115
  utils/utils.cpp
116
117
118
119
120
  utils/strerror_r_wrapper.cpp
  CreationLog.cpp
  Configuration.cpp
  TapePool.cpp
  Timer.cpp
121
  UserIdentity.cpp
122
  VO.cpp)
Eric Cano's avatar
Eric Cano committed
123

124
125
add_library (ctacommon SHARED
  ${COMMON_LIB_SRC_FILES})
126
install (TARGETS ctacommon DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
Eric Cano's avatar
Eric Cano committed
127

128
target_link_libraries (ctacommon
129
  ctautils
Steven Murray's avatar
Steven Murray committed
130
  pthread
131
  uuid
132
  z
133
134
  Utils
  cap)
Eric Cano's avatar
Eric Cano committed
135

136
set (COMMON_UNIT_TESTS_LIB_SRC_FILES
137
  checksum/ChecksumTest.cpp
138
  dataStructures/ArchiveFileTest.cpp
139
  dataStructures/StorageClassTest.cpp
140
  processCap/SmartCapTest.cpp
141
142
143
  log/LogContextTest.cpp
  log/ParamTest.cpp
  log/SyslogLoggerTest.cpp
144
  log/StringLoggerTest.cpp
145
  remoteFS/RemotePathTest.cpp
Steven Murray's avatar
Steven Murray committed
146
  SmartFdTest.cpp
147
  CRCTest.cpp
148
  threading/DaemonTest.cpp
149
  threading/SocketPairTest.cpp
150
151
152
153
154
  threading/ThreadingBlockingQTests.cpp
# threading/ThreadingMPTests.cpp is commented out because of errors caused by libust
  threading/ThreadingMTTests.cpp
  threading/ThreadingTests.cpp
  threading/AtomicCounterTest.cpp
155
  utils/UtilsTest.cpp
156
157
  UserIdentityTest.cpp
  optionalTest.cpp)
Eric Cano's avatar
Eric Cano committed
158

159
160
add_library (ctacommonunittests SHARED
  ${COMMON_UNIT_TESTS_LIB_SRC_FILES})
161

162
install(TARGETS ctacommonunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
163