[CMake] cmake with LaTeX [UseLATEX.cmake]

Moreland, Kenneth kmorel at sandia.gov
Tue Jan 25 11:56:55 EST 2011


Looking at the source code, I believe it is assumed that the paths you give for images are relative to the directory ADD_LATEX_DOCUMENT is called.  If you make it an absolute path, UseLATEX.cmake will look in the wrong directory for your images, find none, and do no conversions.  That would explain why you had to point to your source directory and why pdflatex did not work if your images are in eps format.

In summary, it should work if you use this as for IMAGE_DIRS

IMAGE_DIRS ../figures

and your graphics paths should be preserved relative to the source:

\graphicspath{../figures}

Note, however, if you are trying to do an in-source build with the directory structure below, UseLATEX.cmake will probably do something screwy with the figures output directory (that is, place it in top-level/latex/figures since that is one level down from top-level/latex/figures).

-Ken

On 1/25/11 1:23 AM, "Raymond Wan" <r.wan at aist.go.jp> wrote:

Hi Daniel,

Thanks for the reply!


On Tue, Jan 25, 2011 at 16:15, Daniel Pfeifer <daniel at pfeifer-mail.de> wrote:
> Am Dienstag, den 25.01.2011, 15:41 +0900 schrieb Raymond Wan:
>>  Everything is fine except that pdflatex
>> doesn't seem to work with images well on my system...  That's of
>> course my system [or my :-) ] fault, though.
>
> Do you use the IMAGE_DIRS or IMAGES parameters? UseLATEX.cmake should
> then convert all images to the right format. Maybe check you imagemagick
> installation.


Actually, neither.  I couldn't get them to work and went to plan B.
:-) I have a directory structure like:

top-level/
  +latex/
    +latex/build/
  +figures/

So, my figures are in figures/.  I thought this would do:

IMAGE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../figures/"

but it wasn't working for me  I also tried IMAGES and that didn't work
as well.  I didn't pursue this further as I got:

\graphicspath{{@CMAKE_CURRENT_SOURCE_DIR@/../figures/}}

in the source LaTeX file to work and all my figures are in EPS format
anyway.  I will take a look at my imagemagick installation; but it
might also be that the figures aren't being located.


>> ... Is there something I can do
>> in my CMakeLists.txt file to ensure that it is the default target (and
>> not "pdf" or any of the others) when I type "make".
>
> Sure, there is the DEFAULT_PDF option. Have a look at section '3.3
> Create a PDF by Default' in the manual.


Yes, I've enabled that but I don't think that allows me to choose the
"pdf" target over the "safepdf" target.  Or is there something I'm
missing with this option?

Thank you!

Ray
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake



   ****      Kenneth Moreland
    ***      Sandia National Laboratories
***********
*** *** ***  email: kmorel at sandia.gov
**  ***  **  phone: (505) 844-8919
    ***      web:   http://www.cs.unm.edu/~kmorel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110125/a6c5acfb/attachment-0001.htm>


More information about the CMake mailing list