#build-dependencies

build cmake

A build dependency for running cmake to build a native library

34 releases

0.1.33 Aug 14, 2018
0.1.31 May 3, 2018
0.1.29 Dec 7, 2017
0.1.28 Nov 14, 2017
0.1.1 Jul 31, 2015

#3 in Windows APIs

Download history 21051/week @ 2018-09-14 21269/week @ 2018-09-21 17941/week @ 2018-09-28 17230/week @ 2018-10-05 15793/week @ 2018-10-12 17959/week @ 2018-10-19 16024/week @ 2018-10-26 17550/week @ 2018-11-02 16289/week @ 2018-11-09 18382/week @ 2018-11-16 16781/week @ 2018-11-23 16419/week @ 2018-11-30 14055/week @ 2018-12-07

73,062 downloads per month
Used in 305 crates (75 directly)

MIT/Apache

32KB
541 lines

cmake

Build Status

Documentation

A build dependency for running the cmake build tool to compile a native library.

# Cargo.toml
[build-dependencies]
cmake = "0.1"

The CMake executable is assumed to be cmake unless the CMAKE environmental variable is set.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

A build dependency for running cmake to build a native library

This crate provides some necessary boilerplate and shim support for running the system cmake command to build a native library. It will add appropriate cflags for building code to link into Rust, handle cross compilation, and use the necessary generator for the platform being targeted.

The builder-style configuration allows for various variables and such to be passed down into the build as well.

Installation

Add this to your Cargo.toml:

[build-dependencies]
cmake = "0.1"

Examples

use cmake;

// Builds the project in the directory located in `libfoo`, installing it
// into $OUT_DIR
let dst = cmake::build("libfoo");

println!("cargo:rustc-link-search=native={}", dst.display());
println!("cargo:rustc-link-lib=static=foo");
use cmake::Config;

let dst = Config::new("libfoo")
                 .define("FOO", "BAR")
                 .cflag("-foo")
                 .build();
println!("cargo:rustc-link-search=native={}", dst.display());
println!("cargo:rustc-link-lib=static=foo");

Dependencies

~111KB