Calling external build system

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Calling external build system

Niklas Claesson

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?

Obviously I don't want to call `cargo` unless one of my source files changed.

Here is what I've got so far:

    ${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}
add_custom_target(rust DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/rust/test/target/${RUST_PROFILE}/libbase.a)

- Niklas


Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: