]> git.openstreetmap.org Git - nominatim.git/blobdiff - docs/CMakeLists.txt
Merge pull request #2475 from lonvia/catchup-mode
[nominatim.git] / docs / CMakeLists.txt
index fb121c8f79d900969f2463a6f4022e22a35a7402..191c221c092579eea8cc1e2e1446e1cea5670ee5 100644 (file)
@@ -1,18 +1,36 @@
 # Auto-generated vagrant install documentation
 
-set (INSTALLDOCFILES
-     install-on-centos-7
-    )
 
-foreach (df ${INSTALLDOCFILES})
-    ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${df}.md
-        COMMAND sed [=['/^#!/d;s:^#\( \|$$\)::;s/.*#DOCS://']=] ${PROJECT_SOURCE_DIR}/vagrant/${df}.sh > ${CMAKE_CURRENT_BINARY_DIR}/${df}.md
-        MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/vagrant/${df}.sh
-        COMMENT "Creating markdown docs from vagrant/${df}.sh"
-        )
+# build the actual documentation
+
+configure_file(mkdocs.yml ../mkdocs.yml)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/appendix)
+
+set (DOC_SOURCES
+     admin
+     develop
+     api
+     customize
+     index.md
+     extra.css
+     styles.css
+    )
 
-ADD_CUSTOM_TARGET( md_install_${df} ALL
-        DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${df}.md
-        )
+foreach (src ${DOC_SOURCES})
+    execute_process(
+        COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${CMAKE_CURRENT_BINARY_DIR}/${src}
+    )
 endforeach()
 
+ADD_CUSTOM_TARGET(doc
+   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bash2md.sh ${PROJECT_SOURCE_DIR}/vagrant/Install-on-Centos-7.sh ${CMAKE_CURRENT_BINARY_DIR}/appendix/Install-on-Centos-7.md
+   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bash2md.sh ${PROJECT_SOURCE_DIR}/vagrant/Install-on-Centos-8.sh ${CMAKE_CURRENT_BINARY_DIR}/appendix/Install-on-Centos-8.md
+   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bash2md.sh ${PROJECT_SOURCE_DIR}/vagrant/Install-on-Ubuntu-18.sh ${CMAKE_CURRENT_BINARY_DIR}/appendix/Install-on-Ubuntu-18.md
+   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bash2md.sh ${PROJECT_SOURCE_DIR}/vagrant/Install-on-Ubuntu-20.sh ${CMAKE_CURRENT_BINARY_DIR}/appendix/Install-on-Ubuntu-20.md
+   COMMAND PYTHONPATH=${PROJECT_SOURCE_DIR} mkdocs build -d ${CMAKE_CURRENT_BINARY_DIR}/../site-html -f ${CMAKE_CURRENT_BINARY_DIR}/../mkdocs.yml
+)
+
+ADD_CUSTOM_TARGET(serve-doc
+    COMMAND PYTHONPATH=${PROJECT_SOURCE_DIR} mkdocs serve
+    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+)