@@ -69,22 +69,53 @@ int main(const int argc, const char *const *const argv) {
69
69
ldLog () << LD_ERROR << " No such directory:" << appDirPath.Get () << std::endl;
70
70
return 1 ;
71
71
}
72
+
73
+ auto qmakePath = findQmake ();
74
+
75
+ if (qmakePath.empty ()) {
76
+ ldLog () << LD_ERROR << " Could not find qmake, please install or provide path using $QMAKE" << std::endl;
77
+ return 1 ;
78
+ }
79
+
80
+ if (!bf::exists (qmakePath)) {
81
+ ldLog () << LD_ERROR << " No such file or directory:" << qmakePath << std::endl;
82
+ return 1 ;
83
+ }
72
84
73
- int qtMajorVersion = 5 ;
74
- auto qtMajorVersionStr = getenv (" QT_MAJOR_VERSION" );
75
- if (qtMajorVersionStr != nullptr ) {
76
- qtMajorVersion = atoi (qtMajorVersionStr);
77
- if (qtMajorVersion < 5 ) {
78
- ldLog () << std::endl << LD_WARNING << " Minimum Qt version supported is 5" << std::endl;
79
- qtMajorVersion = 5 ;
80
- }
81
- else if (qtMajorVersion > 6 ) {
82
- ldLog () << std::endl << LD_WARNING << " Maximum Qt version supported is 6" << std::endl;
83
- qtMajorVersion = 6 ;
84
- }
85
+ ldLog () << " Using qmake:" << qmakePath << std::endl;
86
+
87
+ auto qmakeVars = queryQmake (qmakePath);
88
+
89
+ if (qmakeVars.empty ()) {
90
+ ldLog () << LD_ERROR << " Failed to query Qt paths using qmake -query" << std::endl;
91
+ return 1 ;
92
+ }
93
+
94
+ const bf::path qtPluginsPath = qmakeVars[" QT_INSTALL_PLUGINS" ];
95
+ const bf::path qtLibexecsPath = qmakeVars[" QT_INSTALL_LIBEXECS" ];
96
+ const bf::path qtDataPath = qmakeVars[" QT_INSTALL_DATA" ];
97
+ const bf::path qtTranslationsPath = qmakeVars[" QT_INSTALL_TRANSLATIONS" ];
98
+ const bf::path qtBinsPath = qmakeVars[" QT_INSTALL_BINS" ];
99
+ const bf::path qtLibsPath = qmakeVars[" QT_INSTALL_LIBS" ];
100
+ const bf::path qtInstallQmlPath = qmakeVars[" QT_INSTALL_QML" ];
101
+ const std::string qtVersion = qmakeVars[" QT_VERSION" ];
102
+
103
+ if (qtVersion.empty ()) {
104
+ ldLog () << LD_ERROR << " Failed to query QT_VERSION using qmake -query" << std::endl;
105
+ return 1 ;
85
106
}
86
107
87
- ldLog () << std::endl << " Using Qt" << qtMajorVersion << std::endl;
108
+ int qtMajorVersion = atoi (qtVersion.c_str ());
109
+ if (qtMajorVersion < 5 ) {
110
+ ldLog () << std::endl << LD_WARNING << " Minimum Qt version supported is 5" << std::endl;
111
+ qtMajorVersion = 5 ;
112
+ }
113
+ else if (qtMajorVersion > 6 ) {
114
+ ldLog () << std::endl << LD_WARNING << " Maximum Qt version supported is 6" << std::endl;
115
+ qtMajorVersion = 6 ;
116
+ }
117
+
118
+ ldLog () << std::endl << " Using Qt version: " << qtVersion << " (" << qtMajorVersion << " )" << std::endl;
88
119
89
120
appdir::AppDir appDir (appDirPath.Get ());
90
121
@@ -188,35 +219,6 @@ int main(const int argc, const char *const *const argv) {
188
219
return 1 ;
189
220
}
190
221
191
- auto qmakePath = findQmake ();
192
-
193
- if (qmakePath.empty ()) {
194
- ldLog () << LD_ERROR << " Could not find qmake, please install or provide path using $QMAKE" << std::endl;
195
- return 1 ;
196
- }
197
-
198
- if (!bf::exists (qmakePath)) {
199
- ldLog () << LD_ERROR << " No such file or directory:" << qmakePath << std::endl;
200
- return 1 ;
201
- }
202
-
203
- ldLog () << " Using qmake:" << qmakePath << std::endl;
204
-
205
- auto qmakeVars = queryQmake (qmakePath);
206
-
207
- if (qmakeVars.empty ()) {
208
- ldLog () << LD_ERROR << " Failed to query Qt paths using qmake -query" << std::endl;
209
- return 1 ;
210
- }
211
-
212
- const bf::path qtPluginsPath = qmakeVars[" QT_INSTALL_PLUGINS" ];
213
- const bf::path qtLibexecsPath = qmakeVars[" QT_INSTALL_LIBEXECS" ];
214
- const bf::path qtDataPath = qmakeVars[" QT_INSTALL_DATA" ];
215
- const bf::path qtTranslationsPath = qmakeVars[" QT_INSTALL_TRANSLATIONS" ];
216
- const bf::path qtBinsPath = qmakeVars[" QT_INSTALL_BINS" ];
217
- const bf::path qtLibsPath = qmakeVars[" QT_INSTALL_LIBS" ];
218
- const bf::path qtInstallQmlPath = qmakeVars[" QT_INSTALL_QML" ];
219
-
220
222
ldLog () << std::endl;
221
223
ldLog () << " QT_INSTALL_LIBS:" << qtLibsPath << std::endl;
222
224
std::ostringstream newLibraryPath;
0 commit comments