• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision8070 (tree)
Time2019-09-06 22:02:30
Authorzmatsuo

Log Message

cmake からヘルプ(chm)を生成

- perl とヘルプコンパイラ(hhc)を使用
- msys2(mingw)からも chm が生成できるようになった
- cmake で作るスナップショットにヘルプを同梱できるようになった

Change Summary

Incremental Difference

--- trunk/CMakeLists.txt (revision 8069)
+++ trunk/CMakeLists.txt (revision 8070)
@@ -110,6 +110,7 @@
110110 add_subdirectory(TTXSamples)
111111 endif()
112112 add_subdirectory(installer)
113+add_subdirectory(doc)
113114
114115 ####
115116 # ソースツリー内に生成ファイルが存在していたら削除する
--- trunk/doc/CMakeLists.txt (nonexistent)
+++ trunk/doc/CMakeLists.txt (revision 8070)
@@ -0,0 +1,120 @@
1+if (MSVC OR ("$ENV{MSYSTEM}" MATCHES "MINGW"))
2+ find_program(
3+ PERL perl.exe
4+ HINTS c:/Perl64/bin
5+ HINTS c:/Perl/bin
6+ HINTS c:/cygwin/usr/bin
7+ HINTS c:/cygwin64/usr/bin
8+ )
9+ file(TO_NATIVE_PATH ${PERL} PERL)
10+ find_program(
11+ HHC hhc.exe
12+ HINTS "C:/Program Files (x86)/HTML Help Workshop"
13+ HINTS "C:/Program Files/HTML Help Workshop"
14+ HINTS "$ENV{ProgramFiles}/HTML Help Workshop"
15+ HINTS "$ENV{ProgramFiles\(x86\)}/HTML Help Workshop"
16+ )
17+else()
18+ set(HHC "HHC-NOTFOUND")
19+endif()
20+
21+if (NOT("${PERL}" STREQUAL "PERL-NOTFOUND") AND NOT("${HHC}" STREQUAL "HHC-NOTFOUND"))
22+ file(
23+ GLOB_RECURSE
24+ SRC_EN
25+ LIST_DIRECTORIES false
26+ en/*.html en/*.md en/*.png en/*.hhc en/*.hhp
27+ )
28+
29+ file(
30+ GLOB_RECURSE
31+ SRC_JP
32+ LIST_DIRECTORIES false
33+ ja/*.html ja/*.md ja/*.png ja/*.hhc ja/*.hhp
34+ )
35+
36+ add_custom_target(
37+ teraterm_chm ALL
38+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/en/teraterm.chm
39+ SOURCES ${SRC_EN}
40+ SOURCES htmlhelp_index_make.pl
41+ SOURCES htmlhelp_update_check.pl
42+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
43+ COMMENT Generate "${CMAKE_CURRENT_BINARY_DIR}/teraterm.chm"
44+ )
45+
46+ add_custom_target(
47+ teratermj_chm ALL
48+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ja/teratermj.chm
49+ SOURCES htmlhelp_index_make.pl
50+ SOURCES htmlhelp_update_check.pl
51+ SOURCES ${SRC_JP}
52+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
53+ COMMENT Generate "${CMAKE_CURRENT_BINARY_DIR}/teratermj.chm"
54+ )
55+
56+ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_EN})
57+ source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_JP})
58+
59+ add_custom_command(
60+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/en/teraterm.chm
61+ COMMAND ${PERL} ../installer/2sjis.pl -i ../libs/oniguruma/COPYING -o en/html/reference/Oniguruma-LICENSE.txt -l unix
62+ COMMAND ${PERL} ../installer/2sjis.pl -i ../libs/oniguruma/doc/RE.ja -o en/html/reference/RE.txt -c utf8 -l unix
63+ COMMAND ${PERL} ../installer/2sjis.pl -i ../libs/openssl/LICENSE -o en/html/reference/OpenSSL-LICENSE.txt -l unix
64+ COMMAND ${PERL} ../installer/2sjis.pl -i ../libs/putty/LICENCE -o en/html/reference/PuTTY-LICENSE.txt -l crlf
65+ COMMAND ${PERL} ../installer/2sjis.pl -i ../libs/SFMT/LICENSE.txt -o en/html/reference/SFMT-LICENSE.txt -l unix
66+ COMMAND ${PERL} ../installer/2sjis.pl -i ../cygterm/COPYING -o en/html/reference/CygTerm+-LICENSE.txt -l unix
67+ COMMAND ${PERL} ../installer/copy-zliblicense.pl -i ../libs/zlib/README -o en/html/reference/zlib-LICENSE.txt -l unix
68+ COMMAND ${PERL} -C0 -pe "s/^\\xef\\xbb\\xbf//" en/html/reference/build_with_cmake.md | ${PERL} Markdown_1.0.1/Markdown.pl > en/html/reference/build_with_cmake_utf8.html
69+ COMMAND ${PERL} ../installer/2sjis.pl -i en/html/reference/build_with_cmake_utf8.html -o en/html/reference/build_with_cmake.html -c utf8
70+ COMMAND ${PERL} -C0 -pe "s/^\\xef\\xbb\\xbf//" en/html/reference/build_library_with_cmake.md | ${PERL} Markdown_1.0.1/Markdown.pl > en/html/reference/build_library_with_cmake_utf8.html
71+ COMMAND ${PERL} ../installer/2sjis.pl -i en/html/reference/build_library_with_cmake_utf8.html -o en/html/reference/build_library_with_cmake.html -c utf8
72+ COMMAND ${PERL} htmlhelp_index_make.pl en html > en/Index.hhk
73+ COMMAND ${HHC} en/teraterm.hhp || (exit 0)
74+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
75+ COMMENT Generate "${CMAKE_CURRENT_BINARY_DIR}/teraterm.chm"
76+ )
77+
78+ add_custom_command(
79+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/ja/teratermj.chm
80+ COMMAND ${PERL} ../installer/2sjis.pl -i ../libs/oniguruma/COPYING -o ja/html/reference/Oniguruma-LICENSE.txt -l unix
81+ COMMAND ${PERL} ../installer/2sjis.pl -i ../libs/oniguruma/doc/RE.ja -o ja/html/reference/RE.txt -c utf8 -l unix
82+ COMMAND ${PERL} ../installer/2sjis.pl -i ../libs/openssl/LICENSE -o ja/html/reference/OpenSSL-LICENSE.txt -l unix
83+ COMMAND ${PERL} ../installer/2sjis.pl -i ../libs/putty/LICENCE -o ja/html/reference/PuTTY-LICENSE.txt -l crlf
84+ COMMAND ${PERL} ../installer/2sjis.pl -i ../libs/SFMT/LICENSE.txt -o ja/html/reference/SFMT-LICENSE.txt -l unix
85+ COMMAND ${PERL} ../installer/2sjis.pl -i ../cygterm/COPYING -o ja/html/reference/CygTerm+-LICENSE.txt -l unix
86+ COMMAND ${PERL} ../installer/copy-zliblicense.pl -i ../libs/zlib/README -o ja/html/reference/zlib-LICENSE.txt -l unix
87+ COMMAND ${PERL} -C0 -pe "s/^\\xef\\xbb\\xbf//" ja/html/reference/build_with_cmake.md | ${PERL} Markdown_1.0.1/Markdown.pl > ja/html/reference/build_with_cmake_utf8.html
88+ COMMAND ${PERL} ../installer/2sjis.pl -i ja/html/reference/build_with_cmake_utf8.html -o ja/html/reference/build_with_cmake.html -c utf8
89+ COMMAND ${PERL} -C0 -pe "s/^\\xef\\xbb\\xbf//" ja/html/reference/build_library_with_cmake.md | ${PERL} Markdown_1.0.1/Markdown.pl > ja/html/reference/build_library_with_cmake_utf8.html
90+ COMMAND ${PERL} ../installer/2sjis.pl -i ja/html/reference/build_library_with_cmake_utf8.html -o ja/html/reference/build_library_with_cmake.html -c utf8
91+ COMMAND ${PERL} htmlhelp_index_make.pl ja html > ja/Index.hhk
92+ COMMAND ${HHC} ja/teraterm.hhp || (exit 0)
93+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
94+ COMMENT Generate "${CMAKE_CURRENT_BINARY_DIR}/teratermj.chm"
95+ )
96+
97+ install(
98+ FILES
99+ ${CMAKE_CURRENT_SOURCE_DIR}/ja/teratermj.chm
100+ ${CMAKE_CURRENT_SOURCE_DIR}/en/teraterm.chm
101+ DESTINATION .
102+ )
103+
104+else()
105+
106+ # chmが存在したらコピーする
107+ if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ja/teraterm.chm)
108+ install(
109+ FILES ${CMAKE_CURRENT_SOURCE_DIR}/ja/teraterm.chm
110+ DESTINATION .
111+ )
112+ endif()
113+ if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ja/teratermj.chm)
114+ install(
115+ FILES ${CMAKE_CURRENT_SOURCE_DIR}/ja/teratermj.chm
116+ DESTINATION .
117+ )
118+ endif()
119+
120+endif()
Show on old repository browser