based

Opinionated utility library
git clone git://git.dimitrijedobrota.com/based.git
Log | Files | Refs | README | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |

docs.cmake (1292B)


1 # ---- Dependencies ---- 2 3 set(extract_timestamps "") 4 if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24") 5 set(extract_timestamps DOWNLOAD_EXTRACT_TIMESTAMP YES) 6 endif() 7 8 include(FetchContent) 9 FetchContent_Declare( 10 mcss URL 11 https://github.com/friendlyanon/m.css/releases/download/release-1/mcss.zip 12 URL_MD5 00cd2757ebafb9bcba7f5d399b3bec7f 13 SOURCE_DIR "${PROJECT_BINARY_DIR}/mcss" 14 UPDATE_DISCONNECTED YES 15 ${extract_timestamps} 16 ) 17 FetchContent_MakeAvailable(mcss) 18 19 find_package(Python3 3.6 REQUIRED) 20 21 # ---- Declare documentation target ---- 22 23 set( 24 DOXYGEN_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/docs" 25 CACHE PATH "Path for the generated Doxygen documentation" 26 ) 27 28 set(working_dir "${PROJECT_BINARY_DIR}/docs") 29 30 foreach(file IN ITEMS Doxyfile conf.py) 31 configure_file("docs/${file}.in" "${working_dir}/${file}" @ONLY) 32 endforeach() 33 34 set(mcss_script "${mcss_SOURCE_DIR}/documentation/doxygen.py") 35 set(config "${working_dir}/conf.py") 36 37 add_custom_target( 38 docs 39 COMMAND "${CMAKE_COMMAND}" -E remove_directory 40 "${DOXYGEN_OUTPUT_DIRECTORY}/html" 41 "${DOXYGEN_OUTPUT_DIRECTORY}/xml" 42 COMMAND "${Python3_EXECUTABLE}" "${mcss_script}" "${config}" 43 COMMENT "Building documentation using Doxygen and m.css" 44 WORKING_DIRECTORY "${working_dir}" 45 VERBATIM 46 )