Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,9 @@ poetry.toml

# Test models for lora adapters
/lora-tests

# Ignore all files in docs-api
docs-api/*
# Except Doxyfile and CMakeLists.txt
!docs-api/Doxyfile
!docs-api/CMakeLists.txt
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ option(LLAMA_BUILD_SERVER "llama: build server example" ${LLAMA_STANDALONE})
# 3rd party libs
option(LLAMA_CURL "llama: use libcurl to download model from an URL" OFF)

# doxygen documentation
option(LLAMA_DOCS "Build documentation" OFF)

# Required for relocatable CMake package
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/build-info.cmake)

Expand Down Expand Up @@ -214,3 +217,8 @@ if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(pocs)
endif()

if(LLAMA_DOCS)
add_subdirectory(docs-api)
endif()

13 changes: 13 additions & 0 deletions docs-api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
find_package(Doxygen)

if (DOXYGEN_FOUND)
message("Doxygen found. Generating documentation...")
add_custom_target(doc ALL
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM
)
else ()
message(FATAL_ERROR "Doxygen is needed to build the documentation. Please install it.")
endif ()
Loading