Commits

Anonymous committed 808e602

Add the wml_docs directory.

Comments (0)

Files changed (3)

src/CMakeLists.txt

 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 # TODO:
-# add wml_common , wml_docs , wml_frontend , wml_test , 
+# add wml_frontend , wml_test , 
 # wml_include , wml_misc , wml_test
 SUBDIRS (
     wml_aux 
     wml_backend  
     wml_common
+    wml_docs
      )
     )
 ENDMACRO(PREPROCESS_PATH_PERL)
 
+# Copies the file from one place to the other.
+# TARGET_NAME is the name of the makefile target to add.
+# SOURCE is the source path.
+# DEST is the destination path.
+MACRO(ADD_COPY_TARGET TARGET_NAME SOURCE DEST)
+    SET(PATH_PERL ${PERL_EXECUTABLE})
+    ADD_CUSTOM_COMMAND(
+        OUTPUT ${DEST}
+        COMMAND ${PATH_PERL}
+        ARGS "-e" 
+        "my (\$src, \$dest) = @ARGV; use File::Copy; copy(\$src, \$dest);"
+        ${SOURCE}
+        ${DEST}
+        DEPENDS ${SOURCE}
+        VERBATIM
+    )
+    # The custom command needs to be assigned to a target.
+    ADD_CUSTOM_TARGET(
+        ${TARGET_NAME} ALL
+        DEPENDS ${DEST}
+    )
+ENDMACRO(ADD_COPY_TARGET)
+
 MACRO(RUN_POD2MAN TARGET_NAME SOURCE DEST SECTION CENTER RELEASE)
     SET(PATH_PERL ${PERL_EXECUTABLE})
     ADD_CUSTOM_COMMAND(
             ${SOURCE}
         DESTINATION
             "share/man/man${SECTION}"
-   )
+    )
 ENDMACRO(INSTALL_MAN)
 
+MACRO(INSTALL_CAT_MAN SOURCE SECTION)
+    INSTALL(
+        FILES
+            ${SOURCE}
+        DESTINATION
+            "share/man/cat${SECTION}"
+    )
+ENDMACRO(INSTALL_CAT_MAN)
+
 MACRO(DEFINE_WML_AUX_PERL_PROG_WITHOUT_MAN BASENAME)
     PREPROCESS_PATH_PERL("preproc_${BASENAME}" "${BASENAME}.src" "${BASENAME}.pl")
     INSTALL(

src/wml_docs/CMakeLists.txt

+INCLUDE("../Common.cmake")
+
+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")
+
+    ADD_COPY_TARGET("std_copy_${MYSTD}" "${TXT_SRC}" "${MAN7_LOCAL}")
+
+    INSTALL_CAT_MAN("${MAN7_LOCAL}" "7")
+
+ENDFOREACH(MYSTD ${STDS})
+
+SET (TAGS_POD "wml_tags.pod")
+ADD_CUSTOM_COMMAND(
+    OUTPUT "${TAGS_POD}"
+    COMMAND ${PERL_EXECUTABLE}
+    ARGS "wml_tags.pod.pl"
+    DEPENDS "wml_tags.pod.in" "wml_tags.L.main" "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 (MAN7_LOCAL "${MYDOC}.7")
+
+    RUN_POD2MAN("wml_doc_${MYDOC}_pod" "${POD_SRC}" "${MAN7_LOCAL}" 
+        "7" "EN Tools" "EN Tools"
+    )
+
+    INSTALL_MAN("${MAN7_LOCAL}" "7")
+ENDFOREACH(MYDOC ${WML_DOCS})
+