Skip to content

Commit

Permalink
Configured CMake to run Doxygen on FFI header file (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
alilleybrinker committed Nov 4, 2020
1 parent c88b168 commit 577965b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
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

0 comments on commit 577965b

Please sign in to comment.