Struct cmake::Config [−][src]
pub struct Config { /* fields omitted */ }Builder style configuration for a pending CMake build.
Methods
impl Config[src]
impl Configpub fn new<P: AsRef<Path>>(path: P) -> Config[src]
pub fn new<P: AsRef<Path>>(path: P) -> ConfigCreates a new blank set of configuration to build the project specified
at the path path.
pub fn generator<T: AsRef<OsStr>>(&mut self, generator: T) -> &mut Config[src]
pub fn generator<T: AsRef<OsStr>>(&mut self, generator: T) -> &mut ConfigSets the build-tool generator (-G) for this compilation.
pub fn cflag<P: AsRef<OsStr>>(&mut self, flag: P) -> &mut Config[src]
pub fn cflag<P: AsRef<OsStr>>(&mut self, flag: P) -> &mut ConfigAdds a custom flag to pass down to the C compiler, supplementing those that this library already passes.
pub fn cxxflag<P: AsRef<OsStr>>(&mut self, flag: P) -> &mut Config[src]
pub fn cxxflag<P: AsRef<OsStr>>(&mut self, flag: P) -> &mut ConfigAdds a custom flag to pass down to the C++ compiler, supplementing those that this library already passes.
pub fn define<K, V>(&mut self, k: K, v: V) -> &mut Config where
K: AsRef<OsStr>,
V: AsRef<OsStr>, [src]
pub 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.
pub fn register_dep(&mut self, dep: &str) -> &mut Config[src]
pub fn register_dep(&mut self, dep: &str) -> &mut ConfigRegisters 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.
pub fn target(&mut self, target: &str) -> &mut Config[src]
pub fn target(&mut self, target: &str) -> &mut ConfigSets 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.
pub fn no_build_target(&mut self, no_build_target: bool) -> &mut Config[src]
pub fn no_build_target(&mut self, no_build_target: bool) -> &mut ConfigDisables the target option for this compilation.
pub fn host(&mut self, host: &str) -> &mut Config[src]
pub fn host(&mut self, host: &str) -> &mut ConfigSets 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.
pub fn out_dir<P: AsRef<Path>>(&mut self, out: P) -> &mut Config[src]
pub fn out_dir<P: AsRef<Path>>(&mut self, out: P) -> &mut ConfigSets 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.
pub fn profile(&mut self, profile: &str) -> &mut Config[src]
pub fn profile(&mut self, profile: &str) -> &mut ConfigSets 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.
pub fn static_crt(&mut self, static_crt: bool) -> &mut Config[src]
pub fn static_crt(&mut self, static_crt: bool) -> &mut ConfigConfigures whether the /MT flag or the /MD flag will be passed to msvc build tools.
This option defaults to false, and affect only msvc targets.
pub fn build_arg<A: AsRef<OsStr>>(&mut self, arg: A) -> &mut Config[src]
pub fn build_arg<A: AsRef<OsStr>>(&mut self, arg: A) -> &mut ConfigAdd an argument to the final cmake build step
pub fn env<K, V>(&mut self, key: K, value: V) -> &mut Config where
K: AsRef<OsStr>,
V: AsRef<OsStr>, [src]
pub fn env<K, V>(&mut self, key: K, value: V) -> &mut Config where
K: AsRef<OsStr>,
V: AsRef<OsStr>, Configure an environment variable for the cmake processes spawned by
this crate in the build step.
pub fn build_target(&mut self, target: &str) -> &mut Config[src]
pub fn build_target(&mut self, target: &str) -> &mut ConfigSets the build target for the final cmake build step, this will
default to "install" if not specified.
pub fn uses_cxx11(&mut self) -> &mut Config[src]
pub fn uses_cxx11(&mut self) -> &mut ConfigAlters the default target triple on OSX to ensure that c++11 is available. Does not change the target triple if it is explicitly specified.
This does not otherwise affect any CXX flags, i.e. it does not set -std=c++11 or -stdlib=libc++.
pub fn always_configure(&mut self, always_configure: bool) -> &mut Config[src]
pub fn always_configure(&mut self, always_configure: bool) -> &mut ConfigForces CMake to always run before building the custom target.
In some cases, when you have a big project, you can disable
subsequents runs of cmake to make cargo build faster.
pub fn build(&mut self) -> PathBuf[src]
pub fn build(&mut self) -> PathBufRun 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.