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

Configured CMake to run Doxygen on FFI header file #25

Merged
merged 1 commit into from
Jun 26, 2020
Merged
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions rust/pact_matching_ffi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ find_package(Cargo REQUIRED)
# Uses the finder specified in `cmake/FindCbindgen.cmake`
find_package(Cbindgen REQUIRED)

# CMake can find Doxygen without a custom finder module.
find_package(Doxygen)

#################################################################################################
# VARIABLES
#
Expand Down Expand Up @@ -250,6 +253,24 @@ add_custom_target(generate_header ALL
# Teach CMake to install the header file built by the generate_header target
install(FILES "${CBINDGEN_HEADER_FILE}" TYPE INCLUDE)


#################################################################################################
# DOXYGEN
#
# Generates configuration for Doxygen and runs it to generate documentation.
#################################################################################################

if(DOXYGEN_FOUND)
doxygen_add_docs(
generate_docs
${CBINDGEN_HEADER_FILE}
ALL
USE_STAMP_FILE
COMMENT "Generating documentation with doxygen")
else()
message(WARNING "Could not find Doxygen; FFI documentation will not be generated")
endif()

#################################################################################################
# PACKAGE FILES
#
Expand Down
2 changes: 1 addition & 1 deletion rust/pact_matching_ffi/cbindgen.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cpp_compat = true
braces = "SameLine"
line_length = 100
tab_width = 2
documentation_style = "auto"
documentation_style = "doxy"

############################# Codegen Options ##################################

Expand Down