HEX
Server: Apache
System: Linux a16-asgard6.hospedagemuolhost.com.br 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: maoristu4c3dbd03 (1436)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //opt/puppetlabs/puppet/lib/cmake/leatherman/cmake/pod2man.cmake
# Taken from https://github.com/tarantool/tarantool

# Generate man pages of the project by using the POD header
# written in the tool source code. To use it - include this
# file in CMakeLists.txt and invoke
# pod2man(<podfile> <manfile> <section> <center>)
find_program(POD2MAN pod2man)

if(NOT POD2MAN)
    message(STATUS "Could not find pod2man - man pages disabled")
endif(NOT POD2MAN)

macro(pod2man PODFILE MANFILE SECTION OUTPATH CENTER)
    if(NOT EXISTS ${PODFILE})
        message(FATAL ERROR "Could not find pod file ${PODFILE} to generate man page")
    endif(NOT EXISTS ${PODFILE})

    if(POD2MAN)
        set(OUTPATH_NEW "${PROJECT_BINARY_DIR}/${OUTPATH}")

        add_custom_command(
            OUTPUT ${OUTPATH_NEW}/${MANFILE}.${SECTION}
            COMMAND ${POD2MAN} --section ${SECTION} --center ${CENTER}
                --release "\"\"" --name ${MANFILE} ${PODFILE}
                ${OUTPATH_NEW}/${MANFILE}.${SECTION}
        )
        set(MANPAGE_TARGET "man-${MANFILE}")
        add_custom_target(${MANPAGE_TARGET} ALL
            DEPENDS ${OUTPATH_NEW}/${MANFILE}.${SECTION}
        )
        install(
            FILES ${OUTPATH_NEW}/${MANFILE}.${SECTION}
            DESTINATION ${OUTPATH}/man${SECTION}
        )
    endif()
endmacro(pod2man PODFILE MANFILE SECTION OUTPATH CENTER)