generated from threeal/cpp-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: modify
target_generate_xml_docs
to add_xml_docs
function
- Loading branch information
Showing
4 changed files
with
36 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# A function that generates XML documentation from the specified source files. | ||
function(add_xml_docs TARGET_NAME) | ||
# Try to install Doxygen if not found | ||
find_program(DOXYGEN_PROGRAM doxygen) | ||
if(NOT DOXYGEN_PROGRAM) | ||
find_program(APT_GET_PROGRAM apt-get) | ||
if(APT_GET_PROGRAM) | ||
message(STATUS "Doxygen could not be found, installing...") | ||
execute_process(COMMAND ${APT_GET_PROGRAM} install -y doxygen) | ||
endif() | ||
|
||
find_program(BREW_PROGRAM brew) | ||
if(BREW_PROGRAM) | ||
message(STATUS "Doxygen could not be found, installing...") | ||
execute_process(COMMAND ${BREW_PROGRAM} install doxygen) | ||
endif() | ||
endif() | ||
|
||
# Try to find Doxygen | ||
find_package(Doxygen) | ||
if(DOXYGEN_FOUND) | ||
# Configure Doxygen to generate XML documentation | ||
set(DOXYGEN_GENERATE_HTML NO) | ||
set(DOXYGEN_GENERATE_XML YES) | ||
set(DOXYGEN_XML_OUTPUT ${TARGET_NAME}) | ||
|
||
# Generate XML documentation for the target | ||
doxygen_add_docs(${TARGET_NAME} ${ARGN} USE_STAMP_FILE) | ||
endif() | ||
endfunction() |
This file was deleted.
Oops, something went wrong.