From 29a8b75834933a1d1ea195294ce2f760e92d12a5 Mon Sep 17 00:00:00 2001
From: ralfulrich <ralf.ulrich@kit.edu>
Date: Tue, 30 Mar 2021 18:06:14 +0200
Subject: [PATCH] read the docs

---
 documentation/conf.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/documentation/conf.py b/documentation/conf.py
index 7ed41f698..565d03220 100644
--- a/documentation/conf.py
+++ b/documentation/conf.py
@@ -1,10 +1,32 @@
 import sys
 import subprocess, os
 
+def configureDoxyfile(input_dir, output_dir):
+    with open('Doxyfile.in', 'r') as file :
+        filedata = file.read()
+
+    filedata = filedata.replace('@PROJECT_SOURCE_DIR@', input_dir)
+    filedata = filedata.replace('@CMAKE_CURRENT_BINARY_DIR@', output_dir)
+    filedata = filedata.replace('@CMAKE_BINARY_DIR@', output_dir)
+
+    with open('Doxyfile', 'w') as file:
+        file.write(filedata)
+
 read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
 
+breathe_projects = {}
+
 if read_the_docs_build:
+    
+    input_dir = '../corsika'
+    output_dir = 'build'
+    configureDoxyfile(input_dir, output_dir)
+
+    subprocess.call('mkdir -p build/corsika/framework/core; cd build/corsika/framework/core && ../../../../../corsika/src/framework/core/pdxml_reader.py ../../../../../corsika/src/framework/core/ParticleData.xml ../../../../../corsika/src/framework/core/NuclearData.xml ../../../../../corsika/src/framework/core/ParticleClassNames.xml', shell=True)
 
+    subprocess.call('mkdir -p build/corsika/media; cd build/corsika/media && ../../../../../corsika/src/media/readProperties.py ../../../../../corsika/src/media/properties8.dat', shell=True)
+    
+    subprocess.call('doxygen', shell=True)
     subprocess.call('cd ../doxygen; doxygen', shell=True)
     
 
-- 
GitLab