From 8cd4743b13c39017e4d023989f3a487d4012ac1e Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 9 Feb 2024 12:56:32 -0400 Subject: [PATCH] Use Noa for Doxygen (#718) Signed-off-by: Juan Cruz Viotti --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 24 ++++---------------- Makefile | 13 +++++++---- doxygen/Doxyfile.in | 6 ++--- assets/doxygen-logo.png => doxygen/logo.png | Bin 5 files changed, 17 insertions(+), 28 deletions(-) rename assets/doxygen-logo.png => doxygen/logo.png (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49d6f19a..f8c60176 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: -DCMAKE_BUILD_TYPE:STRING=Release -DJSONBINPACK_CLI:BOOL=ON -DJSONBINPACK_TESTS:BOOL=ON - -DJSONBINPACK_DOCS:BOOL=ON + -DJSONBINPACK_DOCS:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON - run: cmake --build ./build --config Release --target clang_format_test diff --git a/CMakeLists.txt b/CMakeLists.txt index fa90e6bc..67cad13d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,9 +64,12 @@ if(JSONBINPACK_TESTS) add_subdirectory(test/e2e) endif() -# Website -if(PROJECT_IS_TOP_LEVEL) +# TODO: Rename to JSONBINPACK_WEBSITE +if(JSONBINPACK_DOCS) string(TOLOWER ${CMAKE_BUILD_TYPE} JSONBINPACK_BUILD_TYPE) + noa_target_doxygen(CONFIG "${PROJECT_SOURCE_DIR}/doxygen/Doxyfile.in" + OUTPUT "${PROJECT_SOURCE_DIR}/build/${JSONBINPACK_BUILD_TYPE}/www/api") + set(JSONBINPACK_WEBSITE_OUT ${PROJECT_SOURCE_DIR}/build/${JSONBINPACK_BUILD_TYPE}/www) set(JSONBINPACK_WEBSITE_SRC ${PROJECT_SOURCE_DIR}/www) @@ -94,21 +97,4 @@ if(PROJECT_IS_TOP_LEVEL) else() message(WARNING "Could not find `jekyll` in the system") endif() - - # TODO: Use Noa for Doxygen - find_package(Doxygen) - if(DOXYGEN_FOUND) - set(DOXYGEN_IN "${PROJECT_SOURCE_DIR}/doxygen/Doxyfile.in") - set(DOXYGEN_OUT "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile") - configure_file("${DOXYGEN_IN}" "${DOXYGEN_OUT}" @ONLY) - add_custom_target(doxygen - WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" - VERBATIM - COMMAND "${CMAKE_COMMAND}" -E make_directory "${JSONBINPACK_WEBSITE_OUT}" - COMMAND "${DOXYGEN_EXECUTABLE}" "${DOXYGEN_OUT}") - set_target_properties(doxygen - PROPERTIES FOLDER "Website") - else() - message(WARNING "Could not find `doxygen` in the system") - endif() endif() diff --git a/Makefile b/Makefile index cd1607ec..f32edb45 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ configure: .always -DCMAKE_BUILD_TYPE:STRING=$(PRESET) \ -DJSONBINPACK_CLI:BOOL=ON \ -DJSONBINPACK_TESTS:BOOL=ON \ + -DJSONBINPACK_DOCS:BOOL=ON \ -DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON compile: .always @@ -22,18 +23,20 @@ compile: .always $(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \ --component sourcemeta_jsonbinpack_dev +lint: .always + $(CMAKE) --build ./build --config $(PRESET) --target clang_tidy + test: .always $(CTEST) --test-dir ./build --build-config $(PRESET) \ --output-on-failure --progress --parallel -lint: .always - $(CMAKE) --build ./build --config $(PRESET) --target clang_tidy +website: .always + $(CMAKE) --build ./build --config $(PRESET) --target bundler + $(CMAKE) --build ./build --config $(PRESET) --target jekyll + $(CMAKE) --build ./build --config $(PRESET) --target doxygen clean: .always $(CMAKE) -E rm -R -f build -doxygen: - $(CMAKE) --build ./build --config $(PRESET) --target doxygen - # For NMake, which doesn't support .PHONY .always: diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in index 04a784a7..adccf20a 100644 --- a/doxygen/Doxyfile.in +++ b/doxygen/Doxyfile.in @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "@CMAKE_PROJECT_NAME@" +PROJECT_NAME = JSON BinPack # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -51,14 +51,14 @@ PROJECT_BRIEF = "@CMAKE_PROJECT_DESCRIPTION@" # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = @PROJECT_SOURCE_DIR@/assets/doxygen-logo.png +PROJECT_LOGO = @PROJECT_SOURCE_DIR@/doxygen/logo.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = @JSONBINPACK_WEBSITE_OUT@/api +OUTPUT_DIRECTORY = @NOA_TARGET_DOXYGEN_OUTPUT@ # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and diff --git a/assets/doxygen-logo.png b/doxygen/logo.png similarity index 100% rename from assets/doxygen-logo.png rename to doxygen/logo.png