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.
29 #message("ADD_CUSTOM_COMMAND(OUTPUT ${BUILD_PATH}/${TEX_FILE}.aux MACRO(USER_BUILD_LATEX_DOC")
32 OUTPUT ${BUILD_PATH}/${TEX_FILE}.aux
35 cd ${THE_BUILD_PATH} && ${LATEX_COMPILER}
37 -interaction=batchmode ${BUILD_PATH}/${TEX_FILE} -output-directory=${BUILD_PATH}/
40 ${CMAKE_CURRENT_SOURCE_DIR}/${TEX_FILE}.tex
41 ${CMAKE_CURRENT_SOURCE_DIR}/../config.tex
44 #message("LATEX_COMPILER = ${LATEX_COMPILER}")
46 OUTPUT ${BUILD_PATH}/${TEX_FILE}.pdf
49 cd ${THE_BUILD_PATH} && ${LATEX_COMPILER}
51 -interaction=batchmode ${BUILD_PATH}/${TEX_FILE} -output-directory=${BUILD_PATH}/
53 DEPENDS ${BUILD_PATH}/${TEX_FILE}.aux
57 ADD_CUSTOM_TARGET(${TEX_FILE}.pdf ALL
58 DEPENDS ${BUILD_PATH}/${TEX_FILE}.pdf)
62 FILES ${BUILD_PATH}/${TEX_FILE}.pdf
63 DESTINATION ${${PROJECT_NAME}_DOC_INSTALL_PATH}/${OUTPUT_REL_PATH}
66 ENDMACRO(USER_BUILD_LATEX_DOC)