use thiserror::Error;
#[derive(Error, Debug)]
pub enum QtBuildError {
#[error("QMAKE environment variable specified as {qmake_env_var} but could not detect Qt: {error:?}")]
QMakeSetQtMissing {
qmake_env_var: String,
error: Box<anyhow::Error>,
},
#[error("Could not find Qt")]
QtMissing,
#[error("Could not find matching Qt install for requested version(s): {1} from available local version(s): {0}", .available_versions.iter().map(|version| version.to_string()).collect::<Vec<_>>().join(", "), .requested_versions.iter().map(|version| version.to_string()).collect::<Vec<_>>().join(", "))]
QtMissingVersion {
available_versions: Vec<semver::Version>,
requested_versions: Vec<semver::Version>,
},
#[error("Executing `qmake -query` failed: {0:?}")]
QmakeFailed(#[from] std::io::Error),
#[error("QT_VERSION_MAJOR environment variable specified as {qt_version_major_env_var} but could not parse as integer: {source:?}")]
QtVersionMajorInvalid {
qt_version_major_env_var: String,
source: std::num::ParseIntError,
},
#[error("qmake version ({qmake_version}) does not match version specified by QT_VERSION_MAJOR ({qt_version_major})")]
QtVersionMajorDoesNotMatch {
qmake_version: u64,
qt_version_major: u64,
},
}