Add docs support
Some checks failed
CI/CD Pipeline / Code Linting (push) Failing after 24s
CI/CD Pipeline / Build and Test (Debug, clang, ubuntu-latest) (push) Failing after 5m17s
CI/CD Pipeline / Build and Test (Debug, gcc, ubuntu-latest) (push) Failing after 5m32s
CI/CD Pipeline / Build and Test (Release, clang, ubuntu-20.04) (push) Failing after 5m45s
CI/CD Pipeline / Build and Test (Release, clang, ubuntu-latest) (push) Failing after 5m12s
CI/CD Pipeline / Build and Test (Release, gcc, ubuntu-20.04) (push) Failing after 5m22s
CI/CD Pipeline / Build and Test (Release, gcc, ubuntu-latest) (push) Failing after 5m26s
CI/CD Pipeline / Docker Build Test (push) Failing after 1m7s
CI/CD Pipeline / Performance Benchmarks (push) Has been skipped
CI/CD Pipeline / Build Documentation (push) Failing after 18s
CI/CD Pipeline / Create Release Package (push) Has been skipped

This commit is contained in:
2025-06-23 10:02:36 +02:00
parent d6dc083a5a
commit 5302dd9a8a
14 changed files with 4311 additions and 439 deletions

View File

@@ -1,6 +1,11 @@
cmake_minimum_required(VERSION 3.15)
project(SVMClassifier VERSION 1.0.0 LANGUAGES CXX)
project(SVMClassifier
VERSION 1.0.0
LANGUAGES CXX
DESCRIPTION "A C++ library for Support Vector Machine classification using PyTorch"
HOMEPAGE_URL "https://gitea.rmontanana.es/rmontanana/SVMClassifier"
)
set(PROJECT_AUTHOR "Ricardo Montañana Gómez")
# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -98,6 +103,78 @@ set_property(TARGET svm_classifier PROPERTY CXX_STANDARD 17)
# Add examples
add_subdirectory(examples)
# Set default installation paths
include(GNUInstallDirs)
set(CMAKE_INSTALL_DOCDIR ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME})
# Project information for documentation
set(PROJECT_DESCRIPTION "High-performance Support Vector Machine classifier with scikit-learn compatible API")
set(PROJECT_HOMEPAGE_URL "https://github.com/your-username/svm-classifier")
set(PROJECT_AUTHOR "SVM Classifier Development Team")
# Documentation target
option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" OFF)
if(BUILD_DOCUMENTATION OR DOXYGEN_FOUND)
find_package(Doxygen QUIET)
if(DOXYGEN_FOUND)
# Set documentation variables
set(DOXYGEN_INPUT_DIR "${CMAKE_SOURCE_DIR}")
set(DOXYGEN_OUTPUT_DIR "${CMAKE_BINARY_DIR}/docs")
set(DOXYGEN_INDEX_FILE "${DOXYGEN_OUTPUT_DIR}/html/index.html")
# Check for Graphviz/dot for diagrams
if(DOXYGEN_DOT_FOUND)
set(DOXYGEN_DOT_FOUND "YES")
get_filename_component(DOXYGEN_DOT_PATH ${DOXYGEN_DOT_EXECUTABLE} DIRECTORY)
else()
set(DOXYGEN_DOT_FOUND "NO")
set(DOXYGEN_DOT_PATH "")
endif()
# Configure the Doxyfile
configure_file(
"${CMAKE_SOURCE_DIR}/docs/Doxyfile.in"
"${CMAKE_BINARY_DIR}/Doxyfile"
@ONLY
)
# Create output directory
file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR})
# Add custom target for documentation
add_custom_target(doxygen
COMMAND ${DOXYGEN_EXECUTABLE} "${CMAKE_BINARY_DIR}/Doxyfile"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM
)
# Add custom target alias for convenience
add_custom_target(docs DEPENDS doxygen)
# Install documentation
if(BUILD_DOCUMENTATION)
install(
DIRECTORY ${DOXYGEN_OUTPUT_DIR}/html
DESTINATION ${CMAKE_INSTALL_DOCDIR}
COMPONENT documentation
OPTIONAL
)
endif()
message(STATUS "Doxygen found: documentation target 'doxygen' available")
if(DOXYGEN_DOT_FOUND)
message(STATUS "Graphviz dot found: enhanced diagrams will be generated")
else()
message(STATUS "Graphviz dot not found: basic diagrams only")
endif()
else()
message(WARNING "Doxygen not found: documentation target not available")
endif()
endif()
# Enable testing
enable_testing()
add_subdirectory(tests)