File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// system headers
22#include < filesystem>
33
4+ #ifdef __FreeBSD__
5+ #include < sys/sysctl.h>
6+ #endif
7+
48// library includes
59#include < nlohmann/json.hpp>
610#include < linuxdeploy/core/appdir.h>
@@ -22,7 +26,18 @@ using namespace nlohmann;
2226namespace fs = std::filesystem;
2327
2428fs::path findQmlImportScanner () {
25- return which (" qmlimportscanner" );
29+ auto path = which (" qmlimportscanner" );
30+ if (path.empty ()) {
31+ // at least on FreeBSD the qmlimportscanner binary is installed under
32+ // QT_INSTALL_LIBEXECS for Qt 6 and QT_INSTALL_BINS for Qt5,
33+ // so is not locatable via $PATH
34+ auto qmakeVars = queryQmake (findQmake ());
35+ path = which (qmakeVars[" QT_INSTALL_LIBEXECS" ] + " /qmlimportscanner" );
36+ if (path.empty ())
37+ path = which (qmakeVars[" QT_INSTALL_BINS" ] + " /qmlimportscanner" );
38+ }
39+
40+ return path;
2641}
2742
2843std::string runQmlImportScanner (const std::vector<std::filesystem::path> &sourcesPaths, const std::vector<fs::path> &qmlImportPaths) {
You can’t perform that action at this time.
0 commit comments