Website Meta Language / src / wml_include / CMakeLists.txt

SET (myfiles
    all
    des/all
    des/gfont
    des/imgbg
    des/imgdot
    des/lowsrc
    des/navbar
    des/preload
    des/rollover
    des/space
    des/typography
    fmt/all
    fmt/isolatin
    fmt/pod
    fmt/sdf
    fmt/text
    fmt/url
    fmt/verbatim
    fmt/xtable
    imp/all
    imp/csmap
    imp/fsview
    imp/generic
    mod/all
    mod/MakeMaker
    mod/version
    std/all
    std/box
    std/case
    std/grid
    std/href
    std/info
    std/label
    std/lang
    std/logo
    std/page
    std/tags
    std/toc
    sup/all
    sup/hextriple
    sup/path
    sys/all
    sys/bootp3
    sys/bootp4
    sys/compat1
)

CONFIGURE_FILE(
    "${CMAKE_CURRENT_SOURCE_DIR}/sys/bootp3.src.in"
    "${CMAKE_CURRENT_BINARY_DIR}/sys/bootp3.src"
    COPY_ONLY
)

SET (dirs_to_make )
SET (preproc_target_dests )
SET (include_pods_dests )
SET (POD2MAN_TARGET_IS_A_LIST 1)

FOREACH (base ${myfiles})

    # Make the directory to which the file belongs.
    STRING (REGEX REPLACE "/.*" "" basedir "${base}")
    LIST (FIND dirs_to_make "${basedir}" found)
    IF ("${found}" STREQUAL "-1")
        LIST (APPEND dirs_to_make "${basedir}")
        FILE (MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${basedir}")
    ENDIF ("${found}" STREQUAL "-1")

    SET (destbase "${base}.wml")
    SET (dest "${CMAKE_CURRENT_BINARY_DIR}/${destbase}")
    SET (srcbase "${base}.src")
    IF ("${base}" STREQUAL "sys/bootp3")
        SET (src "${CMAKE_CURRENT_BINARY_DIR}/${srcbase}")
        SET (is_binary 1)
        # MESSAGE (FATAL_ERROR "src = ${src}")
    ELSE ("${base}" STREQUAL "sys/bootp3")
        SET (src "${CMAKE_CURRENT_SOURCE_DIR}/${srcbase}")
        SET (is_binary )
    ENDIF ("${base}" STREQUAL "sys/bootp3")
    SET (mannamebase "${base}")
    SET (manname "${CMAKE_CURRENT_BINARY_DIR}/${mannamebase}")

    STRING (REPLACE "/" "__" target_base "${base}")


    ADD_CUSTOM_COMMAND(
        OUTPUT "${dest}"
        COMMAND "${PERL_EXECUTABLE}"
        ARGS "${CMAKE_CURRENT_SOURCE_DIR}/preprocess-perl-source.pl"
            "--input" "${src}"
            "--output" "${dest}"
        DEPENDS "${src}"
    )
    LIST (APPEND preproc_target_dests "${dest}")
    INSTALL (
        FILES "${dest}"
        DESTINATION "${WML_LIB_DIR}/include/"
        RENAME "${destbase}"
    )
    STRING (REPLACE "/" "::" dest_man "wml/${base}")

    IF (is_binary)
        SET (POD2MAN_SOURCE_IS_IN_BINARY 1)
    ENDIF (is_binary)
    INST_RENAME_POD2MAN(
        "include_pods_dests"
        "${srcbase}"
        "${mannamebase}"
        "3"
        "${dest_man}"
    )
ENDFOREACH(base)

SET (POD2MAN_TARGET_IS_A_LIST )

ADD_CUSTOM_TARGET(
    "preprocess_perl_includes" ALL
    DEPENDS ${preproc_target_dests}
)

ADD_CUSTOM_TARGET(
    "includes_pods" ALL
    DEPENDS ${include_pods_dests}
)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.