#build-dependencies #conan #cmake

conan

A Rust wrapper of the conan C/C++ package manager (conan.io) to simplify usage in build scripts

4 releases

✓ Uses Rust 2018 edition

0.1.3 Dec 10, 2019
0.1.2 May 25, 2019
0.1.1 May 24, 2019
0.1.0 May 22, 2019

#30 in Build Utils

Download history 82/week @ 2019-11-30 136/week @ 2019-12-07 177/week @ 2019-12-14 44/week @ 2019-12-21 26/week @ 2019-12-28 147/week @ 2020-01-04 180/week @ 2020-01-11 115/week @ 2020-01-18 85/week @ 2020-01-25 110/week @ 2020-02-01 42/week @ 2020-02-08 112/week @ 2020-02-15 104/week @ 2020-02-22 96/week @ 2020-02-29 101/week @ 2020-03-07 112/week @ 2020-03-14

548 downloads per month

MIT/Apache

18KB
429 lines

conan-rs

A Rust wrapper of the conan C/C++ package manager (conan.io) to simplify usage in build scripts.

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

The conan executable is assumed to be conan unless the CONAN environment variable is set.

extern crate conan;
use conan::*;

fn main() {
    let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
    let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
    let conan_profile = format!("{}-{}", target_os, target_arch);

    let command = InstallCommandBuilder::new()
        .with_profile(&conan_profile)
        .build_policy(BuildPolicy::Missing)
        .recipe_path(Path::new("conanfile.txt"))
        .build();

    if let Some(build_info) = command.generate() {
        println!("using conan build info");
        build_info.cargo_emit();
        return;
    }
}

Dependencies

~2.2–3MB
~78K SLoC