<HTML>
<HEAD>
<TITLE>Re: [CMake] Out of source latex build</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Consider using the UseLATEX.cmake collection of macros. It supports out-of-source builds (in fact, sort of enforces them) and handles copying .sty files as well as all sorts of other sticky little issues with building LaTeX files. You can the macros and the documentation for them on this Wiki page:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><a href="http://www.cmake.org/Wiki/CMakeUserUseLATEX">http://www.cmake.org/Wiki/CMakeUserUseLATEX</a><BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
-Ken<BR>
<BR>
<BR>
On 10/26/09 7:46 AM, "christophe laferriere" <<a href="christophe.laferriere@gmail.com">christophe.laferriere@gmail.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi All,<BR>
<BR>
I'm trying to add a rules to my latex build (included in a bigger <BR>
project) so that a .sty file is copied in the current_binary_dir.<BR>
I've tried several things but can't get the .sty file copied in the <BR>
build directory, latex complain about it when i try "make".<BR>
Any help would be appreciate!<BR>
<BR>
Here is my CMakeLists.txt :<BR>
<BR>
FIND_PACKAGE(LATEX)<BR>
<BR>
set (STY "dot2texi.sty")<BR>
<BR>
# should copy the .sty file to the current binary dir<BR>
ADD_CUSTOM_COMMAND(<BR>
TARGET copy_sty<BR>
POST_BUILD<BR>
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/$<BR>
{STY} ${CMAKE_CURRENT_BINARY_DIR}/${STY}<BR>
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${STY}<BR>
)<BR>
<BR>
# does compile the .tex file in current binary dir<BR>
IF(LATEX_COMPILER)<BR>
ADD_CUSTOM_COMMAND(<BR>
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/specs.dvi<BR>
COMMAND ${LATEX_COMPILER}<BR>
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/specs.tex<BR>
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/specs.tex<BR>
COMMENT "Tex2dvi"<BR>
)<BR>
IF(DVIPS_CONVERTER)<BR>
ADD_CUSTOM_COMMAND(<BR>
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/specs.ps<BR>
COMMAND ${DVIPS_CONVERTER}<BR>
ARGS ${CMAKE_CURRENT_BINARY_DIR}/specs.dvi<BR>
-o ${CMAKE_CURRENT_BINARY_DIR}/specs.ps<BR>
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/specs.dvi<BR>
COMMENT "dvi2ps"<BR>
)<BR>
<BR>
IF(PS2PDF_CONVERTER)<BR>
ADD_CUSTOM_COMMAND(<BR>
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/specs.pdf<BR>
COMMAND ${PS2PDF_CONVERTER}<BR>
ARGS ${CMAKE_CURRENT_BINARY_DIR}/specs.ps<BR>
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/specs.ps<BR>
COMMENT "ps2pdf"<BR>
)<BR>
ADD_CUSTOM_TARGET(LaTeXDocument ALL echo<BR>
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/specs.pdf<BR>
)<BR>
ENDIF(PS2PDF_CONVERTER)<BR>
ENDIF(DVIPS_CONVERTER)<BR>
ENDIF(LATEX_COMPILER)<BR>
<BR>
_______________________________________________<BR>
Powered by www.kitware.com<BR>
<BR>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><BR>
<BR>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><BR>
<BR>
Follow this link to subscribe/unsubscribe:<BR>
<a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><BR>
<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
**** Kenneth Moreland<BR>
*** Sandia National Laboratories<BR>
*********** <BR>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** *** ** phone: (505) 844-8919<BR>
*** web: <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>