mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
cmake: Use doxygen for docs if found.
Gbp-Pq: Name 0005-cmake-Use-doxygen-for-docs-if-found.patch
This commit is contained in:
parent
742555a652
commit
00cbd2c197
@ -18,6 +18,9 @@ endif()
|
|||||||
|
|
||||||
# Public options and command line configuration
|
# Public options and command line configuration
|
||||||
option(ENABLE_TEST_PROGRAM "Build test program" OFF)
|
option(ENABLE_TEST_PROGRAM "Build test program" OFF)
|
||||||
|
set(SERIAL_DOCDIR ${CMAKE_INSTALL_PREFIX}/share/doc/serial
|
||||||
|
CACHE STRING "Installation root for doxygen docs."
|
||||||
|
)
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
# If Linux, add rt and pthread
|
# If Linux, add rt and pthread
|
||||||
@ -78,6 +81,7 @@ else()
|
|||||||
target_link_libraries(${PROJECT_NAME} setupapi)
|
target_link_libraries(${PROJECT_NAME} setupapi)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
## Include headers
|
## Include headers
|
||||||
include_directories(include)
|
include_directories(include)
|
||||||
|
|
||||||
@ -101,3 +105,17 @@ if (ENABLE_TEST_PROGRAM)
|
|||||||
add_dependencies(serial_example ${PROJECT_NAME})
|
add_dependencies(serial_example ${PROJECT_NAME})
|
||||||
target_link_libraries(serial_example ${PROJECT_NAME})
|
target_link_libraries(serial_example ${PROJECT_NAME})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package(Doxygen)
|
||||||
|
if (DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
|
||||||
|
set(DOXYGEN_OUT ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile)
|
||||||
|
add_custom_target(doc ALL
|
||||||
|
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
COMMENT "Generating API documentation with Doxygen"
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/html
|
||||||
|
DESTINATION ${SERIAL_DOCDIR}
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user