<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. &nbsp;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. &nbsp;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, &quot;christophe laferriere&quot; &lt;<a href="christophe.laferriere@gmail.com">christophe.laferriere@gmail.com</a>&gt; 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 &quot;make&quot;.<BR>
Any help would be appreciate!<BR>
<BR>
Here is my CMakeLists.txt :<BR>
<BR>
FIND_PACKAGE(LATEX)<BR>
<BR>
set (STY &quot;dot2texi.sty&quot;)<BR>
<BR>
# should copy the .sty file to the current binary dir<BR>
ADD_CUSTOM_COMMAND(<BR>
&nbsp;&nbsp;&nbsp;TARGET copy_sty<BR>
&nbsp;&nbsp;&nbsp;&nbsp;POST_BUILD<BR>
&nbsp;&nbsp;&nbsp;&nbsp;COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/$<BR>
{STY} ${CMAKE_CURRENT_BINARY_DIR}/${STY}<BR>
&nbsp;&nbsp;&nbsp;&nbsp;DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${STY}<BR>
)<BR>
<BR>
# does compile the .tex file in current binary dir<BR>
IF(LATEX_COMPILER)<BR>
&nbsp;&nbsp;&nbsp;ADD_CUSTOM_COMMAND(<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OUTPUT &nbsp;&nbsp;&nbsp;${CMAKE_CURRENT_BINARY_DIR}/specs.dvi<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COMMAND &nbsp;&nbsp;${LATEX_COMPILER}<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ARGS &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${CMAKE_CURRENT_SOURCE_DIR}/specs.tex<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DEPENDS &nbsp;&nbsp;${CMAKE_CURRENT_SOURCE_DIR}/specs.tex<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COMMENT &nbsp;&nbsp;&quot;Tex2dvi&quot;<BR>
&nbsp;&nbsp;&nbsp;)<BR>
&nbsp;&nbsp;&nbsp;IF(DVIPS_CONVERTER)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ADD_CUSTOM_COMMAND(<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OUTPUT &nbsp;&nbsp;&nbsp;${CMAKE_CURRENT_BINARY_DIR}/specs.ps<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;COMMAND &nbsp;&nbsp;${DVIPS_CONVERTER}<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ARGS &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${CMAKE_CURRENT_BINARY_DIR}/specs.dvi<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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/specs.pdf<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ENDIF(PS2PDF_CONVERTER)<BR>
&nbsp;&nbsp;&nbsp;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>
&nbsp;&nbsp;&nbsp;**** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kenneth Moreland<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sandia National Laboratories<BR>
*********** &nbsp;<BR>
*** *** *** &nbsp;email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** &nbsp;*** &nbsp;** &nbsp;phone: (505) 844-8919<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;web: &nbsp;&nbsp;<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>