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 9325 - (hide annotations) (download)
Tue Jun 29 15:20:36 2021 UTC (2 years, 9 months ago) by zmatsuo
File MIME type: text/plain
File size: 4859 byte(s)
layer for unicode をライブラリに分離

- Windows 9xをサポートするためのパートをライブラリとして切り出し
  - MSUL(unicows.lib)と同様に、ライブラリをリンクするだけで 9x をサポート
  - Tera Term のソース(layer for unicode 以外の部分)では 9x を気にする必要がなくなった
- vs2005 のプロジェクトを調整
- CMakeLists.txt 調整
  - VS2005 を使用しないと 95での起動はできない
  - しかしVS2005をサポートしている 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 add_library(
9 zmatsuo 9129 ${PACKAGE_NAME} SHARED
10 zmatsuo 7456 )
11    
12 zmatsuo 7952 target_sources(
13 zmatsuo 9129 ${PACKAGE_NAME}
14 zmatsuo 7952 PRIVATE
15 zmatsuo 7456 ${CMAKE_CURRENT_BINARY_DIR}/puttyversion.h
16     ../matcher/matcher.c
17     arc4random.c
18     arc4random.h
19     auth.c
20     auth.h
21     buffer.c
22     buffer.h
23     chacha.c
24     chacha.h
25 nmaya 9255 cipher-3des1.c
26     cipher-chachapoly-libcrypto.c
27     cipher-chachapoly.h
28     cipher-ctr.c
29     cipher.c
30 zmatsuo 7456 cipher.h
31 nmaya 9255 comp.c
32     comp.h
33 zmatsuo 7456 config.h
34     crypt.c
35     crypt.h
36     dns.c
37     dns.h
38     ed25519.c
39     ed25519_bcrypt_pbkdf.c
40     ed25519_blf.h
41     ed25519_blocks.c
42     ed25519_blowfish.c
43     ed25519_crypto_api.h
44     ed25519_fe25519.c
45     ed25519_fe25519.h
46     ed25519_ge25519.c
47     ed25519_ge25519.h
48     ed25519_hash.c
49     ed25519_sc25519.c
50     ed25519_sc25519.h
51     ed25519_verify.c
52 nmaya 9255 fwd-socks.c
53     fwd-socks.h
54 zmatsuo 7456 fwd.c
55     fwd.h
56     fwdui.c
57     fwdui.h
58 nmaya 9255 hostkey.c
59     hostkey.h
60 zmatsuo 7456 hosts.c
61     hosts.h
62     kex.c
63     kex.h
64     key.c
65     key.h
66     keyfiles.c
67     keyfiles.h
68 zmatsuo 9266 keyfiles-putty.c
69     keyfiles-putty.h
70 nmaya 9255 mac.c
71     mac.h
72 zmatsuo 7456 pkt.c
73     pkt.h
74 nmaya 9255 poly1305.c
75     poly1305.h
76 zmatsuo 7456 resource.h
77     sftp.c
78     sftp.h
79     ssh.c
80     ssh.h
81 nmaya 9255 ssherr.c
82     ssherr.h
83     ttxssh-version.h
84     ttxssh-version.rc
85 zmatsuo 7456 ttxssh.c
86     ttxssh.def
87     ttxssh.h
88     ttxssh.rc
89     util.c
90     util.h
91     x11util.c
92     x11util.h
93     ${COMMON_SRC}
94     )
95    
96 zmatsuo 7952 target_sources(
97 zmatsuo 9129 ${PACKAGE_NAME}
98 zmatsuo 7952 PRIVATE
99     ../../teraterm/teraterm/WSAAsyncGetAddrInfo.c
100     ../../teraterm/common/ttcommon.h
101     ../../teraterm/common/i18n.h
102     ../../teraterm/common/ttlib.h
103     ../../teraterm/common/ttlib.c
104     ../../teraterm/common/dlglib.h
105     ../../teraterm/common/servicenames.h
106     ../../teraterm/common/codeconv.h
107     ../../teraterm/common/tipwin.h
108 doda 8445 ../../teraterm/common/compat_win.h
109     ../../teraterm/common/dllutil.h
110 zmatsuo 7952 )
111 zmatsuo 7456
112 zmatsuo 7952 source_group(
113     "common"
114     REGULAR_EXPRESSION
115     "teraterm\/common\/")
116    
117 zmatsuo 9129 if(SUPPORT_OLD_WINDOWS)
118     if(MSVC)
119 zmatsuo 9325 if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
120     set(CMAKE_C_STANDARD_LIBRARIES "")
121     set(CMAKE_CXX_STANDARD_LIBRARIES "")
122     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB")
123     else()
124     target_link_options(
125     ${PACKAGE_NAME}
126     PRIVATE
127     /NODEFAULTLIB
128     )
129     endif()
130 zmatsuo 9129 target_sources(
131     ${PACKAGE_NAME}
132     PRIVATE
133     ../../teraterm/common/compat_w95_vs2005.c
134     )
135     endif()
136 zmatsuo 9136 if(MINGW)
137     target_sources(
138     ${PACKAGE_NAME}
139     PRIVATE
140     ../../teraterm/libmingw/tlssup.c
141     )
142     target_link_libraries(
143     ${PACKAGE_NAME}
144     PRIVATE
145     -Wl,--whole-archive
146     mingw_msvcrt
147     -Wl,--no-whole-archive
148     )
149     endif()
150 zmatsuo 9129 endif(SUPPORT_OLD_WINDOWS)
151    
152 zmatsuo 7952 target_include_directories(
153 zmatsuo 9129 ${PACKAGE_NAME}
154 zmatsuo 7952 PRIVATE
155 zmatsuo 7456 ../../teraterm/teraterm
156     ../../teraterm/common
157     ../matcher
158     ../putty
159     ${OPENSSL_INCLUDE_DIRS}
160     ${ZLIB_INCLUDE_DIRS}
161 zmatsuo 7952 )
162 zmatsuo 7456
163 zmatsuo 7536 set_target_properties(
164 zmatsuo 9129 ${PACKAGE_NAME}
165 zmatsuo 7536 PROPERTIES
166     PREFIX ""
167 zmatsuo 9129 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/"
168 zmatsuo 7536 )
169    
170 zmatsuo 7952 target_compile_definitions(
171 zmatsuo 9129 ${PACKAGE_NAME}
172 zmatsuo 7952 PRIVATE
173     $<$<CONFIG:Debug>:_CRTDBG_MAP_ALLOC>
174     )
175    
176 zmatsuo 9129 if(MINGW)
177     target_link_options(
178     ttxssh
179     PRIVATE
180     -Wl,-Map=ttxssh.map,-cref
181     )
182     endif()
183    
184 zmatsuo 7456 target_link_libraries(
185 zmatsuo 9129 ${PACKAGE_NAME}
186 zmatsuo 8565 PRIVATE
187     common_static
188 zmatsuo 7456 libputty
189     ttpcmn
190 zmatsuo 9266 argon2
191 zmatsuo 7952 ${ZLIB_LIB}
192 zmatsuo 7456 ${OPENSSL_LIB}
193 zmatsuo 9325 )
194    
195     if(SUPPORT_OLD_WINDOWS)
196     target_link_libraries(
197     ${PACKAGE_NAME}
198     PRIVATE
199     layer_for_unicode
200     )
201     endif()
202    
203     target_link_libraries(
204     ${PACKAGE_NAME}
205     PRIVATE
206 zmatsuo 7456 ws2_32
207     gdi32
208     comdlg32
209 doda 8445 comctl32
210 zmatsuo 8332 # OpenSSL が使用
211     crypt32.lib # TODO このlibを使用しないパッチを適応したら削除すること
212 zmatsuo 7456 )
213    
214     ### create puttyversion.h
215    
216 zmatsuo 7532 set(PUTTY_ISS "${CMAKE_SOURCE_DIR}/libs/putty/windows/putty.iss")
217     if(NOT EXISTS ${PUTTY_ISS})
218     message(FATAL_ERROR "${PUTTY_ISS} not found")
219     endif()
220    
221 zmatsuo 7456 file(READ "${CMAKE_SOURCE_DIR}/libs/putty/windows/putty.iss" iis)
222    
223     string(REGEX MATCH "VersionInfoTextVersion=([^\n]+)\n" _ ${iis})
224     set(version_str ${CMAKE_MATCH_1})
225     if("${version_str}" STREQUAL "")
226     string(REGEX MATCH "AppVerName=([^\n]+)\n" _ ${iis})
227     set(version_str ${CMAKE_MATCH_1})
228     endif()
229     if("${version_str}" STREQUAL "")
230     set(version_str "unknown")
231     endif()
232     message("putty version=\"${version_str}\"")
233     FILE(
234     WRITE ${CMAKE_CURRENT_BINARY_DIR}/puttyversion.h
235     "#define PUTTYVERSION \"${version_str}\"\n"
236     )
237 zmatsuo 7990
238     install(
239     TARGETS ttxssh
240     RUNTIME
241     DESTINATION .
242     )
243 zmatsuo 8681
244     ####
245     # ソースツリー内に生成ファイルが存在していたら削除する
246     if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ttssh2/ttxssh/puttyversion.h")
247     file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/ttssh2/ttxssh/puttyversion.h")
248     endif()

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