File: patchman.cmake

package info (click to toggle)
dcmtk 3.6.9-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 95,648 kB
  • sloc: ansic: 426,874; cpp: 318,177; makefile: 6,401; sh: 4,341; yacc: 1,026; xml: 482; lex: 321; perl: 277
file content (21 lines) | stat: -rw-r--r-- 836 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
#  Copyright (C) 2019, Jan Schlamelcher, OFFIS e.V.
#  All rights reserved.  See COPYRIGHT file for details.
#
#  Purpose: Fix some details in Doxygen generated manpages that can not be
#           configured via Doxygen itself directly.
#

file(GLOB MANPAGES "${CMAKE_CURRENT_BINARY_DIR}/manpages/man1/*.1")
foreach(MANPAGE ${MANPAGES})
  if(MANPAGE MATCHES "[.]man[.]1$" OR MANPAGE MATCHES "_([^/]*)_[.]1$")
    # The file is some Doxygen generated manpage index that we don't want.
    file(REMOVE "${MANPAGE}")
  else()
    # The file is a useful manpage, but it might contain a ".ad l" statement
    # at the beginning that messes with text justification.
    file(READ "${MANPAGE}" CONTENT)
    string(REGEX REPLACE "(\r|\n|\r\n)[.]ad l" "" CONTENT "${CONTENT}")
    file(WRITE "${MANPAGE}" "${CONTENT}")
  endif()
endforeach()