• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision10041 (tree)
Zeit2022-07-06 00:18:35
Autorzmatsuo

Log Message

cmake時、ヘルプファイル(chm)の生成を改良した

- ターゲットを分解してパラレルにビルド可能にした
- ファイルの依存関係をチェックして最小のビルドを行うようにした

Ändern Zusammenfassung

Diff

--- trunk/doc/.gitignore (revision 10040)
+++ trunk/doc/.gitignore (revision 10041)
@@ -1,9 +1,7 @@
11 en/Index.hhk
22 en/teraterm.chm
3-en/teraterm.chm.rule
43 ja/Index.hhk
54 ja/teratermj.chm
6-ja/teratermj.chm.rule
75 *.txt
86 *.md
97 *.html
--- trunk/doc/CMakeLists.txt (revision 10040)
+++ trunk/doc/CMakeLists.txt (revision 10041)
@@ -1,4 +1,18 @@
1-if (MSVC OR MINGW)
1+if(CMAKE_HOST_WIN32)
2+ if("${CMAKE_COMMAND}" MATCHES "msys")
3+ # msys
4+ find_program(PERL perl.exe)
5+ else()
6+ find_program(
7+ PERL perl.exe
8+ HINTS ${CMAKE_CURRENT_LIST_DIR}/../buildtools/perl/perl/bin
9+ HINTS c:/Strawberry/perl/bin
10+ HINTS c:/Perl64/bin
11+ HINTS c:/Perl/bin
12+ HINTS c:/cygwin/usr/bin
13+ HINTS c:/cygwin64/usr/bin
14+ )
15+ endif()
216 find_program(
317 HHC hhc.exe
418 HINTS "C:/Program Files (x86)/HTML Help Workshop"
@@ -8,78 +22,23 @@
822 )
923 find_program(
1024 CHMCMD chmcmd
11- HINTS ${CMAKE_CURRENT_LIST_DIR}/../buildtools/chmcmd/
25+ HINTS ${CMAKE_CURRENT_LIST_DIR}/../../buildtools/chmcmd/
1226 )
13-else()
27+else(CMAKE_HOST_WIN32)
28+ find_program(
29+ PERL perl
30+ )
1431 set(HHC "HHC-NOTFOUND")
1532 find_program(
1633 CHMCMD chmcmd
1734 )
35+endif(CMAKE_HOST_WIN32)
36+
37+if ("${PERL}" STREQUAL "PERL-NOTFOUND")
38+ return()
1839 endif()
19-message("hhc=${HHC}")
2040
21-if (NOT("${PERL}" STREQUAL "PERL-NOTFOUND")
22- AND (NOT(("${HHC}" STREQUAL "HHC-NOTFOUND") AND "${CHMCMD}" STREQUAL "CHMCMD-NOTFOUND")))
23- file(
24- GLOB_RECURSE
25- SRC_EN
26- LIST_DIRECTORIES false
27- en/*.html en/*.md en/*.png en/*.hhc en/*.hhp
28- )
29-
30- file(
31- GLOB_RECURSE
32- SRC_JP
33- LIST_DIRECTORIES false
34- ja/*.html ja/*.md ja/*.png ja/*.hhc ja/*.hhp
35- )
36-
37- add_custom_target(
38- chm ALL
39- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/en/teraterm.chm
40- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ja/teratermj.chm
41- SOURCES ${SRC_EN}
42- SOURCES ${SRC_JP}
43- SOURCES htmlhelp_index_make.pl
44- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
45- )
46-
47- source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_EN})
48- source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_JP})
49-
50- add_custom_command(
51- OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/en/teraterm.chm
52- OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/ja/teratermj.chm
53- COMMAND ${CMAKE_COMMAND} -P makechm.cmake
54- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
55- COMMENT Generate "${CMAKE_CURRENT_BINARY_DIR}/teraterm.chm"
56- )
57-
58- set_target_properties(
59- chm
60- PROPERTIES FOLDER doc)
61-
62- install(
63- FILES
64- ${CMAKE_CURRENT_SOURCE_DIR}/ja/teratermj.chm
65- ${CMAKE_CURRENT_SOURCE_DIR}/en/teraterm.chm
66- DESTINATION .
67- )
68-
69-else()
70-
71- # chmが存在したらコピーする
72- if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/en/teraterm.chm)
73- install(
74- FILES ${CMAKE_CURRENT_SOURCE_DIR}/en/teraterm.chm
75- DESTINATION .
76- )
77- endif()
78- if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ja/teratermj.chm)
79- install(
80- FILES ${CMAKE_CURRENT_SOURCE_DIR}/ja/teratermj.chm
81- DESTINATION .
82- )
83- endif()
84-
85-endif()
41+add_subdirectory(en)
42+set_target_properties(chm_en PROPERTIES FOLDER doc)
43+add_subdirectory(ja)
44+set_target_properties(chm_ja PROPERTIES FOLDER doc)
--- trunk/doc/README.md (revision 10040)
+++ trunk/doc/README.md (revision 10041)
@@ -18,9 +18,6 @@
1818 - convert_web.sh
1919 - txt,md を txt,html へ変換、webサーバー用
2020 - [プロジェクトページの更新手順](https://osdn.net/projects/ttssh2/wiki/%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E3%83%9A%E3%83%BC%E3%82%B8%E3%81%AE%E6%9B%B4%E6%96%B0%E6%89%8B%E9%A0%86)
21-- makechm.cmake
22- - chm作成スクリプト
23- - cmake版
2421 - perlスクリプト
2522 - 2sjis.pl
2623 - txt, html変換スクリプト
--- trunk/doc/en/CMakeLists.txt (nonexistent)
+++ trunk/doc/en/CMakeLists.txt (revision 10041)
@@ -0,0 +1,91 @@
1+
2+set(PACKAGE_NAME "chm_en")
3+project(${PACKAGE_NAME})
4+
5+if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
6+ set(BINARY_DIR "${CMAKE_BINARY_DIR}/$<CONFIG>")
7+else()
8+ set(BINARY_DIR "${CMAKE_BINARY_DIR}")
9+endif()
10+
11+set(CONVERTED_FILES "")
12+
13+function(ConvertHTML output depend options)
14+ list(APPEND CONVERTED_FILES ${CMAKE_CURRENT_LIST_DIR}/${output})
15+ set(SCRIPT ${CMAKE_CURRENT_LIST_DIR}/../2sjis.pl)
16+ add_custom_command(
17+ OUTPUT ${CMAKE_CURRENT_LIST_DIR}/${output}
18+ DEPENDS ${CMAKE_CURRENT_LIST_DIR}/${depend}
19+ DEPENDS ${SCRIPT}
20+ COMMAND ${PERL} ${SCRIPT}
21+ -i ${CMAKE_CURRENT_LIST_DIR}/${depend}
22+ -o ${CMAKE_CURRENT_LIST_DIR}/${output}
23+ ${options} --no_utime
24+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
25+ )
26+ set(CONVERTED_FILES ${CONVERTED_FILES} PARENT_SCOPE)
27+endfunction()
28+
29+set(REF "html/reference")
30+ConvertHTML(${REF}/Oniguruma-LICENSE.txt ../../libs/doc_help/Oniguruma-LICENSE.txt "-l;unix")
31+ConvertHTML(${REF}/RE.txt ../../libs/doc_help/en/RE "-l;unix;-c;utf8")
32+ConvertHTML(${REF}/LibreSSL-LICENSE.txt ../../libs/doc_help/LibreSSL-LICENSE.txt "-l;unix")
33+ConvertHTML(${REF}/PuTTY-LICENSE.txt ../../libs/doc_help/PuTTY-LICENSE.txt "-l;crlf")
34+ConvertHTML(${REF}/SFMT-LICENSE.txt ../../libs/doc_help/SFMT-LICENSE.txt "-l;unix")
35+ConvertHTML(${REF}/argon2-LICENSE.txt ../../libs/doc_help/argon2-LICENSE.txt "-l;unix")
36+ConvertHTML(${REF}/zlib-LICENSE.txt ../../libs/doc_help/zlib-LICENSE.txt "-l;unix;--zlib_special")
37+ConvertHTML(${REF}/cJSON-LICENSE.txt ../../libs/doc_help/cJSON-LICENSE.txt "-l;crlf")
38+ConvertHTML(${REF}/CygTerm+-LICENSE.txt ../../cygwin/cygterm/COPYING "-l;unix")
39+ConvertHTML(${REF}/build_with_cmake.html ${REF}/build_with_cmake.md "")
40+ConvertHTML(${REF}/build_library_with_cmake.html ${REF}/build_library_with_cmake.md "")
41+ConvertHTML(${REF}/menu_id.html ${REF}/menu_id.md "")
42+ConvertHTML(html/setup/folder.html html/setup/folder.md "")
43+
44+file(
45+ GLOB_RECURSE
46+ SRC
47+ LIST_DIRECTORIES false
48+ CONFIGURE_DEPENDS
49+ *.html *.md *.png
50+)
51+
52+source_group(TREE ${CMAKE_CURRENT_LIST_DIR} FILES ${SRC})
53+
54+add_custom_target(
55+ ${PACKAGE_NAME} ALL
56+ DEPENDS ${BINARY_DIR}/teraterm.chm
57+ SOURCES ${SRC}
58+ SOURCES ../htmlhelp_index_make.pl
59+ SOURCES ../2sjis.pl
60+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
61+)
62+
63+if(NOT("${HHC}" STREQUAL "HHC-NOTFOUND"))
64+ set(HHC_COMMAND ${HHC})
65+else()
66+ set(HHC_COMMAND ${CHMCMD})
67+endif()
68+
69+add_custom_command(
70+ OUTPUT ${BINARY_DIR}/teraterm.chm
71+ DEPENDS ${CMAKE_CURRENT_LIST_DIR}/Index.hhk
72+ DEPENDS ${CONVERTED_FILES}
73+ DEPENDS ${SRC}
74+ COMMAND ${CMAKE_COMMAND} -E rm -f ${BINARY_DIR}/teraterm.chm
75+ COMMAND ${CMAKE_COMMAND} -DHHC=${HHC_COMMAND} -P ../chm.cmake
76+ COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_LIST_DIR}/teraterm.chm ${BINARY_DIR}/teraterm.chm
77+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
78+)
79+
80+add_custom_command(
81+ OUTPUT ${CMAKE_CURRENT_LIST_DIR}/Index.hhk
82+ DEPENDS ${SRC}
83+ DEPENDS ${CMAKE_CURRENT_LIST_DIR}/../htmlhelp_index_make.pl
84+ COMMAND ${PERL} ${CMAKE_CURRENT_LIST_DIR}/../htmlhelp_index_make.pl . html -o Index.hhk
85+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
86+)
87+
88+install(
89+ FILES ${BINARY_DIR}/teraterm.chm
90+ DESTINATION .
91+)
--- trunk/doc/ja/CMakeLists.txt (nonexistent)
+++ trunk/doc/ja/CMakeLists.txt (revision 10041)
@@ -0,0 +1,91 @@
1+
2+set(PACKAGE_NAME "chm_ja")
3+project(${PACKAGE_NAME})
4+
5+if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
6+ set(BINARY_DIR "${CMAKE_BINARY_DIR}/$<CONFIG>")
7+else()
8+ set(BINARY_DIR "${CMAKE_BINARY_DIR}")
9+endif()
10+
11+set(CONVERTED_FILES "")
12+
13+function(ConvertHTML output depend options)
14+ list(APPEND CONVERTED_FILES ${CMAKE_CURRENT_LIST_DIR}/${output})
15+ set(SCRIPT ${CMAKE_CURRENT_LIST_DIR}/../2sjis.pl)
16+ add_custom_command(
17+ OUTPUT ${CMAKE_CURRENT_LIST_DIR}/${output}
18+ DEPENDS ${CMAKE_CURRENT_LIST_DIR}/${depend}
19+ DEPENDS ${SCRIPT}
20+ COMMAND ${PERL} ${SCRIPT}
21+ -i ${CMAKE_CURRENT_LIST_DIR}/${depend}
22+ -o ${CMAKE_CURRENT_LIST_DIR}/${output}
23+ ${options} --no_utime
24+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
25+ )
26+ set(CONVERTED_FILES ${CONVERTED_FILES} PARENT_SCOPE)
27+endfunction()
28+
29+set(REF "html/reference")
30+ConvertHTML(${REF}/Oniguruma-LICENSE.txt ../../libs/doc_help/Oniguruma-LICENSE.txt "-l;unix")
31+ConvertHTML(${REF}/RE.txt ../../libs/doc_help/ja/RE "-l;unix;-c;utf8")
32+ConvertHTML(${REF}/LibreSSL-LICENSE.txt ../../libs/doc_help/LibreSSL-LICENSE.txt "-l;unix")
33+ConvertHTML(${REF}/PuTTY-LICENSE.txt ../../libs/doc_help/PuTTY-LICENSE.txt "-l;crlf")
34+ConvertHTML(${REF}/SFMT-LICENSE.txt ../../libs/doc_help/SFMT-LICENSE.txt "-l;unix")
35+ConvertHTML(${REF}/argon2-LICENSE.txt ../../libs/doc_help/argon2-LICENSE.txt "-l;unix")
36+ConvertHTML(${REF}/zlib-LICENSE.txt ../../libs/doc_help/zlib-LICENSE.txt "-l;unix;--zlib_special")
37+ConvertHTML(${REF}/cJSON-LICENSE.txt ../../libs/doc_help/cJSON-LICENSE.txt "-l;crlf")
38+ConvertHTML(${REF}/CygTerm+-LICENSE.txt ../../cygwin/cygterm/COPYING "-l;unix")
39+ConvertHTML(${REF}/build_with_cmake.html ${REF}/build_with_cmake.md "")
40+ConvertHTML(${REF}/build_library_with_cmake.html ${REF}/build_library_with_cmake.md "")
41+ConvertHTML(${REF}/menu_id.html ${REF}/menu_id.md "")
42+ConvertHTML(html/setup/folder.html html/setup/folder.md "")
43+
44+file(
45+ GLOB_RECURSE
46+ SRC
47+ LIST_DIRECTORIES false
48+ CONFIGURE_DEPENDS
49+ *.html *.md *.png
50+)
51+
52+source_group(TREE ${CMAKE_CURRENT_LIST_DIR} FILES ${SRC})
53+
54+add_custom_target(
55+ ${PACKAGE_NAME} ALL
56+ DEPENDS ${BINARY_DIR}/teratermj.chm
57+ SOURCES ${SRC}
58+ SOURCES ../htmlhelp_index_make.pl
59+ SOURCES ../2sjis.pl
60+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
61+)
62+
63+if(NOT("${HHC}" STREQUAL "HHC-NOTFOUND"))
64+ set(HHC_COMMAND ${HHC})
65+else()
66+ set(HHC_COMMAND ${CHMCMD})
67+endif()
68+
69+add_custom_command(
70+ OUTPUT ${BINARY_DIR}/teratermj.chm
71+ DEPENDS ${CMAKE_CURRENT_LIST_DIR}/Index.hhk
72+ DEPENDS ${CONVERTED_FILES}
73+ DEPENDS ${SRC}
74+ COMMAND ${CMAKE_COMMAND} -E rm -f ${BINARY_DIR}/teratermj.chm
75+ COMMAND ${CMAKE_COMMAND} -DHHC=${HHC_COMMAND} -P ../chm.cmake
76+ COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_LIST_DIR}/teratermj.chm ${BINARY_DIR}/teratermj.chm
77+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
78+)
79+
80+add_custom_command(
81+ OUTPUT ${CMAKE_CURRENT_LIST_DIR}/Index.hhk
82+ DEPENDS ${SRC}
83+ DEPENDS ${CMAKE_CURRENT_LIST_DIR}/../htmlhelp_index_make.pl
84+ COMMAND ${PERL} ${CMAKE_CURRENT_LIST_DIR}/../htmlhelp_index_make.pl . html -o Index.hhk
85+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
86+)
87+
88+install(
89+ FILES ${BINARY_DIR}/teratermj.chm
90+ DESTINATION .
91+)
Show on old repository browser