diff --git a/lib/linuxdeploy b/lib/linuxdeploy index cc7b864..3fdc95e 160000 --- a/lib/linuxdeploy +++ b/lib/linuxdeploy @@ -1 +1 @@ -Subproject commit cc7b86472c3caa3fd729b9dc502fd2aa78394257 +Subproject commit 3fdc95e75b6512430c59d4db12b28fa9bf0559c0 diff --git a/src/qml.cpp b/src/qml.cpp index 3d588e5..6f997c1 100644 --- a/src/qml.cpp +++ b/src/qml.cpp @@ -1,6 +1,10 @@ // system headers #include +#ifdef __FreeBSD__ +#include +#endif + // library includes #include #include @@ -22,7 +26,18 @@ using namespace nlohmann; namespace fs = std::filesystem; fs::path findQmlImportScanner() { - return which("qmlimportscanner"); + auto path = which("qmlimportscanner"); + if (path.empty()) { + // at least on FreeBSD the qmlimportscanner binary is installed under + // QT_INSTALL_LIBEXECS for Qt 6 and QT_INSTALL_BINS for Qt5, + // so is not locatable via $PATH + auto qmakeVars = queryQmake(findQmake()); + path = which(qmakeVars["QT_INSTALL_LIBEXECS"] + "/qmlimportscanner"); + if (path.empty()) + path = which(qmakeVars["QT_INSTALL_BINS"] + "/qmlimportscanner"); + } + + return path; } std::string runQmlImportScanner(const std::vector &sourcesPaths, const std::vector &qmlImportPaths) { diff --git a/tests/test_deploy_qml.cpp b/tests/test_deploy_qml.cpp index 4ec945e..c6af3d1 100644 --- a/tests/test_deploy_qml.cpp +++ b/tests/test_deploy_qml.cpp @@ -52,10 +52,9 @@ namespace linuxdeploy { TEST_F(TestDeployQml, find_qmlimporter_path) { auto result = findQmlImportScanner(); - std::filesystem::path expected = "/usr/bin/qmlimportscanner"; ASSERT_FALSE(result.empty()); - ASSERT_EQ(result.string(), expected.string()); + ASSERT_EQ(result.filename().string(), "qmlimportscanner"); } TEST_F(TestDeployQml, runQmlImportScanner) {