3 MACRO(USER_BUILD_LATEX_DOC TEX_FILE OUTPUT_REL_PATH)
5 SET(USE_LATEX ON CACHE BOOL "" FORCE)
6 # Construct absolute build path
7 SET(BUILD_PATH ${${PROJECT_NAME}_DOC_BUILD_PATH}/${OUTPUT_REL_PATH})
8 #MESSAGE(STATUS "Tex file : ${TEX_FILE}")
9 #---------------------------------------------------------------------------
11 ${CMAKE_CURRENT_SOURCE_DIR}/${TEX_FILE}.tex
12 ${BUILD_PATH}/${TEX_FILE}.tex
16 ${CMAKE_CURRENT_SOURCE_DIR}/../config.tex
17 ${BUILD_PATH}/config.tex
21 ${CMAKE_CURRENT_SOURCE_DIR}/../config.tex
22 ${CMAKE_CURRENT_BINARY_DIR}/config.tex
25 #---------------------------------------------------------------------------
26 FILE(TO_NATIVE_PATH ${BUILD_PATH} THE_BUILD_PATH)
28 # Have to run latex twice to get references, toc, etc.
30 OUTPUT ${BUILD_PATH}/${TEX_FILE}.aux
33 cd ${THE_BUILD_PATH} && ${LATEX_COMPILER}
35 -interaction=batchmode ${BUILD_PATH}/${TEX_FILE} -output-directory=${BUILD_PATH}/
38 ${CMAKE_CURRENT_SOURCE_DIR}/${TEX_FILE}.tex
39 ${CMAKE_CURRENT_SOURCE_DIR}/../config.tex
42 OUTPUT ${BUILD_PATH}/${TEX_FILE}.pdf
45 cd ${THE_BUILD_PATH} && ${LATEX_COMPILER}
47 -interaction=batchmode ${BUILD_PATH}/${TEX_FILE} -output-directory=${BUILD_PATH}/
49 DEPENDS ${BUILD_PATH}/${TEX_FILE}.aux
53 ADD_CUSTOM_TARGET(${TEX_FILE}.pdf ALL
54 DEPENDS ${BUILD_PATH}/${TEX_FILE}.pdf)
58 FILES ${BUILD_PATH}/${TEX_FILE}.pdf
59 DESTINATION ${${PROJECT_NAME}_DOC_INSTALL_PATH}/${OUTPUT_REL_PATH}
63 ENDMACRO(USER_BUILD_LATEX_DOC)