fixed #7099 - added optional `man` target to CMake / build manpage in CI (#5536)

This commit is contained in:
Oliver Stöneberg 2023-10-09 22:20:36 +02:00 committed by GitHub
parent e4028f6820
commit 84f2485a26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 0 deletions

View File

@ -37,3 +37,23 @@ jobs:
with:
name: output
path: output
manpage:
- runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install missing software on ubuntu
if: contains(matrix.image, 'ubuntu')
run: |
apt-get update
apt-get install -y xsltproc docbook-xsl
- name: build manpage
run: |
make man
- uses: actions/upload-artifact@v3
with:
name: cppcheck.1
path: cppcheck.1

View File

@ -96,5 +96,6 @@ add_subdirectory(test) # Tests
add_subdirectory(gui) # Graphical application
add_subdirectory(tools/triage) # Triage tool
add_subdirectory(tools)
add_subdirectory(man)
include(cmake/clang_tidy.cmake)

View File

@ -39,6 +39,7 @@ option(BUILD_TESTS "Build tests"
option(REGISTER_TESTS "Register tests in CTest" ON)
option(ENABLE_CHECK_INTERNAL "Enable internal checks" OFF)
option(DISABLE_DMAKE "Disable run-dmake dependencies" OFF)
option(BUILD_MANPAGE "Enable man target to build manpage" OFF)
option(BUILD_GUI "Build the qt application" OFF)
option(WITH_QCHART "Enable QtCharts usage in the GUI" OFF)

View File

@ -48,6 +48,7 @@ if(BUILD_TESTS)
endif()
message( STATUS "ENABLE_CHECK_INTERNAL = ${ENABLE_CHECK_INTERNAL}" )
message( STATUS "DISABLE_DMAKE = ${DISABLE_DMAKE}" )
message( STATUS "BUILD_MANPAGE = ${BUILD_MANPAGE}" )
message( STATUS )
message( STATUS "BUILD_GUI = ${BUILD_GUI}" )
if (BUILD_GUI)

7
man/CMakeLists.txt Normal file
View File

@ -0,0 +1,7 @@
if (BUILD_MANPAGE)
find_program(XSLTPROC NAMES xsltproc REQUIRED)
set(DB2MAN "/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl")
set(MAN_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/cppcheck.1.xml")
add_custom_target(man ${XSLTPROC} --nonet --param man.charmap.use.subset "0" ${DB2MAN} ${MAN_SOURCE}
DEPENDS ${MAN_SOURCE})
endif()

View File

@ -23,3 +23,4 @@ Other:
- 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.
- "--project" can also no longer be used in conjunction with additional source files.
- If a addon cannot be found it will bail out immediately instead of continously writing errors and failing the analysis at the end.
- 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.