From ff184a610ec17fbb6956d3d5a0e090549be739cd Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 29 Mar 2024 15:21:28 -0700 Subject: [PATCH] docs: Add use of depfile to CMake isntructions --- docs/fypp.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/fypp.rst b/docs/fypp.rst index 985f761..881db9e 100644 --- a/docs/fypp.rst +++ b/docs/fypp.rst @@ -2109,11 +2109,15 @@ very first version of this example):: # Generate input file name set(infile "${CMAKE_CURRENT_SOURCE_DIR}/${infileName}") + # Create the dependency file + set(depfile "${CMAKE_CURRENT_BINARY_DIR/${outfileName}.d") + # Custom command to do the processing add_custom_command( OUTPUT "${outfile}" - COMMAND fypp "${infile}" "${outfile}" + COMMAND fypp "${infile}" "${outfile}" --depfile "${depfile}" MAIN_DEPENDENCY "${infile}" + DEPFILE "${depfile}" VERBATIM) # Finally add output file to a list