Commits

Shlomi Fish  committed cfd4bfa

Add the p2_mp4h/doc dir.

Some stuff was not yet imported from the Makefile.am.

  • Participants
  • Parent commits afbe9d0
  • Branches conversion-to-cmake

Comments (0)

Files changed (2)

File src/wml_backend/p2_mp4h/doc/CMakeLists.txt

+SET (POD_PATH  "mp4h.pod")
+SET (HTML_PATH  "mp4h.html")
+SET (PROGDIR "${CMAKE_BINARY_DIR}/wml_backend/p2_mp4h/src")
+SET (MYPROGRAM "${PROGDIR}/wml_p2_mp4h")
+SET (MYFLAGS "-X 0 -I ${CMAKE_CURRENT_SOURCE_DIR} -D srcdir=${CMAKE_CURRENT_SOURCE_DIR}")
+
+MACRO(PREPARE_MP4H_DOC TARGET FORMAT)
+ADD_CUSTOM_COMMAND(
+    OUTPUT "${TARGET}"
+    COMMAND "${PERL_EXECUTABLE}"
+    ARGS "${CMAKE_CURRENT_SOURCE_DIR}/myformat.pl"
+        "${MYPROGRAM}"
+        "${MYFLAGS}"
+        "${FORMAT}"
+        "${CMAKE_CURRENT_SOURCE_DIR}"
+        "${TARGET}"
+        DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/mp4h.mp4h" "${CMAKE_CURRENT_SOURCE_DIR}/${FORMAT}.out" "${MYPROGRAM}"
+)
+ENDMACRO(PREPARE_MP4H_DOC TARGET FORMAT)
+
+PREPARE_MP4H_DOC ("${CMAKE_CURRENT_BINARY_DIR}/${POD_PATH}" "pod")
+PREPARE_MP4H_DOC ("${CMAKE_CURRENT_BINARY_DIR}/${HTML_PATH}" "html")
+
+SET (POD2MAN_SOURCE_IS_IN_BINARY 1)
+INST_RENAME_POD2MAN( "mp4h_pod" "mp4h.pod" "mp4h" "1" "mp4h")

File src/wml_backend/p2_mp4h/doc/myformat.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings; 
+
+my ($MYPROGRAM, $MYFLAGS, $FORMAT, $CMAKE_CURRENT_SOURCE_DIR, $TARGET) = @ARGV;
+my $out = `${MYPROGRAM} ${MYFLAGS} -D format=${FORMAT} ${CMAKE_CURRENT_SOURCE_DIR}/mp4h.mp4h`; 
+
+# print STDERR  "FOOBARBAZQUUX === ${MYPROGRAM} ${MYFLAGS} -D format=${FORMAT} ${CMAKE_CURRENT_SOURCE_DIR}/mp4h.mp4h";
+
+$out =~ s/_LT_/</g; 
+$out =~ s/_GT_/>/g; 
+
+open my $fh, '>', $TARGET or die qq/Cannot open ${TARGET} - $!/ ;
+print {$fh} $out;
+close($fh);