Make doxygen optional.

pull/1/head
Joshua Potter 2024-01-06 11:06:19 -07:00
parent a65bb5255e
commit bf7a1668b2
4 changed files with 45 additions and 37 deletions

View File

@ -1,4 +1,6 @@
find_package(Doxygen REQUIRED)
find_package(Doxygen)
if(DOXYGEN_FOUND)
set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/include)
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
@ -22,3 +24,5 @@ add_custom_target(docs DEPENDS ${DOXYGEN_INDEX_FILE})
# Ensure worker is built before documentation.
add_dependencies(docs bootstrap)
endif()

View File

@ -24,7 +24,7 @@
pname = "bootstrap";
src = ./.;
version = "0.1.3";
nativeBuildInputs = with pkgs; [ cmake ];
nativeBuildInputs = with pkgs; [ cmake doxygen ];
installPhase = ''
mkdir -p $out/bin
cp ./bootstrap $out/bin

View File

@ -56,7 +56,7 @@ mkdir -p "$BUILD"/build/{Debug,Release}
# REWRITES
# ============================================================
for file in flake.nix {,src/,test/}CMakeLists.txt
for file in flake.nix {,src/,docs/,test/}CMakeLists.txt
do
sed -i "s/<NAME>/$NAME/g" "$BUILD/$file"
done

View File

@ -1,5 +1,7 @@
find_package(Doxygen REQUIRED)
if(DOXYGEN_FOUND)
set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/include)
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen)
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/xml/index.xml)
@ -20,5 +22,7 @@ add_custom_command(OUTPUT
add_custom_target(docs DEPENDS ${DOXYGEN_INDEX_FILE})
# Ensure worker is built before documentation.
add_dependencies(docs bootstrap)
# Ensure executable is built before documentation.
add_dependencies(docs "<NAME>")
endif()