Skip to content

Commit

Permalink
Fixed website generation
Browse files Browse the repository at this point in the history
Fix #506
  • Loading branch information
jbigot committed Jan 23, 2025
1 parent 345fddf commit 18b9873
Show file tree
Hide file tree
Showing 5 changed files with 369 additions and 50 deletions.
2 changes: 2 additions & 0 deletions pdi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to
#### Fixed
* Stop claiming to support old cmake versions we do not
[#507](https://github.com/pdidev/pdi/issues/507)
* Fixed website generation
[#506](https://github.com/pdidev/pdi/issues/506)


## [1.8.0] - 2024-11-28
Expand Down
7 changes: 5 additions & 2 deletions pdi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ if("${BUILD_PYTHON}")
set(PYBIND11_PYTHON_VERSION "${Python3_VERSION}" CACHE STRING "Python version to use for compiling modules" FORCE)
find_package(pybind11 2.4.3 REQUIRED) # must match PDIConfig.cmake.in
endif()
if("${BUILD_FORTRAN}")
if("${BUILD_FORTRAN}" OR "${BUILD_DOCUMENTATION}")
add_subdirectory("../vendor/zpp-1.0.16/" "zpp")
endif()

Expand Down Expand Up @@ -309,8 +309,11 @@ endif()

# Fortran API library

if("${BUILD_FORTRAN}")
if("${BUILD_FORTRAN}" OR "${BUILD_DOCUMENTATION}")
zpp_preprocess(OUTPUT PDIF_H SOURCES src/fortran/pdif.h.zpp)
add_custom_target(generated_files_for_doc DEPENDS "${PDIF_H}")
endif()
if("${BUILD_FORTRAN}")
zpp_preprocess(OUTPUT PDI_F90 SOURCES src/fortran/pdi.f90.zpp)
file(MAKE_DIRECTORY "${PDI_BINARY_DIR}/fmoddir")
add_custom_target(mv_zpp_files # we put in in fmoddir because pdif.h is compiler dependant
Expand Down
64 changes: 16 additions & 48 deletions pdi/docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,66 +29,24 @@

cmake_minimum_required(VERSION 3.16...3.29)

find_package(Doxygen 1.8.17 REQUIRED OPTIONAL_COMPONENTS dot)
find_package(Doxygen 1.8.17 REQUIRED)

add_custom_target(doc ALL)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html")

set(DOXYGEN_AUTOLINK_SUPPORT YES)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_DISABLE_INDEX YES)
set(DOXYGEN_ENUM_VALUES_PER_LINE 1)
set(DOXYGEN_EXAMPLE_PATH "${PDI_SOURCE_DIR}/.." "${PDI_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
set(DOXYGEN_EXPAND_ONLY_PREDEF YES)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_EXTRACT_LOCAL_CLASSES NO)
set(DOXYGEN_FULL_PATH_NAMES NO)
set(DOXYGEN_GENERATE_TREEVIEW YES)
#set(DOXYGEN_GENERATE_XML YES) # Crashes on Gitlab CI
set(DOXYGEN_HTML_FOOTER "${CMAKE_CURRENT_SOURCE_DIR}/_template/footer.html")
set(DOXYGEN_HTML_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/_template/header.html")
set(DOXYGEN_HTML_STYLESHEET "${CMAKE_CURRENT_SOURCE_DIR}/_template/style.css")
set(DOXYGEN_HTML_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html")
set(DOXYGEN_HTML_TIMESTAMP YES)
set(DOXYGEN_INCLUDE_GRAPH NO)
set(DOXYGEN_INCLUDE_PATH "${PDI_SOURCE_DIR}/include/" "${PDI_SOURCE_DIR}/src/" "${PDI_BINARY_DIR}")
set(DOXYGEN_INCLUDED_BY_GRAPH NO)
set(DOXYGEN_INLINE_SIMPLE_STRUCTS YES)
set(DOXYGEN_JAVADOC_AUTOBRIEF YES)
set(DOXYGEN_LAYOUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/_template/layout.xml")
set(DOXYGEN_MACRO_EXPANSION YES)
set(DOXYGEN_PREDEFINED "PDI_EXPORT=" "PDI_NO_EXPORT=" "PDI_DEPRECATED_EXPORT=")
set(DOXYGEN_PROJECT_LOGO "${CMAKE_CURRENT_SOURCE_DIR}/_template/logo.png")
set(DOXYGEN_PROJECT_NUMBER "${PDI_VERSION}")
set(DOXYGEN_QT_AUTOBRIEF YES)
set(DOXYGEN_RECURSIVE NO)
set(DOXYGEN_SEARCHENGINE NO)
set(DOXYGEN_SHOW_FILES NO)
set(DOXYGEN_SHOW_INCLUDE_FILES NO)
set(DOXYGEN_SORT_MEMBER_DOCS NO)
set(DOXYGEN_SORT_MEMBERS_CTORS_1ST YES)
set(DOXYGEN_TOC_INCLUDE_HEADINGS 4)
set(DOXYGEN_TYPEDEF_HIDES_STRUCT YES)
set(DOXYGEN_UML_LIMIT_NUM_FIELDS 20)
set(DOXYGEN_UML_LOOK YES)
set(DOXYGEN_WARN_NO_PARAMDOC YES)
set(DOXYGEN_IMAGE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/images")
doxygen_add_docs(doxygen_doc
set(DOXYGEN_INPUT
"${CMAKE_CURRENT_SOURCE_DIR}/About.md"
"${CMAKE_CURRENT_SOURCE_DIR}/Concepts.md"
"${CMAKE_CURRENT_SOURCE_DIR}/FAQ.md"
"${CMAKE_CURRENT_SOURCE_DIR}/First_steps.md"
"${CMAKE_CURRENT_SOURCE_DIR}/How_to_create_plugin.md"
"${CMAKE_CURRENT_SOURCE_DIR}/Installation.md"
"${CMAKE_CURRENT_SOURCE_DIR}/modules.md"
"${CMAKE_CURRENT_SOURCE_DIR}/Plugins.md"
"${CMAKE_CURRENT_SOURCE_DIR}/Specification_tree_ref.md"
"${CMAKE_CURRENT_SOURCE_DIR}/Source_installation.md"
"${CMAKE_CURRENT_SOURCE_DIR}/Using_PDI.md"
"${CMAKE_CURRENT_SOURCE_DIR}/Yaml.md"
"${PDI_BINARY_DIR}/pdi/export.h"
"${PDI_BINARY_DIR}/pdi/version.h"
"${PDI_BINARY_DIR}/fmoddir/pdif.h"
"${PDIF_H}"
"${PDI_SOURCE_DIR}/include/pdi.h"
"${PDI_SOURCE_DIR}/include/pdi/"
"${PDI_SOURCE_DIR}/../example/README.md"
Expand All @@ -101,6 +59,16 @@ doxygen_add_docs(doxygen_doc
"${PDI_SOURCE_DIR}/../plugins/pycall/README.md"
"${PDI_SOURCE_DIR}/../plugins/serialize/README.md"
"${PDI_SOURCE_DIR}/../plugins/set_value/README.md")
add_subdirectory(First_steps)
add_dependencies(doc doxygen_doc)

file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html")
string(REPLACE ";" " " DOXYGEN_INPUT_SP "${DOXYGEN_INPUT}")
configure_file(Doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile")
add_custom_target(doc ALL
Doxygen::doxygen "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DEPENDS ${DOXYGEN_INPUT}
)
add_dependencies(doc generated_files_for_doc)
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/" DESTINATION "${CMAKE_INSTALL_DOCDIR}/html")

add_subdirectory(First_steps)
Loading

0 comments on commit 18b9873

Please sign in to comment.