Source

Website Meta Language / src / wml_docs / CMakeLists.txt

Full commit
SET (STDS
    "wml_barebone"
    "wml_std_css1"
    "wml_std_css2"
    "wml_std_csspos"
    "wml_std_html20"
    "wml_std_html32"
    "wml_std_html40"
    "wml_std_html401"
    "wml_std_wai10"
    "wml_std_xhtml10"
    )

SET (WML_DOCS
    "wml_intro"
    "wml_tutorial"
    "wml_macros"
    "wml_faq"
    "wml_tags"
)

FOREACH(MYSTD ${STDS})
    SET (TXT_SRC "${MYSTD}.txt")
    SET (MAN7_LOCAL "${MYSTD}.7")

    # MESSAGE (FATAL_ERROR "${CMAKE_CURRENT_BINARY_DIR}/${MAN7_LOCAL}")
    ADD_COPY_TARGET("std_copy_${MYSTD}" "${CMAKE_CURRENT_SOURCE_DIR}/${TXT_SRC}" "${CMAKE_CURRENT_BINARY_DIR}/${MAN7_LOCAL}")

    INSTALL_CAT_MAN("${MAN7_LOCAL}" "7")

ENDFOREACH(MYSTD ${STDS})

# MESSAGE (FATAL_ERROR "CUR_BIN = ${CMAKE_CURRENT_BINARY_DIR}")
SET (TAGS_POD "${CMAKE_CURRENT_BINARY_DIR}/wml_tags.pod")
ADD_CUSTOM_COMMAND(
    OUTPUT "${TAGS_POD}"
    COMMAND ${PERL_EXECUTABLE}
    ARGS "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.pod.pl"
        "--src" "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.pod.in"
        "--dest" "${TAGS_POD}"
        "--main" "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.L.main"
        "--incl" "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.L.incl"
    DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.pod.in" 
            "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.L.main"
            "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.L.incl" 
    VERBATIM
)

# The custom command needs to be assigned to a target.
ADD_CUSTOM_TARGET(
    ${TARGET_NAME} ALL
    DEPENDS ${TAGS_POD}
)

FOREACH(MYDOC ${WML_DOCS})
    SET (POD_SRC "${MYDOC}.pod")
    SET (MAN_LOCAL "${MYDOC}")

    IF (${MYDOC} STREQUAL "wml_tags")
        SET (POD2MAN_SOURCE_IS_IN_BINARY 1)
    ENDIF (${MYDOC} STREQUAL "wml_tags")
    INST_POD2MAN("wml_doc_${MYDOC}_pod" "${POD_SRC}" "${MAN_LOCAL}" "7")
ENDFOREACH(MYDOC ${WML_DOCS})