Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/ttssh2/ttxssh/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9266 - (show annotations) (download)
Thu May 20 14:56:29 2021 UTC (2 years, 10 months ago) by zmatsuo
File MIME type: text/plain
File size: 4503 byte(s)
cmakeビルドできるよう修正 (PPK3対応)

- PPK3 = PuTTY private key format version 3
- r9258 を cmake でビルドできるよう調整
1 set(PACKAGE_NAME "ttxssh")
2
3 project(${PACKAGE_NAME})
4
5 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_zlib.cmake)
6 include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_openssl.cmake)
7
8 if (MSVC)
9 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:user32.dll")
10 endif()
11
12 add_library(
13 ${PACKAGE_NAME} SHARED
14 )
15
16 target_sources(
17 ${PACKAGE_NAME}
18 PRIVATE
19 ${CMAKE_CURRENT_BINARY_DIR}/puttyversion.h
20 ../matcher/matcher.c
21 arc4random.c
22 arc4random.h
23 auth.c
24 auth.h
25 buffer.c
26 buffer.h
27 chacha.c
28 chacha.h
29 cipher-3des1.c
30 cipher-chachapoly-libcrypto.c
31 cipher-chachapoly.h
32 cipher-ctr.c
33 cipher.c
34 cipher.h
35 comp.c
36 comp.h
37 config.h
38 crypt.c
39 crypt.h
40 dns.c
41 dns.h
42 ed25519.c
43 ed25519_bcrypt_pbkdf.c
44 ed25519_blf.h
45 ed25519_blocks.c
46 ed25519_blowfish.c
47 ed25519_crypto_api.h
48 ed25519_fe25519.c
49 ed25519_fe25519.h
50 ed25519_ge25519.c
51 ed25519_ge25519.h
52 ed25519_hash.c
53 ed25519_sc25519.c
54 ed25519_sc25519.h
55 ed25519_verify.c
56 fwd-socks.c
57 fwd-socks.h
58 fwd.c
59 fwd.h
60 fwdui.c
61 fwdui.h
62 hostkey.c
63 hostkey.h
64 hosts.c
65 hosts.h
66 kex.c
67 kex.h
68 key.c
69 key.h
70 keyfiles.c
71 keyfiles.h
72 keyfiles-putty.c
73 keyfiles-putty.h
74 mac.c
75 mac.h
76 pkt.c
77 pkt.h
78 poly1305.c
79 poly1305.h
80 resource.h
81 sftp.c
82 sftp.h
83 ssh.c
84 ssh.h
85 ssherr.c
86 ssherr.h
87 ttxssh-version.h
88 ttxssh-version.rc
89 ttxssh.c
90 ttxssh.def
91 ttxssh.h
92 ttxssh.rc
93 util.c
94 util.h
95 x11util.c
96 x11util.h
97 ${COMMON_SRC}
98 )
99
100 target_sources(
101 ${PACKAGE_NAME}
102 PRIVATE
103 ../../teraterm/teraterm/WSAAsyncGetAddrInfo.c
104 ../../teraterm/common/ttcommon.h
105 ../../teraterm/common/i18n.h
106 ../../teraterm/common/ttlib.h
107 ../../teraterm/common/ttlib.c
108 ../../teraterm/common/dlglib.h
109 ../../teraterm/common/servicenames.h
110 ../../teraterm/common/codeconv.h
111 ../../teraterm/common/tipwin.h
112 ../../teraterm/common/layer_for_unicode.h
113 ../../teraterm/common/compat_win.h
114 ../../teraterm/common/dllutil.h
115 )
116
117 source_group(
118 "common"
119 REGULAR_EXPRESSION
120 "teraterm\/common\/")
121
122 if(SUPPORT_OLD_WINDOWS)
123 if(MSVC)
124 target_sources(
125 ${PACKAGE_NAME}
126 PRIVATE
127 ../../teraterm/common/compat_w95_vs2005.c
128 )
129 endif()
130 if(MINGW)
131 target_sources(
132 ${PACKAGE_NAME}
133 PRIVATE
134 ../../teraterm/libmingw/tlssup.c
135 )
136 target_link_libraries(
137 ${PACKAGE_NAME}
138 PRIVATE
139 -Wl,--whole-archive
140 mingw_msvcrt
141 -Wl,--no-whole-archive
142 )
143 endif()
144 endif(SUPPORT_OLD_WINDOWS)
145
146 target_include_directories(
147 ${PACKAGE_NAME}
148 PRIVATE
149 ../../teraterm/teraterm
150 ../../teraterm/common
151 ../matcher
152 ../putty
153 ${OPENSSL_INCLUDE_DIRS}
154 ${ZLIB_INCLUDE_DIRS}
155 )
156
157 set_target_properties(
158 ${PACKAGE_NAME}
159 PROPERTIES
160 PREFIX ""
161 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/"
162 )
163
164 target_compile_definitions(
165 ${PACKAGE_NAME}
166 PRIVATE
167 $<$<CONFIG:Debug>:_CRTDBG_MAP_ALLOC>
168 )
169
170 if(MINGW)
171 target_link_options(
172 ttxssh
173 PRIVATE
174 -Wl,-Map=ttxssh.map,-cref
175 )
176 endif()
177
178 target_link_libraries(
179 ${PACKAGE_NAME}
180 PRIVATE
181 common_static
182 libputty
183 ttpcmn
184 argon2
185 ${ZLIB_LIB}
186 ${OPENSSL_LIB}
187 #
188 ws2_32
189 gdi32
190 comdlg32
191 delayimp
192 comctl32
193 # OpenSSL が使用
194 crypt32.lib # TODO このlibを使用しないパッチを適応したら削除すること
195 )
196
197 ### create puttyversion.h
198
199 set(PUTTY_ISS "${CMAKE_SOURCE_DIR}/libs/putty/windows/putty.iss")
200 if(NOT EXISTS ${PUTTY_ISS})
201 message(FATAL_ERROR "${PUTTY_ISS} not found")
202 endif()
203
204 file(READ "${CMAKE_SOURCE_DIR}/libs/putty/windows/putty.iss" iis)
205
206 string(REGEX MATCH "VersionInfoTextVersion=([^\n]+)\n" _ ${iis})
207 set(version_str ${CMAKE_MATCH_1})
208 if("${version_str}" STREQUAL "")
209 string(REGEX MATCH "AppVerName=([^\n]+)\n" _ ${iis})
210 set(version_str ${CMAKE_MATCH_1})
211 endif()
212 if("${version_str}" STREQUAL "")
213 set(version_str "unknown")
214 endif()
215 message("putty version=\"${version_str}\"")
216 FILE(
217 WRITE ${CMAKE_CURRENT_BINARY_DIR}/puttyversion.h
218 "#define PUTTYVERSION \"${version_str}\"\n"
219 )
220
221 install(
222 TARGETS ttxssh
223 RUNTIME
224 DESTINATION .
225 )
226
227 ####
228 # ソースツリー内に生成ファイルが存在していたら削除する
229 if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ttssh2/ttxssh/puttyversion.h")
230 file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/ttssh2/ttxssh/puttyversion.h")
231 endif()

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26