2019-11-14 01:10:02 +03:00
|
|
|
cmake_minimum_required(VERSION 3.9)
|
|
|
|
|
2024-05-02 10:17:12 +03:00
|
|
|
option(BUILD_DOXYGEN "Enable API documentation building via Doxygen if not already present" ON)
|
2019-03-31 23:04:45 +03:00
|
|
|
|
2024-05-02 10:17:12 +03:00
|
|
|
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/api")
|
2019-03-31 23:04:45 +03:00
|
|
|
|
2024-05-02 10:17:12 +03:00
|
|
|
find_package(Doxygen)
|
2019-03-31 23:04:45 +03:00
|
|
|
|
2024-05-02 10:17:12 +03:00
|
|
|
if (NOT DOXYGEN_FOUND)
|
|
|
|
return()
|
|
|
|
endif()
|
2019-03-31 23:04:45 +03:00
|
|
|
|
2024-05-02 10:17:12 +03:00
|
|
|
if (NOT BUILD_DOXYGEN)
|
|
|
|
return()
|
|
|
|
endif()
|
2019-03-31 23:04:45 +03:00
|
|
|
|
2024-05-02 10:17:12 +03:00
|
|
|
set(top_srcdir "${PROJECT_SOURCE_DIR}")
|
|
|
|
configure_file(Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
|
2020-05-02 08:54:28 +03:00
|
|
|
|
2022-09-05 20:11:31 +03:00
|
|
|
|
2024-05-02 10:17:12 +03:00
|
|
|
add_custom_target(FLAC-doxygen ALL
|
|
|
|
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMENT "Generating API documentation with Doxygen"
|
|
|
|
VERBATIM )
|
|
|
|
|
|
|
|
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doxytmp/html/"
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DOCDIR}/api")
|
|
|
|
else()
|
|
|
|
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/api/"
|
|
|
|
DESTINATION "${CMAKE_INSTALL_DOCDIR}/api")
|
|
|
|
endif()
|