Struct cmake::Config
[−]
[src]
pub struct Config { // some fields omitted }
Builder style configuration for a pending CMake build.
Methods
impl Config
[src]
fn new<P: AsRef<Path>>(path: P) -> Config
Creates a new blank set of configuration to build the project specified
at the path path
.
fn cflag<P: AsRef<OsStr>>(&mut self, flag: P) -> &mut Config
Adds a custom flag to pass down to the compiler, supplementing those that this library already passes.
fn define<K, V>(&mut self, k: K, v: V) -> &mut Config where K: AsRef<OsStr>, V: AsRef<OsStr>
Adds a new -D
flag to pass to cmake during the generation step.
fn register_dep(&mut self, dep: &str) -> &mut Config
Registers a dependency for this compilation on the native library built by Cargo previously.
This registration will modify the CMAKE_PREFIX_PATH
environment
variable for the build system generation step.
fn target(&mut self, target: &str) -> &mut Config
Sets the target triple for this compilation.
This is automatically scraped from $TARGET
which is set for Cargo
build scripts so it's not necessary to call this from a build script.
fn host(&mut self, host: &str) -> &mut Config
Sets the host triple for this compilation.
This is automatically scraped from $HOST
which is set for Cargo
build scripts so it's not necessary to call this from a build script.
fn out_dir<P: AsRef<Path>>(&mut self, out: P) -> &mut Config
Sets the output directory for this compilation.
This is automatically scraped from $OUT_DIR
which is set for Cargo
build scripts so it's not necessary to call this from a build script.
fn profile(&mut self, profile: &str) -> &mut Config
Sets the profile for this compilation.
This is automatically scraped from $PROFILE
which is set for Cargo
build scripts so it's not necessary to call this from a build script.
fn build_arg<A: AsRef<OsStr>>(&mut self, arg: A) -> &mut Config
Add an argument to the final cmake
build step
fn build_target(&mut self, target: &str) -> &mut Config
Sets the build target for the final cmake
build step, this will
default to "install" if not specified.
fn build(&mut self) -> PathBuf
Run this configuration, compiling the library with all the configured options.
This will run both the build system generator command as well as the command to build the library.