Skip to content

Commit

Permalink
fixed #7099 - added optional man target to CMake / build manpage in…
Browse files Browse the repository at this point in the history
… CI (danmar#5536)
  • Loading branch information
firewave authored Oct 9, 2023
1 parent e4028f6 commit 84f2485
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/buildman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions cmake/printInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions man/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
1 change: 1 addition & 0 deletions releasenotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 84f2485

Please sign in to comment.