@@ -570,7 +570,68 @@ public:
570
570
return false;
571
571
}
572
572
};
573
+ #line 1 "boost.qcm"
574
+ /*
575
+ -----BEGIN QCMOD-----
576
+ name: Boost.Signals2
577
+ section: libraries
578
+ description: Configuration for the Boost.Signals2 library, a part of the Boost C++ Libraries.
579
+ -----END QCMOD-----
580
+ */
581
+
582
+ class qc_boost : public ConfObj
583
+ {
584
+ public:
585
+ qc_boost(Conf *c) : ConfObj(c) {}
586
+ QString name() const { return "Boost.Signals2 >= 1.71"; }
587
+ QString shortname() const { return "boost"; }
588
+ bool checkBoostVersion() {
589
+ QProcess process;
590
+ 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'");
591
+ process.waitForFinished();
592
+ QString output(process.readAllStandardOutput());
593
+ output = output.trimmed();
594
+
595
+ QStringList versionParts = output.split(".");
596
+ if (versionParts.size() < 2) {
597
+ return false; // Version format error
598
+ }
599
+
600
+ int majorVersion = versionParts[0].toInt();
601
+ int minorVersion = versionParts[1].toInt();
602
+
603
+ return (majorVersion > 1 || (majorVersion == 1 && minorVersion >= 71));
604
+ }
605
+ QString findBoostIncludePath()
606
+ {
607
+ QStringList possiblePaths = { "/usr/local/include", "/usr/include" };
608
+ QString boostHeader = "boost/signals2.hpp"; // Boost signals header file
609
+
610
+ foreach (const QString &path, possiblePaths) {
611
+ QDir dir(path);
612
+ if (dir.exists(boostHeader)) {
613
+ return path; // Return the path where Boost headers are found
614
+ }
615
+ }
573
616
617
+ return QString(); // Return empty if Boost headers are not found
618
+ }
619
+ bool exec()
620
+ {
621
+ if (!checkBoostVersion()) {
622
+ printf("checkBoostVersion err \\ n");
623
+ return false;
624
+ }
625
+ QString boostIncludePath = findBoostIncludePath();
626
+ if (boostIncludePath.isEmpty()) {
627
+ printf("boostIncludePath err \\ n");
628
+ return false;
629
+ }
630
+
631
+ conf->addIncludePath(boostIncludePath);
632
+ return true;
633
+ }
634
+ };
574
635
EOT
575
636
cat > " $1 /modules_new.cpp" << EOT
576
637
o = new qc_qt5(conf);
@@ -588,6 +649,9 @@ cat >"$1/modules_new.cpp" <<EOT
588
649
o = new qc_cargo(conf);
589
650
o->required = true;
590
651
o->disabled = false;
652
+ o = new qc_boost(conf);
653
+ o->required = true;
654
+ o->disabled = false;
591
655
592
656
EOT
593
657
cat > " $1 /conf4.h" << EOT
0 commit comments