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 9129 - (hide annotations) (download)
Sat Jan 16 05:21:37 2021 UTC (3 years, 2 months ago) by zmatsuo
File MIME type: text/plain
File size: 3967 byte(s)
VS2005 による Windows 95 のサポート方法を変更

- 各々のソースファイル内の Windows 95 サポート用コードを不要にする
  - ファイルのinclude + 関数呼出をやめる
    - #include "compat_w95.h" を削除
    - DoCover_IsDebuggerPresent() 呼び出しを削除
  - 代わりにファイル(common/compat_w95_vs2005.c)をリンク
- VSプロジェクトファイル
  - プロジェクトから compat_w95.h を削除
  - VS2005プロジェクトに compat_w95_vs2005.c を追加
    - VS2005以外では Windows 95 で動作するバイナリが生成できないので追加は不要
- cmake
  - SUPPORT_OLD_WINDOWS=ON 時、compat_w95_vs2005.c をリンクするよう修正
  - なるべく target_* を使用するよう修正
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     cipher.h
30     cipher-ctr.c
31     config.h
32     crypt.c
33     crypt.h
34     dns.c
35     dns.h
36     ed25519.c
37     ed25519_bcrypt_pbkdf.c
38     ed25519_blf.h
39     ed25519_blocks.c
40     ed25519_blowfish.c
41     ed25519_crypto_api.h
42     ed25519_fe25519.c
43     ed25519_fe25519.h
44     ed25519_ge25519.c
45     ed25519_ge25519.h
46     ed25519_hash.c
47     ed25519_sc25519.c
48     ed25519_sc25519.h
49     ed25519_verify.c
50     fwd.c
51     fwd.h
52     fwd-socks.c
53     fwd-socks.h
54     fwdui.c
55     fwdui.h
56     hosts.c
57     hosts.h
58     kex.c
59     kex.h
60     key.c
61     key.h
62     keyfiles.c
63     keyfiles.h
64     pkt.c
65     pkt.h
66     resource.h
67     sftp.c
68     sftp.h
69     ssh.c
70     ssh.h
71     ttxssh.c
72     ttxssh.def
73     ttxssh.h
74     ttxssh.rc
75     ttxssh-version.h
76     ttxssh-version.rc
77     util.c
78     util.h
79     x11util.c
80     x11util.h
81     ${COMMON_SRC}
82     )
83    
84 zmatsuo 7952 target_sources(
85 zmatsuo 9129 ${PACKAGE_NAME}
86 zmatsuo 7952 PRIVATE
87     ../../teraterm/teraterm/WSAAsyncGetAddrInfo.c
88     ../../teraterm/common/ttcommon.h
89     ../../teraterm/common/i18n.h
90     ../../teraterm/common/ttlib.h
91     ../../teraterm/common/ttlib.c
92     ../../teraterm/common/dlglib.h
93     ../../teraterm/common/servicenames.h
94     ../../teraterm/common/codeconv.h
95     ../../teraterm/common/tipwin.h
96 doda 8445 ../../teraterm/common/layer_for_unicode.h
97     ../../teraterm/common/compat_win.h
98     ../../teraterm/common/dllutil.h
99 zmatsuo 7952 )
100 zmatsuo 7456
101 zmatsuo 7952 source_group(
102     "common"
103     REGULAR_EXPRESSION
104     "teraterm\/common\/")
105    
106 zmatsuo 9129 if(SUPPORT_OLD_WINDOWS)
107     if(MSVC)
108     target_sources(
109     ${PACKAGE_NAME}
110     PRIVATE
111     ../../teraterm/common/compat_w95_vs2005.c
112     )
113     endif()
114     endif(SUPPORT_OLD_WINDOWS)
115    
116 zmatsuo 7952 target_include_directories(
117 zmatsuo 9129 ${PACKAGE_NAME}
118 zmatsuo 7952 PRIVATE
119 zmatsuo 7456 ../../teraterm/teraterm
120     ../../teraterm/common
121     ../matcher
122     ../putty
123     ${OPENSSL_INCLUDE_DIRS}
124     ${ZLIB_INCLUDE_DIRS}
125 zmatsuo 7952 )
126 zmatsuo 7456
127 zmatsuo 7536 set_target_properties(
128 zmatsuo 9129 ${PACKAGE_NAME}
129 zmatsuo 7536 PROPERTIES
130     PREFIX ""
131 zmatsuo 9129 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/"
132 zmatsuo 7536 )
133    
134 zmatsuo 7952 target_compile_definitions(
135 zmatsuo 9129 ${PACKAGE_NAME}
136 zmatsuo 7952 PRIVATE
137     $<$<CONFIG:Debug>:_CRTDBG_MAP_ALLOC>
138     )
139    
140 zmatsuo 9129 if(MINGW)
141     target_link_options(
142     ttxssh
143     PRIVATE
144     -Wl,-Map=ttxssh.map,-cref
145     )
146     endif()
147    
148 zmatsuo 7456 target_link_libraries(
149 zmatsuo 9129 ${PACKAGE_NAME}
150 zmatsuo 8565 PRIVATE
151     common_static
152 zmatsuo 7456 libputty
153     ttpcmn
154 zmatsuo 7952 ${ZLIB_LIB}
155 zmatsuo 7456 ${OPENSSL_LIB}
156     #
157     ws2_32
158     gdi32
159     comdlg32
160     delayimp
161 doda 8445 comctl32
162 zmatsuo 8332 # OpenSSL が使用
163     crypt32.lib # TODO このlibを使用しないパッチを適応したら削除すること
164 zmatsuo 7456 )
165    
166     ### create puttyversion.h
167    
168 zmatsuo 7532 set(PUTTY_ISS "${CMAKE_SOURCE_DIR}/libs/putty/windows/putty.iss")
169     if(NOT EXISTS ${PUTTY_ISS})
170     message(FATAL_ERROR "${PUTTY_ISS} not found")
171     endif()
172    
173 zmatsuo 7456 file(READ "${CMAKE_SOURCE_DIR}/libs/putty/windows/putty.iss" iis)
174    
175     string(REGEX MATCH "VersionInfoTextVersion=([^\n]+)\n" _ ${iis})
176     set(version_str ${CMAKE_MATCH_1})
177     if("${version_str}" STREQUAL "")
178     string(REGEX MATCH "AppVerName=([^\n]+)\n" _ ${iis})
179     set(version_str ${CMAKE_MATCH_1})
180     endif()
181     if("${version_str}" STREQUAL "")
182     set(version_str "unknown")
183     endif()
184     message("putty version=\"${version_str}\"")
185     FILE(
186     WRITE ${CMAKE_CURRENT_BINARY_DIR}/puttyversion.h
187     "#define PUTTYVERSION \"${version_str}\"\n"
188     )
189 zmatsuo 7990
190     install(
191     TARGETS ttxssh
192     RUNTIME
193     DESTINATION .
194     )
195 zmatsuo 8681
196     ####
197     # ソースツリー内に生成ファイルが存在していたら削除する
198     if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ttssh2/ttxssh/puttyversion.h")
199     file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/ttssh2/ttxssh/puttyversion.h")
200     endif()

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