Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
shared.h File Reference

(920bcc09466513375745d6e2250610d62fb98ff1)

#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

◆ LogError

◆ LogNormal

◆ LogWarning

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

Definition at line 14 of file shared.h.

Referenced by createQtConf(), deployPlugins(), deployQmlImports(), and deployQtFrameworks().

Function Documentation

◆ changeIdentification()

void changeIdentification ( const QString & id,
const QString & binaryPath )

Definition at line 828 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 911 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 1546 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 1411 of file shared.cpp.

References QFileInfo::absoluteFilePath(), QString::append(), codesign(), codesignBundle(), codesignFile(), QDir::Dirs, QDir::entryList(), extraEntitlements, QDir::Files, findAppBundleFiles(), findAppFrameworkPaths(), findEntitlementsFile(), QString::fromLatin1(), getBinaryDependencies(), QString::insert(), QByteArray::isEmpty(), LogDebug, LogError, LogNormal, QDir::NoSymLinks, and QDirIterator::Subdirectories.

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 1375 of file shared.cpp.

References codesign(), extraEntitlements, hardenedRuntime, QByteArray::isEmpty(), QString::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 749 of file shared.cpp.

References alwaysOwerwriteEnabled, copyFilePrintStatus(), QFile::exists(), linkFilePrintStatus(), LogError, patch_debugInInfoPlist(), and recursiveCopy().

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 1550 of file shared.cpp.

References alwaysOwerwriteEnabled, QString::chop(), LogError, and LogNormal.

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 1204 of file shared.cpp.

References alwaysOwerwriteEnabled, contents, fileName, LogNormal, LogWarning, QDir::mkpath(), 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 1235 of file shared.cpp.

References deployPlugins(), findAppBinary(), and ApplicationBundleInfo::path.

+ Here is the call graph for this function:

◆ deployQmlImports()

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

Definition at line 1267 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, 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 )

Definition at line 1037 of file shared.cpp.

References alwaysOwerwriteEnabled, deployQtFrameworks(), findAppBinary(), findAppLibraries(), getBinaryRPaths(), getQtFrameworksForPaths(), QLibraryInfo::LibrariesPath, LogWarning, QLibraryInfo::path(), and ApplicationBundleInfo::path.

+ Here is the call graph for this function:

◆ deployQtFrameworks() [2/2]

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

Definition at line 961 of file shared.cpp.

References changeIdentification(), changeInstallName(), copyDylib(), copyFramework(), deployRPaths(), getQtFrameworks(), LogError, LogNormal, QLibraryInfo::path(), QLibraryInfo::PrefixPath, runStrip(), and DeploymentInfo::useLoaderPath.

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

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

◆ findAppBinary()

QString findAppBinary ( const QString & appBundlePath)

Definition at line 367 of file shared.cpp.

References 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, QString::contains(), QString::endsWith(), fileName, QVersionNumber::fromString(), info, LogDebug, LogError, 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 1586 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, and info.

◆ 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 )

Definition at line 210 of file shared.cpp.

References bundleFrameworkDirectory, QString::chop(), QDir::cleanPath(), QDir::currentPath(), End, QFile::exists(), findDependencyInfo(), info, OtoolInfo::installName, QDir::isAbsolutePath(), QString::length(), librarySearchPath, line, LogError, QString::mid(), parseOtoolLibraryLine(), QStringLiteral, QString::simplified(), state, QString::trimmed(), and Version.

Referenced by getQtFrameworks(), and parseOtoolLibraryLine().

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

◆ runStrip()

void runStrip ( const QString & binaryPath)

Definition at line 920 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 936 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().