forked from Cisco-Talos/clamav
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
134 lines (122 loc) · 3.38 KB
/
Copy pathCMakeLists.txt
File metadata and controls
134 lines (122 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Copyright (C) 2019-2023 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
add_compile_definitions(RARDLL)
add_compile_definitions(WARN_DLOPEN_FAIL)
add_compile_definitions(_FILE_OFFSET_BITS=64)
if(WIN32)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
# not using an object library for the sake of Xcode compatibility
# See: https://cmake.org/pipermail/cmake/2016-May/063479.html
set( UNRAR_SOURCES
archive.cpp
arcread.cpp
blake2s.cpp
cmddata.cpp
consio.cpp
crc.cpp
crypt.cpp
dll.cpp
encname.cpp
errhnd.cpp
extinfo.cpp
extract.cpp
filcreat.cpp
file.cpp
filefn.cpp
filestr.cpp
find.cpp
getbits.cpp
global.cpp
hash.cpp
headers.cpp
list.cpp
match.cpp
options.cpp
pathfn.cpp
qopen.cpp
rar.cpp
rarvm.cpp
rawread.cpp
rdwrfn.cpp
recvol.cpp
resource.cpp
rijndael.cpp
rs.cpp
rs16.cpp
scantree.cpp
secpassword.cpp
sha1.cpp
sha256.cpp
smallfn.cpp
strfn.cpp
strlist.cpp
system.cpp
threadpool.cpp
timefn.cpp
ui.cpp
unicode.cpp
unpack.cpp
volume.cpp
)
if(WIN32)
list(APPEND UNRAR_SOURCES isnt.cpp)
endif()
if(ENABLE_SHARED_LIB)
# The unrar shared library.
add_library( clamunrar SHARED )
set_target_properties(clamunrar PROPERTIES
VERSION ${LIBCLAMAV_VERSION}
SOVERSION ${LIBCLAMAV_SOVERSION})
target_sources( clamunrar
PRIVATE
${UNRAR_SOURCES}
PUBLIC
rar.hpp
dll.hpp )
target_include_directories( clamunrar
PRIVATE "${CMAKE_BINARY_DIR}"
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" )
if(NOT WIN32)
set_target_properties( clamunrar PROPERTIES
COMPILE_FLAGS "-Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else")
endif()
if (APPLE AND CLAMAV_SIGN_FILE)
set_target_properties( clamunrar PROPERTIES
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${CODE_SIGN_IDENTITY}
XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${DEVELOPMENT_TEAM_ID}
)
endif()
if(WIN32)
set_target_properties(clamunrar PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
elseif(UNIX AND NOT APPLE)
target_link_options(clamunrar PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libclamunrar.map")
endif()
if(WIN32)
install(TARGETS clamunrar DESTINATION . COMPONENT libraries)
install(FILES $<TARGET_PDB_FILE:clamunrar> DESTINATION . OPTIONAL COMPONENT libraries)
else()
install(TARGETS clamunrar DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
endif()
add_library( ClamAV::libunrar ALIAS clamunrar )
endif()
if(ENABLE_STATIC_LIB)
# The clamunrar static library.
add_library( clamunrar_static STATIC)
target_sources( clamunrar_static
PRIVATE
${UNRAR_SOURCES}
PUBLIC
rar.hpp
dll.hpp )
target_include_directories( clamunrar_static
PRIVATE "${CMAKE_BINARY_DIR}"
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" )
if(NOT WIN32)
set_target_properties( clamunrar_static PROPERTIES
COMPILE_FLAGS "-Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else")
endif()
add_library( ClamAV::libunrar_static ALIAS clamunrar_static )
if(NOT ENABLE_SHARED_LIB)
add_library( ClamAV::libunrar ALIAS clamunrar_static )
endif()
endif()