[CMake] Out of source latex build
christophe laferriere
christophe.laferriere at gmail.com
Mon Oct 26 09:46:25 EDT 2009
Hi All,
I'm trying to add a rules to my latex build (included in a bigger
project) so that a .sty file is copied in the current_binary_dir.
I've tried several things but can't get the .sty file copied in the
build directory, latex complain about it when i try "make".
Any help would be appreciate!
Here is my CMakeLists.txt :
FIND_PACKAGE(LATEX)
set (STY "dot2texi.sty")
# should copy the .sty file to the current binary dir
ADD_CUSTOM_COMMAND(
TARGET copy_sty
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/$
{STY} ${CMAKE_CURRENT_BINARY_DIR}/${STY}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${STY}
)
# does compile the .tex file in current binary dir
IF(LATEX_COMPILER)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/specs.dvi
COMMAND ${LATEX_COMPILER}
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/specs.tex
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/specs.tex
COMMENT "Tex2dvi"
)
IF(DVIPS_CONVERTER)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/specs.ps
COMMAND ${DVIPS_CONVERTER}
ARGS ${CMAKE_CURRENT_BINARY_DIR}/specs.dvi
-o ${CMAKE_CURRENT_BINARY_DIR}/specs.ps
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/specs.dvi
COMMENT "dvi2ps"
)
IF(PS2PDF_CONVERTER)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/specs.pdf
COMMAND ${PS2PDF_CONVERTER}
ARGS ${CMAKE_CURRENT_BINARY_DIR}/specs.ps
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/specs.ps
COMMENT "ps2pdf"
)
ADD_CUSTOM_TARGET(LaTeXDocument ALL echo
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/specs.pdf
)
ENDIF(PS2PDF_CONVERTER)
ENDIF(DVIPS_CONVERTER)
ENDIF(LATEX_COMPILER)
More information about the CMake
mailing list