1515
1616#![ allow( clippy:: too_many_arguments) ]
1717
18+ mod error;
19+ pub use error:: QtBuildError ;
20+
1821mod installation;
1922pub use installation:: QtInstallation ;
2023
@@ -38,42 +41,6 @@ use std::{
3841} ;
3942
4043use semver:: Version ;
41- use thiserror:: Error ;
42-
43- #[ derive( Error , Debug ) ]
44- /// Errors that can occur while using [QtBuild]
45- pub enum QtBuildError {
46- /// `QMAKE` environment variable was set but Qt was not detected
47- #[ error( "QMAKE environment variable specified as {qmake_env_var} but could not detect Qt: {error:?}" ) ]
48- QMakeSetQtMissing {
49- /// The value of the qmake environment variable when the error occurred
50- qmake_env_var : String ,
51- /// The inner error that occurred
52- error : Box < anyhow:: Error > ,
53- } ,
54- /// Qt was not found
55- #[ error( "Could not find Qt" ) ]
56- QtMissing ,
57- /// Executing `qmake -query` failed
58- #[ error( "Executing `qmake -query` failed: {0:?}" ) ]
59- QmakeFailed ( #[ from] std:: io:: Error ) ,
60- /// `QT_VERSION_MAJOR` environment variable was specified but could not be parsed as an integer
61- #[ error( "QT_VERSION_MAJOR environment variable specified as {qt_version_major_env_var} but could not parse as integer: {source:?}" ) ]
62- QtVersionMajorInvalid {
63- /// The Qt major version from `QT_VERSION_MAJOR`
64- qt_version_major_env_var : String ,
65- /// The [std::num::ParseIntError] when parsing the `QT_VERSION_MAJOR`
66- source : std:: num:: ParseIntError ,
67- } ,
68- /// `QT_VERSION_MAJOR` environment variable was specified but the Qt version specified by `qmake -query QT_VERSION` did not match
69- #[ error( "qmake version ({qmake_version}) does not match version specified by QT_VERSION_MAJOR ({qt_version_major})" ) ]
70- QtVersionMajorDoesNotMatch {
71- /// The qmake version
72- qmake_version : u64 ,
73- /// The Qt major version from `QT_VERSION_MAJOR`
74- qt_version_major : u64 ,
75- } ,
76- }
7744
7845fn command_help_output ( command : & str ) -> std:: io:: Result < std:: process:: Output > {
7946 Command :: new ( command) . args ( [ "--help" ] ) . output ( )
0 commit comments