pub struct FindPackageBuilder { /* private fields */ }
Expand description
A builder for creating a CMakePackage
instance. An instance of the builder is created by calling
the find_package()
function. Once the package is configured, FindPackageBuilder::find()
will actually
try to find the CMake package and return a CMakePackage
instance (or error if the package is not found
or an error occurs during the search).
Implementations§
Source§impl FindPackageBuilder
impl FindPackageBuilder
Sourcepub fn version(self, version: impl TryInto<Version>) -> Self
pub fn version(self, version: impl TryInto<Version>) -> Self
Optionally specifies the minimum required version for the package to find.
If the package is not found or the version is too low, the find()
method will return
Error::Version
with the version of the package found on the system.
Sourcepub fn components(self, components: impl Into<Vec<String>>) -> Self
pub fn components(self, components: impl Into<Vec<String>>) -> Self
Optionally specifies the required components to locate in the package.
If the package is found, but any of the components is missing, the package is considered
as not found and the find()
method will return Error::PackageNotFound
.
See the documentation on CMake’s find_package()
function and how it
treats the COMPONENTS
argument.
Sourcepub fn verbose(self) -> Self
pub fn verbose(self) -> Self
Enable verbose output.
This will redirect output from actual execution of the cmake
command to the standard output
and standard error of the build script.
Sourcepub fn find(self) -> Result<CMakePackage, Error>
pub fn find(self) -> Result<CMakePackage, Error>
Tries to find the CMake package on the system.
Returns a CMakePackage
instance if the package is found, otherwise an error.
Trait Implementations§
Source§impl Clone for FindPackageBuilder
impl Clone for FindPackageBuilder
Source§fn clone(&self) -> FindPackageBuilder
fn clone(&self) -> FindPackageBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for FindPackageBuilder
impl RefUnwindSafe for FindPackageBuilder
impl Send for FindPackageBuilder
impl Sync for FindPackageBuilder
impl Unpin for FindPackageBuilder
impl UnwindSafe for FindPackageBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more