Skip to content
Permalink
Browse files

create PDFs from t2t files

  • Loading branch information
jef-n committed May 26, 2011
1 parent 1419878 commit fa147059387d7cd8add4c7c169e00630b71c7ea9
Showing with 26 additions and 8 deletions.
  1. +26 −8 cmake/Txt2Tags.cmake
@@ -21,6 +21,12 @@ MACRO(FIND_TXT2TAGS)
MESSAGE(STATUS "txt2tags not found - disabled")
ENDIF (NOT TXT2TAGS_EXECUTABLE)
ENDIF(NOT TXT2TAGS_EXECUTABLE)
IF (NOT PDFLATEX_EXECUTABLE)
FIND_PROGRAM(PDFLATEX_EXECUTABLE pdflatex)
ENDIF (NOT PDFLATEX_EXECUTABLE)
IF (NOT PDFLATEX_EXECUTABLE)
MESSAGE(STATUS "pdflatex not found - disabled")
ENDIF(NOT PDFLATEX_EXECUTABLE)
ENDMACRO(FIND_TXT2TAGS)

MACRO(ADD_TXT2TAGS_FILES _sources)
@@ -46,14 +52,26 @@ MACRO(ADD_TXT2TAGS_FILES _sources)
COMMENT "Building ${_out}.html from ${_in}"
)

ADD_CUSTOM_COMMAND(
OUTPUT ${_out}.tex
COMMAND ${TXT2TAGS_EXECUTABLE}
ARGS -o${_out}.tex -t tex ${_in}
DEPENDS ${_in}
COMMENT "Building ${_out}.tex from ${_in}"
)

SET(${_sources} ${${_sources}} ${_out} ${_out}.html)

IF (PDFLATEX_EXECUTABLE)
ADD_CUSTOM_COMMAND(
OUTPUT ${_out}.tex
COMMAND ${TXT2TAGS_EXECUTABLE}
ARGS -o${_out}.tex -t tex ${_in}
DEPENDS ${_in}
COMMENT "Building ${_out}.tex from ${_in}"
)

ADD_CUSTOM_COMMAND(
OUTPUT ${_out}.pdf
COMMAND TEXINPUTS=.:${CMAKE_CURRENT_SOURCE_DIR}: ${PDFLATEX_EXECUTABLE}
ARGS -output-directory=${CMAKE_CURRENT_BINARY_DIR} ${_out}.tex
DEPENDS ${_out}.tex
COMMENT "Building ${_out}.pdf from ${_out}.tex"
)
SET(${_sources} ${${_sources}} ${_out}.pdf)
ENDIF (PDFLATEX_EXECUTABLE)

ENDFOREACH (_current_FILE)
ENDMACRO(ADD_TXT2TAGS_FILES)

0 comments on commit fa14705

Please sign in to comment.
You can’t perform that action at this time.