Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CMake Doxygen install (match Makefile builds) #685

Merged
Merged
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
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_SOURCE_DIR}/api/"
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()