From 02b1c4aa5151675c6bebb9f87b1ef9cbe6dd6827 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Wed, 24 Oct 2012 22:11:05 +0200 Subject: [PATCH] Fix test targets for some build trees The old targets only worked if the build tree was below the source tree. --- src/tex2lyx/Makefile.am | 2 +- src/tex2lyx/tex2lyx.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/tex2lyx/Makefile.am b/src/tex2lyx/Makefile.am index 94e6c4d6b7..b0be0afd96 100644 --- a/src/tex2lyx/Makefile.am +++ b/src/tex2lyx/Makefile.am @@ -36,7 +36,7 @@ TEST_FILES = \ TESTS = test/runtests.py updatetests: tex2lyx - $(PYTHON) "$(srcdir)/test/runtests.py" ./tex2lyx ../../../lib/scripts "$(srcdir)/test" + $(PYTHON) "$(srcdir)/test/runtests.py" ./tex2lyx "$(top_srcdir)/lib/scripts" "$(srcdir)/test" LINKED_FILES = \ ../Author.cpp \ diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp index 1abdecb2c9..7561774633 100644 --- a/src/tex2lyx/tex2lyx.cpp +++ b/src/tex2lyx/tex2lyx.cpp @@ -997,6 +997,16 @@ int main(int argc, char * argv[]) return EXIT_SUCCESS; } else { masterFilePathLyX = onlyPath(outfilename); + if (copy_files) { + FileName const path(masterFilePathLyX); + if (!path.isDirectory()) { + if (!path.createPath()) { + cerr << "Warning: Could not create directory for file `" + << masterFilePathLyX << "´." << endl; + return EXIT_FAILURE; + } + } + } if (roundtrip) { if (tex2tex(infilename, FileName(outfilename), default_encoding)) return EXIT_SUCCESS; -- 2.39.2