Skip to content

Commit

Permalink
Enable CMake install of api docs from tarball w/o doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmf01 committed Jun 7, 2024
1 parent d21202e commit d6204ea
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
cmake_minimum_required(VERSION 3.9)

find_package(Doxygen)
option(BUILD_DOXYGEN "Enable API documentation building via Doxygen if not already present" ON)

if (NOT DOXYGEN_FOUND)
return()
endif()
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/api")

option(BUILD_DOXYGEN "Enable API documentation building via Doxygen" ON)
find_package(Doxygen)

if (NOT BUILD_DOXYGEN)
return()
endif()
if (NOT DOXYGEN_FOUND)
return()
endif()

set(top_srcdir "${PROJECT_SOURCE_DIR}")
configure_file(Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
if (NOT BUILD_DOXYGEN)
return()
endif()

set(top_srcdir "${PROJECT_SOURCE_DIR}")
configure_file(Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)

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")
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()

0 comments on commit d6204ea

Please sign in to comment.