Skip to content

Commit

Permalink
Install doxygen and graphviz (dot) to generate Doxygen documentation …
Browse files Browse the repository at this point in the history
…when ENABLE_DOXYGEN=ON
  • Loading branch information
ccadar authored and MartinNowack committed Mar 22, 2022
1 parent 663e034 commit 5a63325
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ LABEL maintainer="KLEE Developers"
# TODO remove adding sudo package
# Create ``klee`` user for container with password ``klee``.
# and give it password-less sudo access (temporarily so we can use the CI scripts)
RUN apt update && DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install sudo emacs-nox vim-nox file python3-dateutil doxygen && \
RUN apt update && DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install sudo emacs-nox vim-nox file python3-dateutil && \
rm -rf /var/lib/apt/lists/* && \
useradd -m klee && \
echo klee:klee | chpasswd && \
Expand Down
15 changes: 10 additions & 5 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ add_custom_target(docs)

option(ENABLE_DOXYGEN "Enable building doxygen documentation" OFF)
if (ENABLE_DOXYGEN)
find_package(Doxygen)
if (DOXYGEN_FOUND)
message(STATUS "Doxygen found")
find_package(Doxygen OPTIONAL_COMPONENTS dot)
if (DOXYGEN_FOUND AND TARGET Doxygen::dot)
message(STATUS "Doxygen and dot found")
set(abs_top_srcdir "${CMAKE_SOURCE_DIR}")
set(abs_top_builddir "${CMAKE_BINARY_DIR}")

Expand All @@ -23,7 +23,7 @@ if (ENABLE_DOXYGEN)

# Add rule to build doxygen documentation
add_custom_target(doc-doxygen
COMMAND "${DOXYGEN_EXECUTABLE}" "${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg"
COMMAND Doxygen::doxygen "${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg"
COMMENT "Generating Doxygen documentation"
USES_TERMINAL
)
Expand All @@ -42,7 +42,12 @@ if (ENABLE_DOXYGEN)
endif ()

else()
message(WARNING "Doxygen not found. Can't build Doxygen documentation")
if (NOT DOXYGEN_FOUND)
message(WARNING "Doxygen not found. Can't build Doxygen documentation")
endif ()
if (NOT TARGET Doxygen::dot)
message(WARNING "dot (graphviz) not found. Can't build Doxygen documentation")
endif ()
set(ENABLE_DOXYGEN OFF
CACHE
BOOL
Expand Down
4 changes: 4 additions & 0 deletions scripts/build/p-klee-linux-ubuntu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ install_build_dependencies_klee() {
dependencies+=(lcov curl git)
fi

if [[ $(to_bool "${ENABLE_DOXYGEN}") -eq 1 ]]; then
dependencies+=(doxygen graphviz)
fi

apt -y --no-install-recommends install "${dependencies[@]}"

pip3 install lit
Expand Down
3 changes: 3 additions & 0 deletions scripts/build/p-klee-osx.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
install_build_dependencies_klee() {
brew upgrade python # upgrade to Python 3
brew link --overwrite python
if [[ $(to_bool "${ENABLE_DOXYGEN}") -eq 1 ]]; then
brew install doxygen graphviz
fi
pip3 install lit tabulate
}

0 comments on commit 5a63325

Please sign in to comment.