Skip to content

Commit

Permalink
Use Noa for Doxygen (#718)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Feb 9, 2024
1 parent 547c2fb commit 8cd4743
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 5 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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()
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
6 changes: 3 additions & 3 deletions doxygen/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
File renamed without changes

0 comments on commit 8cd4743

Please sign in to comment.