Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
shared.h File Reference
#include <QString>
#include <QStringList>
#include <QDebug>
#include <QSet>
#include <QVersionNumber>
+ Include dependency graph for shared.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FrameworkInfo
 
class  DylibInfo
 
class  OtoolInfo
 
class  ApplicationBundleInfo
 
class  DeploymentInfo
 

Macros

#define LogError()   if (logLevel < 0) {} else qDebug() << "ERROR:"
 
#define LogWarning()   if (logLevel < 1) {} else qDebug() << "WARNING:"
 
#define LogNormal()   if (logLevel < 2) {} else qDebug() << "Log:"
 
#define LogDebug()   if (logLevel < 3) {} else qDebug() << "Log:"
 

Functions

bool operator== (const FrameworkInfo &a, const FrameworkInfo &b)
 
QDebug operator<< (QDebug debug, const FrameworkInfo &info)
 
QDebug operator<< (QDebug debug, const ApplicationBundleInfo &info)
 
OtoolInfo findDependencyInfo (const QString &binaryPath)
 
FrameworkInfo parseOtoolLibraryLine (const QString &line, const QString &appBundlePath, const QList< QString > &rpaths, bool useDebugLibs)
 
QString findAppBinary (const QString &appBundlePath)
 
QList< FrameworkInfogetQtFrameworks (const QString &path, const QString &appBundlePath, const QList< QString > &rpaths, bool useDebugLibs)
 
QList< FrameworkInfogetQtFrameworks (const QStringList &otoolLines, const QString &appBundlePath, const QList< QString > &rpaths, bool useDebugLibs)
 
QString copyFramework (const FrameworkInfo &framework, const QString path)
 
DeploymentInfo deployQtFrameworks (const QString &appBundlePath, const QStringList &additionalExecutables, bool useDebugLibs)
 
DeploymentInfo deployQtFrameworks (QList< FrameworkInfo > frameworks, const QString &bundlePath, const QStringList &binaryPaths, bool useDebugLibs, bool useLoaderPath)
 
void createQtConf (const QString &appBundlePath)
 
void deployPlugins (const QString &appBundlePath, DeploymentInfo deploymentInfo, bool useDebugLibs)
 
bool deployQmlImports (const QString &appBundlePath, DeploymentInfo deploymentInfo, QStringList &qmlDirs, QStringList &qmlImportPaths)
 
void changeIdentification (const QString &id, const QString &binaryPath)
 
void changeInstallName (const QString &oldName, const QString &newName, const QString &binaryPath)
 
void runStrip (const QString &binaryPath)
 
void stripAppBinary (const QString &bundlePath)
 
QStringList findAppFrameworkNames (const QString &appBundlePath)
 
QStringList findAppFrameworkPaths (const QString &appBundlePath)
 
void codesignFile (const QString &identity, const QString &filePath)
 
QSet< QStringcodesignBundle (const QString &identity, const QString &appBundlePath, QList< QString > additionalBinariesContainingRpaths)
 
void codesign (const QString &identity, const QString &appBundlePath)
 
void createDiskImage (const QString &appBundlePath, const QString &filesystemType)
 
void fixupFramework (const QString &appBundlePath)
 

Variables

int logLevel
 
bool runStripEnabled
 

Macro Definition Documentation

◆ LogDebug

#define LogDebug ( )    if (logLevel < 3) {} else qDebug() << "Log:"

Definition at line 16 of file shared.h.

◆ LogError

#define LogError ( )    if (logLevel < 0) {} else qDebug() << "ERROR:"

Definition at line 13 of file shared.h.

◆ LogNormal

#define LogNormal ( )    if (logLevel < 2) {} else qDebug() << "Log:"

Definition at line 15 of file shared.h.

◆ LogWarning

#define LogWarning ( )    if (logLevel < 1) {} else qDebug() << "WARNING:"

Definition at line 14 of file shared.h.

Function Documentation

◆ changeIdentification()

void changeIdentification ( const QString id,
const QString binaryPath 
)

Definition at line 821 of file shared.cpp.

References LogDebug, and runInstallNameTool().

Referenced by deployQtFrameworks(), and fixupFramework().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeInstallName()

void changeInstallName ( const QString oldName,
const QString newName,
const QString binaryPath 
)

Definition at line 904 of file shared.cpp.

References LogDebug, and runInstallNameTool().

+ Here is the call graph for this function:

◆ codesign()

void codesign ( const QString identity,
const QString appBundlePath 
)

Definition at line 1539 of file shared.cpp.

References codesignBundle().

Referenced by codesignBundle(), codesignFile(), and main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ codesignBundle()

QSet< QString > codesignBundle ( const QString identity,
const QString appBundlePath,
QList< QString additionalBinariesContainingRpaths 
)

Definition at line 1404 of file shared.cpp.

References QFileInfo::absoluteFilePath(), QList< T >::append(), codesign(), codesignBundle(), codesignFile(), QSet< T >::contains(), QDir::Dirs, QDir::entryList(), extraEntitlements, QDirIterator::filePath(), QDir::Files, findAppBundleFiles(), findAppFrameworkPaths(), findEntitlementsFile(), QString::fromLatin1(), getBinaryDependencies(), QDirIterator::hasNext(), QSet< T >::insert(), QByteArray::isEmpty(), QList< T >::isEmpty(), LogDebug, LogError, LogNormal, QDirIterator::next(), QDir::NoSymLinks, QStack< T >::pop(), QStack< T >::push(), QSet< T >::remove(), QDirIterator::Subdirectories, and QSet< T >::subtract().

Referenced by codesign(), and codesignBundle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ codesignFile()

void codesignFile ( const QString identity,
const QString filePath 
)

Definition at line 1368 of file shared.cpp.

References codesign(), extraEntitlements, hardenedRuntime, QString::isEmpty(), QByteArray::isEmpty(), LogDebug, LogError, LogNormal, runCodesign, and secureTimestamp.

Referenced by codesignBundle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyFramework()

QString copyFramework ( const FrameworkInfo framework,
const QString  path 
)

Definition at line 742 of file shared.cpp.

References alwaysOwerwriteEnabled, FrameworkInfo::binaryDirectory, FrameworkInfo::binaryName, copyFilePrintStatus(), QFile::exists(), FrameworkInfo::frameworkDestinationDirectory, FrameworkInfo::frameworkPath, linkFilePrintStatus(), LogError, patch_debugInInfoPlist(), recursiveCopy(), FrameworkInfo::sourceFilePath, and FrameworkInfo::version.

Referenced by deployQtFrameworks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createDiskImage()

void createDiskImage ( const QString appBundlePath,
const QString filesystemType 
)

Definition at line 1543 of file shared.cpp.

References alwaysOwerwriteEnabled, QString::chop(), QFile::exists(), QFile::fileName(), LogError, LogNormal, and QFile::remove().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createQtConf()

void createQtConf ( const QString appBundlePath)

Definition at line 1197 of file shared.cpp.

References alwaysOwerwriteEnabled, contents, QFile::exists(), fileName, LogNormal, LogWarning, QDir::mkpath(), QFile::open(), QIODevice::write(), and QIODeviceBase::WriteOnly.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deployPlugins()

void deployPlugins ( const QString appBundlePath,
DeploymentInfo  deploymentInfo,
bool  useDebugLibs 
)

Definition at line 1228 of file shared.cpp.

References ApplicationBundleInfo::binaryPath, deployPlugins(), findAppBinary(), ApplicationBundleInfo::path, and DeploymentInfo::pluginPath.

+ Here is the call graph for this function:

◆ deployQmlImports()

bool deployQmlImports ( const QString appBundlePath,
DeploymentInfo  deploymentInfo,
QStringList qmlDirs,
QStringList qmlImportPaths 
)

Definition at line 1260 of file shared.cpp.

References QString::append(), QCoreApplication::applicationDirPath(), QJsonDocument::array(), QDir::cleanPath(), deployQmlImport(), QFile::exists(), QJsonDocument::fromJson(), importLessThan(), QJsonDocument::isArray(), QByteArray::isEmpty(), QLibraryInfo::LibraryExecutablesPath, LogError, LogNormal, LogWarning, QString::mid(), QLibraryInfo::path(), QLibraryInfo::QmlImportsPath, QStringLiteral, DeploymentInfo::rpathsUsed, QString::startsWith(), and QJsonArray::toVariantList().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deployQtFrameworks() [1/2]

DeploymentInfo deployQtFrameworks ( const QString appBundlePath,
const QStringList additionalExecutables,
bool  useDebugLibs 
)

◆ deployQtFrameworks() [2/2]

DeploymentInfo deployQtFrameworks ( QList< FrameworkInfo frameworks,
const QString bundlePath,
const QStringList binaryPaths,
bool  useDebugLibs,
bool  useLoaderPath 
)

◆ findAppBinary()

QString findAppBinary ( const QString appBundlePath)

Definition at line 367 of file shared.cpp.

References bundle, QFile::exists(), and LogError.

Referenced by deployPlugins(), deployQtFrameworks(), and stripAppBinary().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findAppFrameworkNames()

QStringList findAppFrameworkNames ( const QString appBundlePath)

Definition at line 403 of file shared.cpp.

References QDir::Dirs, QString::fromLatin1(), iter, and QDir::NoSymLinks.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findAppFrameworkPaths()

QStringList findAppFrameworkPaths ( const QString appBundlePath)

Definition at line 420 of file shared.cpp.

References QDir::Dirs, QString::fromLatin1(), iter, and QDir::NoSymLinks.

Referenced by codesignBundle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findDependencyInfo()

OtoolInfo findDependencyInfo ( const QString binaryPath)

Definition at line 146 of file shared.cpp.

References DylibInfo::binaryPath, DylibInfo::compatibilityVersion, QString::contains(), DylibInfo::currentVersion, QString::endsWith(), fileName, QVersionNumber::fromString(), info, LogDebug, LogError, QRegularExpression::match(), match(), output, QStringLiteral, and Qt::SkipEmptyParts.

Referenced by getBinaryDependencies(), getQtFrameworks(), and parseOtoolLibraryLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fixupFramework()

void fixupFramework ( const QString appBundlePath)

Definition at line 1579 of file shared.cpp.

References addRPath(), changeIdentification(), linkFilePrintStatus(), LogError, QStringLiteral, and QString::split().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQtFrameworks() [1/2]

QList< FrameworkInfo > getQtFrameworks ( const QString path,
const QString appBundlePath,
const QList< QString > &  rpaths,
bool  useDebugLibs 
)

Definition at line 560 of file shared.cpp.

References findDependencyInfo(), getBinaryRPaths(), getQtFrameworks(), and info.

+ Here is the call graph for this function:

◆ getQtFrameworks() [2/2]

QList< FrameworkInfo > getQtFrameworks ( const QStringList otoolLines,
const QString appBundlePath,
const QList< QString > &  rpaths,
bool  useDebugLibs 
)

◆ operator<<() [1/2]

QDebug operator<< ( QDebug  debug,
const ApplicationBundleInfo info 
)
inline

Definition at line 69 of file shared.cpp.

References debug, info, and QFileInfo::path().

+ Here is the call graph for this function:

◆ operator<<() [2/2]

QDebug operator<< ( QDebug  debug,
const FrameworkInfo info 
)

Definition at line 49 of file shared.cpp.

References debug, and info.

◆ operator==()

bool operator== ( const FrameworkInfo a,
const FrameworkInfo b 
)

Definition at line 44 of file shared.cpp.

◆ parseOtoolLibraryLine()

FrameworkInfo parseOtoolLibraryLine ( const QString line,
const QString appBundlePath,
const QList< QString > &  rpaths,
bool  useDebugLibs 
)

◆ runStrip()

void runStrip ( const QString binaryPath)

Definition at line 913 of file shared.cpp.

References LogDebug, LogError, and runStripEnabled.

Referenced by deployPlugins(), deployQtFrameworks(), recursiveCopyAndDeploy(), and stripAppBinary().

+ Here is the caller graph for this function:

◆ stripAppBinary()

void stripAppBinary ( const QString bundlePath)

Definition at line 929 of file shared.cpp.

References findAppBinary(), and runStrip().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ logLevel

int logLevel
extern

Definition at line 37 of file shared.cpp.

Referenced by main(), and QXcbKeyboard::updateKeymap().

◆ runStripEnabled

bool runStripEnabled
extern

Definition at line 28 of file shared.cpp.

Referenced by main(), and runStrip().