diff --git a/configure b/configure index 4bfabb63..9724d0a5 100755 --- a/configure +++ b/configure @@ -570,7 +570,58 @@ public: return false; } }; +#line 1 "boost.qcm" +/* +-----BEGIN QCMOD----- +name: Boost.Signals2 +section: libraries +description: Configuration for the Boost.Signals2 library, a part of the Boost C++ Libraries. +-----END QCMOD----- +*/ + +class qc_boost : public ConfObj +{ +public: + qc_boost(Conf *c) : ConfObj(c) {} + QString name() const { return "Boost.Signals2 >= 1.71"; } + QString shortname() const { return "boost"; } + bool checkBoostVersion() { + QProcess process; + process.start("bash", QStringList() << "-c" << "grep \\"BOOST_LIB_VERSION\\" \$(find /usr/local/Cellar/boost/ /usr/include /usr/local/include -name 'version.hpp' 2> /dev/null | grep 'boost/version.hpp') | grep -v \\"//\\" | cut -d '\\"' -f2 | sed 's/_/./g'"); + process.waitForFinished(); + QString output(process.readAllStandardOutput()); + output = output.trimmed(); + printf("boost version %s \\n", qPrintable(output)); + + QStringList versionParts = output.split("."); + if (versionParts.size() < 2) { + return false; // Version format error + } + int majorVersion = versionParts[0].toInt(); + int minorVersion = versionParts[1].toInt(); + + return (majorVersion > 1 || (majorVersion == 1 && minorVersion >= 71)); + } + QString findBoostIncludePath() + { + QStringList possiblePaths = { "/usr/local/include", "/usr/include" }; + QString boostHeader = "boost/signals2.hpp"; // Boost signals header file + + return QString(); // Return empty if Boost headers are not found + } + bool exec() + { + if (!checkBoostVersion()) { + printf("checkBoostVersion err \\n"); + return false; + } + QString boostIncludePath = findBoostIncludePath(); + printf("boost path %s \\n", qPrintable(boostIncludePath)); + conf->addIncludePath(boostIncludePath); + return true; + } +}; EOT cat >"$1/modules_new.cpp" <"$1/modules_new.cpp" <required = true; o->disabled = false; + o = new qc_boost(conf); + o->required = true; + o->disabled = false; EOT cat >"$1/conf4.h" < + + + diff --git a/qcm/boost.qcm b/qcm/boost.qcm new file mode 100644 index 00000000..c57c6090 --- /dev/null +++ b/qcm/boost.qcm @@ -0,0 +1,51 @@ +/* +-----BEGIN QCMOD----- +name: Boost.Signals2 +section: libraries +description: Configuration for the Boost.Signals2 library, a part of the Boost C++ Libraries. +-----END QCMOD----- +*/ + +class qc_boost : public ConfObj +{ +public: + qc_boost(Conf *c) : ConfObj(c) {} + QString name() const { return "Boost.Signals2 >= 1.71"; } + QString shortname() const { return "boost"; } + bool checkBoostVersion() { + QProcess process; + process.start("bash", QStringList() << "-c" << "grep \"BOOST_LIB_VERSION\" $(find /usr/local/Cellar/boost/ /usr/include /usr/local/include -name 'version.hpp' 2> /dev/null | grep 'boost/version.hpp') | grep -v \"//\" | cut -d '\"' -f2 | sed 's/_/./g'"); + process.waitForFinished(); + QString output(process.readAllStandardOutput()); + output = output.trimmed(); + printf("boost version %s \n", qPrintable(output)); + + QStringList versionParts = output.split("."); + if (versionParts.size() < 2) { + return false; // Version format error + } + + int majorVersion = versionParts[0].toInt(); + int minorVersion = versionParts[1].toInt(); + + return (majorVersion > 1 || (majorVersion == 1 && minorVersion >= 71)); + } + QString findBoostIncludePath() + { + QStringList possiblePaths = { "/usr/local/include", "/usr/include" }; + QString boostHeader = "boost/signals2.hpp"; // Boost signals header file + + return QString(); // Return empty if Boost headers are not found + } + bool exec() + { + if (!checkBoostVersion()) { + printf("checkBoostVersion err \n"); + return false; + } + QString boostIncludePath = findBoostIncludePath(); + printf("boost path %s \n", qPrintable(boostIncludePath)); + conf->addIncludePath(boostIncludePath); + return true; + } +}; \ No newline at end of file