Skip to content

Commit f1170c1

Browse files
committed
Complete CMake build system
1 parent be73479 commit f1170c1

File tree

5 files changed

+27
-8
lines changed

5 files changed

+27
-8
lines changed

CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.12)
33
# SPDX-FileCopyrightText: 2022 Boyuan Yang <[email protected]>
44
# SPDX-License-Identifier: CC0-1.0 OR BSD-2-Clause
55

6-
include(CMakePrintHelpers)
76
include(GNUInstallDirs)
87
project(manpages-zh VERSION 1.6.4.0 HOMEPAGE_URL "https://github.com/man-pages-zh/manpages-zh")
98

@@ -15,7 +14,10 @@ set(EXCLUDED_MANPAGES "" CACHE STRING "Man pages that are not installed")
1514

1615
list(LENGTH EXCLUDED_MANPAGES EXCLUDED_MANPAGES_SIZE)
1716
if (EXCLUDED_MANPAGES_SIZE GREATER 0)
18-
message(STATUS "Will exclude total of ${EXCLUDED_MANPAGES_SIZE} man pages.")
17+
message(STATUS "Will exclude ${EXCLUDED_MANPAGES_SIZE} man pages:")
18+
foreach (EXCLUDED_MANPAGE EXCLUDED_MANPAGES)
19+
message(STATUS " * ${EXCLUDED_MANPAGE}")
20+
endforeach ()
1921
set(FILTER_EXCLUDED_MANPAGES 1)
2022
else ()
2123
set(FILTER_EXCLUDED_MANPAGES 0)
@@ -40,7 +42,6 @@ set(MANDIR_LIST "man1" "man2" "man3" "man4" "man5" "man6" "man7" "man8" "mann")
4042
foreach (MANDIR ${MANDIR_LIST})
4143
file(GLOB CURRENT_MAN_PAGES "src/${MANDIR}/*.*")
4244
foreach (CURRENT_MAN_PAGE ${CURRENT_MAN_PAGES})
43-
cmake_print_variables(CURRENT_MAN_PAGE)
4445
get_filename_component(MAN_PAGE_NAME ${CURRENT_MAN_PAGE} NAME)
4546
string(REGEX REPLACE "(.*)\\." "" MAN_PAGE_SECTION_RAW ${MAN_PAGE_NAME})
4647
string(SUBSTRING ${MAN_PAGE_SECTION_RAW} 0 1 MAN_PAGE_SECTION)
@@ -81,7 +82,6 @@ foreach (MANDIR ${MANDIR_LIST})
8182
DEPENDS ${PROCESS_OUTPUT_ZHCN}
8283
)
8384
add_dependencies(man man_zhcn_${MAN_PAGE_NAME}_build)
84-
cmake_print_variables(PROCESS_COMMAND_ZHCN)
8585
endif (ENABLE_ZHCN)
8686
if (ENABLE_ZHTW)
8787
add_custom_command(OUTPUT ${PROCESS_OUTPUT_ZHTW}

ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2022-12-09 Boyuan Yang <[email protected]>
2+
3+
* CMakeLists.txt: Migrate build system to CMake.
4+
* Bump version string to 1.6.4.0.
5+
16
2022-12-08 Boyuan Yang <[email protected]>
27

38
* stty(1): Retranslated from coreutils 9.1.

README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ information in each file for its exact license.
5353

5454
构建依赖包括:
5555

56-
* autotools (autoconf, automake)
56+
* autotools (autoconf, automake) 或 cmake 其一
5757
* python3
5858
* opencc 1.x
5959

60-
### “编译”安装
60+
### “编译”安装(Autotools)
6161

6262
```bash
6363
autoreconf --install --force
@@ -66,6 +66,21 @@ make
6666
make install # 需要超级用户权限
6767
```
6868

69+
### “编译”安装(CMake)
70+
71+
```bash
72+
mkdir build && cd build/
73+
cmake ..
74+
make
75+
make install # 需要超级用户权限
76+
```
77+
78+
可用的 CMake 参数:
79+
80+
* `ENABLE_APPEND_COLOPHON`: 在手册页末尾添加翻译人员信息
81+
* `ENABLE_ZHCN`: 生成并安装简体中文手册页
82+
* `ENABLE_ZHTW`: 生成并安装繁体中文手册页
83+
6984
### 从 Linux 发行版安装
7085

7186
Debian / Ubuntu:

TODO

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
* Some pages are too old to be helpful.
22
部分内容过旧,需要志愿者参与更新。
3-
* Add configure options to exclude certain manual pages.
43
* Current hacky CMakeLists.txt cannot handle '[.1', needs investigation

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Process this file with autoconf to produce a configure script.
33

44
AC_PREREQ([2.61])
5-
AC_INIT([manpages-zh],[1.6.3.7],[https://github.com/man-pages-zh/manpages-zh/issues])
5+
AC_INIT([manpages-zh],[1.6.4.0],[https://github.com/man-pages-zh/manpages-zh/issues])
66
AC_CONFIG_SRCDIR([src/man1/basename.1])
77
AM_INIT_AUTOMAKE([subdir-objects])
88
AM_MAINTAINER_MODE

0 commit comments

Comments
 (0)