Consider the following snippet
env = Environment()
env.PDF(target="personal_statement.pdf", source="personal_statement.tex")
env.Command("documents/personal_statement.pdf", "personal_statement.pdf", Copy('$TARGET', '$SOURCE'))
If I set target in env.PDF to “documents/personal_statement.pdf”, the LaTeX compilation happens in “documents/personal_statement.pdf”. I want only the final output, namely “personal_statement.pdf” to be present in “documents/personal_statement.pdf”.
Currently I am doing this in two steps. Step 1: compile the file, Step 2: move the resulting PDF to another directory.
Is there some way of accomplishing this in one step instead of using two steps?
The limitation of doing this in two steps is more related to pdflatex rather than SCons. pdflatex has the
-output-directoryoption, but it will either write everything (including all of the temporary files) to that directory.While your example snippet may work, I believe the more typical approach is to use the Install builder.