<div dir="ltr"><div>Hello,</div><div><br></div><div>I'm creating a static library (*.a) with a separate build system (cargo). That build system also produces a dependency file in the Makefile format (also produced by `gcc -M`). Is it possible to include this file into the generated makefiles either through a makefile inclusion or through cmake parsing the file?<br></div><div><br></div><div>Obviously I don't want to call `cargo` unless one of my source files changed.</div><div><br></div><div>Here is what I've got so far:<br></div><div><br></div><div>```</div><div>add_custom_command(<br>  OUTPUT<br>    ${CMAKE_CURRENT_BINARY_DIR}/rust/test/target/${RUST_PROFILE}/libtest.a<br>  COMMAND<br>    ${CMAKE_COMMAND} -E env SYSROOT=${CMAKE_SYSROOT} INCLUDES="${RUST_INCLUDES}" cargo build --manifest-path ${CMAKE_CURRENT_SOURCE_DIR}/rust/test/Cargo.toml --target-dir ${CMAKE_CURRENT_BINARY_DIR}/rust/test/target ${RUST_CARGO_FLAG}<br>  COMMAND<br>  )<br>add_custom_target(rust DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/rust/test/target/${RUST_PROFILE}/libbase.a)<br></div><div>```<br></div><div><br></div><div><br></div><div>Thanks<br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">- Niklas<br></div></div></div></div></div>