Develop and Download Open Source Software

Browse Subversion Repository

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9266 - (hide 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 zmatsuo 9129 set(PACKAGE_NAME "ttxssh")
2 zmatsuo 7456
3 zmatsuo 9129 project(${PACKAGE_NAME})
4 zmatsuo 7456
5     include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_zlib.cmake)
6     include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/lib_openssl.cmake)
7    
8 zmatsuo 7952 if (MSVC)
9 zmatsuo 9126 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:user32.dll")
10 zmatsuo 7456 endif()
11    
12 zmatsuo 7952 add_library(
13 zmatsuo 9129 ${PACKAGE_NAME} SHARED
14 zmatsuo 7456 )
15    
16 zmatsuo 7952 target_sources(
17 zmatsuo 9129 ${PACKAGE_NAME}
18 zmatsuo 7952 PRIVATE
19 zmatsuo 7456 ${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 nmaya 9255 cipher-3des1.c
30     cipher-chachapoly-libcrypto.c
31     cipher-chachapoly.h
32     cipher-ctr.c
33     cipher.c
34 zmatsuo 7456 cipher.h
35 nmaya 9255 comp.c
36     comp.h
37 zmatsuo 7456 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 nmaya 9255 fwd-socks.c
57     fwd-socks.h
58 zmatsuo 7456 fwd.c
59     fwd.h
60     fwdui.c
61     fwdui.h
62 nmaya 9255 hostkey.c
63     hostkey.h
64 zmatsuo 7456 hosts.c
65     hosts.h
66     kex.c
67     kex.h
68     key.c
69     key.h
70     keyfiles.c
71     keyfiles.h
72 zmatsuo 9266 keyfiles-putty.c
73     keyfiles-putty.h
74 nmaya 9255 mac.c
75     mac.h
76 zmatsuo 7456 pkt.c
77     pkt.h
78 nmaya 9255 poly1305.c
79     poly1305.h
80 zmatsuo 7456 resource.h
81     sftp.c
82     sftp.h
83     ssh.c
84     ssh.h
85 nmaya 9255 ssherr.c
86     ssherr.h
87     ttxssh-version.h
88     ttxssh-version.rc
89 zmatsuo 7456 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 zmatsuo 7952 target_sources(
101 zmatsuo 9129 ${PACKAGE_NAME}
102 zmatsuo 7952 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 doda 8445 ../../teraterm/common/layer_for_unicode.h
113     ../../teraterm/common/compat_win.h
114     ../../teraterm/common/dllutil.h
115 zmatsuo 7952 )
116 zmatsuo 7456
117 zmatsuo 7952 source_group(
118     "common"
119     REGULAR_EXPRESSION
120     "teraterm\/common\/")
121    
122 zmatsuo 9129 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 zmatsuo 9136 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 zmatsuo 9129 endif(SUPPORT_OLD_WINDOWS)
145    
146 zmatsuo 7952 target_include_directories(
147 zmatsuo 9129 ${PACKAGE_NAME}
148 zmatsuo 7952 PRIVATE
149 zmatsuo 7456 ../../teraterm/teraterm
150     ../../teraterm/common
151     ../matcher
152     ../putty
153     ${OPENSSL_INCLUDE_DIRS}
154     ${ZLIB_INCLUDE_DIRS}
155 zmatsuo 7952 )
156 zmatsuo 7456
157 zmatsuo 7536 set_target_properties(
158 zmatsuo 9129 ${PACKAGE_NAME}
159 zmatsuo 7536 PROPERTIES
160     PREFIX ""
161 zmatsuo 9129 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/"
162 zmatsuo 7536 )
163    
164 zmatsuo 7952 target_compile_definitions(
165 zmatsuo 9129 ${PACKAGE_NAME}
166 zmatsuo 7952 PRIVATE
167     $<$<CONFIG:Debug>:_CRTDBG_MAP_ALLOC>
168     )
169    
170 zmatsuo 9129 if(MINGW)
171     target_link_options(
172     ttxssh
173     PRIVATE
174     -Wl,-Map=ttxssh.map,-cref
175     )
176     endif()
177    
178 zmatsuo 7456 target_link_libraries(
179 zmatsuo 9129 ${PACKAGE_NAME}
180 zmatsuo 8565 PRIVATE
181     common_static
182 zmatsuo 7456 libputty
183     ttpcmn
184 zmatsuo 9266 argon2
185 zmatsuo 7952 ${ZLIB_LIB}
186 zmatsuo 7456 ${OPENSSL_LIB}
187     #
188     ws2_32
189     gdi32
190     comdlg32
191     delayimp
192 doda 8445 comctl32
193 zmatsuo 8332 # OpenSSL が使用
194     crypt32.lib # TODO このlibを使用しないパッチを適応したら削除すること
195 zmatsuo 7456 )
196    
197     ### create puttyversion.h
198    
199 zmatsuo 7532 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 zmatsuo 7456 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 zmatsuo 7990
221     install(
222     TARGETS ttxssh
223     RUNTIME
224     DESTINATION .
225     )
226 zmatsuo 8681
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