Skip to content

Commit 84f2485

Browse files
authored
fixed #7099 - added optional man target to CMake / build manpage in CI (#5536)
1 parent e4028f6 commit 84f2485

6 files changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/buildman.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,23 @@ jobs:
3737
with:
3838
name: output
3939
path: output
40+
41+
manpage:
42+
- runs-on: ubuntu-22.04
43+
steps:
44+
- uses: actions/checkout@v3
45+
46+
- name: Install missing software on ubuntu
47+
if: contains(matrix.image, 'ubuntu')
48+
run: |
49+
apt-get update
50+
apt-get install -y xsltproc docbook-xsl
51+
52+
- name: build manpage
53+
run: |
54+
make man
55+
56+
- uses: actions/upload-artifact@v3
57+
with:
58+
name: cppcheck.1
59+
path: cppcheck.1

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,6 @@ add_subdirectory(test) # Tests
9696
add_subdirectory(gui) # Graphical application
9797
add_subdirectory(tools/triage) # Triage tool
9898
add_subdirectory(tools)
99+
add_subdirectory(man)
99100

100101
include(cmake/clang_tidy.cmake)

cmake/options.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ option(BUILD_TESTS "Build tests"
3939
option(REGISTER_TESTS "Register tests in CTest" ON)
4040
option(ENABLE_CHECK_INTERNAL "Enable internal checks" OFF)
4141
option(DISABLE_DMAKE "Disable run-dmake dependencies" OFF)
42+
option(BUILD_MANPAGE "Enable man target to build manpage" OFF)
4243

4344
option(BUILD_GUI "Build the qt application" OFF)
4445
option(WITH_QCHART "Enable QtCharts usage in the GUI" OFF)

cmake/printInfo.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ if(BUILD_TESTS)
4848
endif()
4949
message( STATUS "ENABLE_CHECK_INTERNAL = ${ENABLE_CHECK_INTERNAL}" )
5050
message( STATUS "DISABLE_DMAKE = ${DISABLE_DMAKE}" )
51+
message( STATUS "BUILD_MANPAGE = ${BUILD_MANPAGE}" )
5152
message( STATUS )
5253
message( STATUS "BUILD_GUI = ${BUILD_GUI}" )
5354
if (BUILD_GUI)

man/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
if (BUILD_MANPAGE)
2+
find_program(XSLTPROC NAMES xsltproc REQUIRED)
3+
set(DB2MAN "/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl")
4+
set(MAN_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/cppcheck.1.xml")
5+
add_custom_target(man ${XSLTPROC} --nonet --param man.charmap.use.subset "0" ${DB2MAN} ${MAN_SOURCE}
6+
DEPENDS ${MAN_SOURCE})
7+
endif()

releasenotes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ Other:
2323
- Multiple "--project" options are now prohibited. These would have overlapped each other and lead to unexpected behavior. Please use separate runs with a single "--project" option instead.
2424
- "--project" can also no longer be used in conjunction with additional source files.
2525
- If a addon cannot be found it will bail out immediately instead of continously writing errors and failing the analysis at the end.
26+
- Added CMake option "BUILD_MANPAGE" which adds the "man" target which will build the manpage. This requires xsltproc and the docbook XSLs to be installed.

0 commit comments

Comments
 (0)