jothepro / doxygen-awesome-css

Custom CSS theme for doxygen html-documentation with lots of customization parameters.
https://jothepro.github.io/doxygen-awesome-css/
MIT License
1k stars 117 forks source link

Installation instruction could show how to use the project with CMake #156

Open comkieffer opened 1 month ago

comkieffer commented 1 month ago

It is possible to use the theme without having to clone it as a submodule by using FetchContent in CMake.

In my CMake file, I have

include(FetchContent)
fetchcontent_declare(
    doxygen-awesome-css
    URL https://github.com/jothepro/doxygen-awesome-css/archive/refs/heads/main.zip
)
fetchcontent_makeavailable(doxygen-awesome-css)

# Save the location the files were cloned into
fetchcontent_getproperties(doxygen-awesome-css SOURCE_DIR AWESOME_CSS_DIR)

# set input and output files
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in)
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)

This downloads the latest main (but any other revision could be used) and unpacks in the build folder. The Doxyfile.in can reference this location in the HTML_EXTRA_STYLESHEET field

HTML_EXTRA_STYLESHEET  = @AWESOME_CSS_DIR@/doxygen-awesome.css

When the configure stage of CMake is run, the Doxyfile.in is rendered to Doxyfile and Doxygen can be run as usual.

If this makes sense, I can submit a PR to add this to the installation instructions.

jothepro commented 1 week ago

Sure, a PR regarding this would be very welcome! 😊