1
+ // library headers
2
+ #include < linuxdeploy/util/util.h>
3
+
1
4
// local headers
2
5
#include " util.h"
3
6
@@ -19,28 +22,6 @@ procOutput check_command(const std::vector<std::string> &args) {
19
22
return {returnCode == 0 , returnCode, out, err};
20
23
}
21
24
22
- boost::filesystem::path which (const std::string &name) {
23
- subprocess::Popen proc ({" which" , name.c_str ()}, subprocess::output (subprocess::PIPE));
24
- auto output = proc.communicate ();
25
-
26
- using namespace linuxdeploy ::core::log;
27
-
28
- ldLog () << LD_DEBUG << " Calling 'which" << name << LD_NO_SPACE << " '" << std::endl;
29
-
30
- if (proc.retcode () != 0 ) {
31
- ldLog () << LD_DEBUG << " which call failed, exit code:" << proc.retcode () << std::endl;
32
- return " " ;
33
- }
34
-
35
- std::string path = output.first .buf .data ();
36
-
37
- while (path.back () == ' \n ' ) {
38
- path.erase (path.end () - 1 , path.end ());
39
- }
40
-
41
- return path;
42
- }
43
-
44
25
std::map<std::string, std::string> queryQmake (const boost::filesystem::path& qmakePath) {
45
26
auto qmakeCall = check_command ({qmakePath.string (), " -query" });
46
27
@@ -95,10 +76,10 @@ boost::filesystem::path findQmake() {
95
76
ldLog () << " Using user specified qmake:" << qmakePath << std::endl;
96
77
} else {
97
78
// search for qmake
98
- qmakePath = which (" qmake-qt5" );
79
+ qmakePath = linuxdeploy::util:: which (" qmake-qt5" );
99
80
100
81
if (qmakePath.empty ())
101
- qmakePath = which (" qmake" );
82
+ qmakePath = linuxdeploy::util:: which (" qmake" );
102
83
}
103
84
104
85
return qmakePath;
0 commit comments