From 6ebf714ffbc5a1bd0cecb6fd0430a2c7add10afc Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (l)" <j.wuttke@fz-juelich.de>
Date: Tue, 31 May 2016 10:14:04 +0200
Subject: [PATCH] Starting directory auto, to receive auto-generated code.
 Works for man page.

---
 Doc/man/CMakeLists.txt | 11 +++++++----
 auto/README            | 18 ++++++++++++++++++
 2 files changed, 25 insertions(+), 4 deletions(-)
 create mode 100644 auto/README

diff --git a/Doc/man/CMakeLists.txt b/Doc/man/CMakeLists.txt
index 2fd1b0e1234..c8bb6bfadc6 100644
--- a/Doc/man/CMakeLists.txt
+++ b/Doc/man/CMakeLists.txt
@@ -1,12 +1,15 @@
+set(AUTODIR "${CMAKE_SOURCE_DIR}/auto/Doc/man")
+file(MAKE_DIRECTORY ${AUTODIR})
+
 add_custom_target(
     man ALL
-    DEPENDS bornagain.1
+    DEPENDS "${AUTODIR}/bornagain.1"
 )
 
 add_custom_command(
-    OUTPUT bornagain.1
-    COMMAND pod2man -s 1 -c "BornAgain manual" ${CMAKE_CURRENT_SOURCE_DIR}/bornagain.pod ${CMAKE_CURRENT_BINARY_DIR}/bornagain.1
+    OUTPUT "${AUTODIR}/bornagain.1"
+    COMMAND pod2man -s 1 -c "BornAgain manual" ${CMAKE_CURRENT_SOURCE_DIR}/bornagain.pod ${AUTODIR}/bornagain.1
     DEPENDS bornagain.pod
 )
 
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bornagain.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1)
+install(FILES ${AUTODIR}/bornagain.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/man/man1)
diff --git a/auto/README b/auto/README
new file mode 100644
index 00000000000..7ffd6d7175b
--- /dev/null
+++ b/auto/README
@@ -0,0 +1,18 @@
+This directory, auto, contains files that are automatically
+generated by tools other than CMake, Make, and the compiler.
+
+They are distributed as part of the source archive, but they
+are not included in the git repository [TODO: DISCUSS THIS].
+
+A user, who just wants to compile BornAgain, should consider
+the contents of this directory as part of the source, period.
+
+A developer, on the other hand, will sooner or later need
+to regenerate some or all sources contained in this directory.
+For this, use the command top-level cmake command with
+option -DREGENERATE [TODO: UPDATE THIS].
+
+Contents of this directory:
+
+Doc/man:
+  Unix man page in troff format, generated by pod2man.
-- 
GitLab