#cmake #build-dependencies #conan

conan

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

5 releases

0.2.0 Jun 2, 2020
0.1.3 Dec 10, 2019
0.1.2 May 25, 2019
0.1.1 May 24, 2019
0.1.0 May 22, 2019

#144 in Build Utils

Download history 93/week @ 2022-03-10 63/week @ 2022-03-17 59/week @ 2022-03-24 94/week @ 2022-03-31 231/week @ 2022-04-07 57/week @ 2022-04-14 16/week @ 2022-04-21 49/week @ 2022-04-28 59/week @ 2022-05-05 128/week @ 2022-05-12 107/week @ 2022-05-19 71/week @ 2022-05-26 134/week @ 2022-06-02 49/week @ 2022-06-09 14/week @ 2022-06-16 45/week @ 2022-06-23

258 downloads per month

MIT/Apache

19KB
462 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–3MB
~80K SLoC