nurtsi
24th April 2008, 15:15
I'm having problems trying to use qmake to build my documentation. I have a directory where my documentation is as latex files. I want to use qmake (since I use it everywhere else in the project) to build pdfs out of the .tex files and also provide an install target to install them to a specified directory.
I've tried doing it using a custom compiler:
# Dummy, just to avoid qmake error because we're not compiling any application
TEMPLATE = subdirs
TEX = help.tex
# Compiler for pdfs
doc_builder.name = tex2pdf
doc_builder.input = $$TEX
doc_builder.output = ${QMAKE_FILE_IN_BASE}.pdf
doc_builder.commands = pdflatex ${QMAKE_FILE_IN}
doc_builder.variable_out = PDFS
QMAKE_EXTRA_COMPILERS += doc_builder
# Install documentation
docs.path = $$PREFIX/share/doc/MyApp
docs.files = changelog.txt $$PDFS
INSTALLS += docs
This doesn't work, because the $$PDFS is expanded when qmake is run and it is naturally empty at the time because the custom compiler hasn't been run. How can I get around this? Is there any way of telling that the install target depends on something? Or is there another approach to achieve the same results I'm after?
I've tried doing it using a custom compiler:
# Dummy, just to avoid qmake error because we're not compiling any application
TEMPLATE = subdirs
TEX = help.tex
# Compiler for pdfs
doc_builder.name = tex2pdf
doc_builder.input = $$TEX
doc_builder.output = ${QMAKE_FILE_IN_BASE}.pdf
doc_builder.commands = pdflatex ${QMAKE_FILE_IN}
doc_builder.variable_out = PDFS
QMAKE_EXTRA_COMPILERS += doc_builder
# Install documentation
docs.path = $$PREFIX/share/doc/MyApp
docs.files = changelog.txt $$PDFS
INSTALLS += docs
This doesn't work, because the $$PDFS is expanded when qmake is run and it is naturally empty at the time because the custom compiler hasn't been run. How can I get around this? Is there any way of telling that the install target depends on something? Or is there another approach to achieve the same results I'm after?