-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sima
committed
Nov 17, 2023
1 parent
6e2e8b6
commit 52684c9
Showing
3 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,7 @@ | |
<dep type='cargo'> | ||
<required/> | ||
</dep> | ||
<dep type='boost'> | ||
<required/> | ||
</dep> | ||
</qconf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
-----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() | ||
{ | ||
return QString(); // Return empty if Boost headers are not found | ||
} | ||
bool exec() | ||
{ | ||
if (!checkBoostVersion()) { | ||
printf("checkBoostVersion err \n"); | ||
return false; | ||
} | ||
return true; | ||
} | ||
}; |