96 bool _default =
false;
109 static const char *
const lflags[] = {
"LIBS",
"LIBS_PRIVATE",
110 "QMAKE_LIBS",
"QMAKE_LIBS_PRIVATE",
nullptr };
111 for (
int i = 0; lflags[
i];
i++) {
119 auto dit = std::find_if(dirs.
cbegin(), dirs.
cend(),
122 return p.real() == argqstr;
127 if (
idx >= 0 &&
idx < libidx) {
132 dirs.
insert(libidx++, lp);
133 (*it) =
"-L" + lp.
real();
138 for (
auto dir_it = dirs.
begin(); dir_it != dirs.
end(); ++dir_it) {
144 QString libBase = (*dir_it).local() +
'/' + lib + verovr;
146 extit != impexts.
cend(); ++extit) {
147 if (
exists(libBase +
'.' + *extit)) {
148 *
it = (dir_it->isDefault() ? lib : cand)
149 + verovr +
'.' + *extit;
162 for (
auto dir_it = dirs.
begin(); dir_it != dirs.
end(); ++dir_it) {
173 for (
int prl = 0; prl < prl_libs.
size(); ++prl)
174 it =
l.insert(++
it, prl_libs.
at(prl));
180 for (
int lit = 0; lit <
l.size(); ++lit) {
202 for (
int off = fixedBase.
length(); off > slashOff; off--) {
204 if (off != fixedBase.
length()) {
206 origFile, origName, fixedBase.
left(off), slashOff);
252 QString lib = (*libDir_it).toQString();
260 qmklibs = libs + qmklibs;
316 for (
int i = vers.size();
i < 4;
i++)
318 QString versionString = vers.join(
'.');
322 rcIcons.reserve(icons.size());
365 ts <<
"#include <windows.h>\n";
367 if (!rcIcons.isEmpty()) {
368 for (
int i = 0;
i < rcIcons.size(); ++
i)
375 manifestResourceId =
QStringLiteral(
"ISOLATIONAWARE_MANIFEST_RESOURCE_ID");
377 manifestResourceId =
QStringLiteral(
"CREATEPROCESS_MANIFEST_RESOURCE_ID");
378 ts << manifestResourceId <<
" RT_MANIFEST \"" << manifestFile <<
"\"\n";
380 ts <<
"VS_VERSION_INFO VERSIONINFO\n";
381 ts <<
"\tFILEVERSION " <<
QString(versionString).replace(
".",
",") <<
Qt::endl;
382 ts <<
"\tPRODUCTVERSION " <<
QString(versionString).replace(
".",
",") <<
Qt::endl;
383 ts <<
"\tFILEFLAGSMASK 0x3fL\n";
384 ts <<
"#ifdef _DEBUG\n";
385 ts <<
"\tFILEFLAGS VS_FF_DEBUG\n";
387 ts <<
"\tFILEFLAGS 0x0L\n";
389 ts <<
"\tFILEOS VOS_NT_WINDOWS32\n";
391 ts <<
"\tFILETYPE VFT_DLL\n";
393 ts <<
"\tFILETYPE VFT_APP\n";
394 ts <<
"\tFILESUBTYPE VFT2_UNKNOWN\n";
396 ts <<
"\t\tBLOCK \"StringFileInfo\"\n";
398 ts <<
"\t\t\tBLOCK \""
401 ts <<
"\t\t\tBEGIN\n";
402 ts <<
"\t\t\t\tVALUE \"CompanyName\", \"" << companyName <<
"\\0\"\n";
403 ts <<
"\t\t\t\tVALUE \"FileDescription\", \"" << description <<
"\\0\"\n";
404 ts <<
"\t\t\t\tVALUE \"FileVersion\", \"" << versionString <<
"\\0\"\n";
405 ts <<
"\t\t\t\tVALUE \"LegalCopyright\", \"" <<
copyright <<
"\\0\"\n";
406 ts <<
"\t\t\t\tVALUE \"OriginalFilename\", \"" << originalName <<
"\\0\"\n";
407 ts <<
"\t\t\t\tVALUE \"ProductName\", \"" << productName <<
"\\0\"\n";
408 ts <<
"\t\t\t\tVALUE \"ProductVersion\", \"" << versionString <<
"\\0\"\n";
409 ts <<
"\t\t\t\tVALUE \"InternalName\", \"" << internalName <<
"\\0\"\n";
410 ts <<
"\t\t\t\tVALUE \"Comments\", \"" << comments <<
"\\0\"\n";
411 ts <<
"\t\t\t\tVALUE \"LegalTrademarks\", \"" << trademarks <<
"\\0\"\n";
414 ts <<
"\t\tBLOCK \"VarFileInfo\"\n";
416 ts <<
"\t\t\tVALUE \"Translation\", "
421 ts <<
"/* End of Version info */\n";
434 bool writeRcFile =
true;
436 writeRcFile = rcFile.
readAll() != rcString;
452 rcFile.
write(rcString);
460 fprintf(stderr,
"Both rc and res file specified.\n");
461 fprintf(stderr,
"Please specify one of them, not both.");
492 t <<
"clean: compiler_clean " <<
depVar(
"CLEAN_DEPS");
494 const char *clean_targets[] = {
"OBJECTS",
"QMAKE_CLEAN",
"CLEAN_FILES",
nullptr };
495 for(
int i = 0; clean_targets[
i]; ++
i) {
497 const QString del_statement(
"-$(DEL_FILE)");
500 t <<
"\n\t" << del_statement
504 const int commandlineLimit = 2047;
509 t <<
"\n\t" << del_statement <<
files;
515 t <<
"\n\t" << del_statement <<
files;
521 t <<
"distclean: clean " <<
depVar(
"DISTCLEAN_DEPS");
523 const char *clean_targets[] = {
"QMAKE_DISTCLEAN",
nullptr };
524 for(
int i = 0; clean_targets[
i]; ++
i) {
526 const QString del_statement(
"-$(DEL_FILE)");
529 t <<
"\n\t" << del_statement <<
" "
533 const int commandlineLimit = 2047;
538 t <<
"\n\t" << del_statement <<
files;
544 t <<
"\n\t" << del_statement <<
files;
548 t <<
"\n\t-$(DEL_FILE) $(DESTDIR_TARGET)\n";
562 for(
int i = 0;
i < incs.
size(); ++
i) {
575 t <<
"####### Compiler, tools and options\n\n";
579 <<
varGlue(
"PRL_EXPORT_DEFINES",
"-D",
" -D",
" ")
581 t <<
"CFLAGS = " <<
var(
"QMAKE_CFLAGS") <<
" $(DEFINES)\n";
582 t <<
"CXXFLAGS = " <<
var(
"QMAKE_CXXFLAGS") <<
" $(DEFINES)\n";
589 t <<
"####### Output directory\n\n";
593 t <<
"OBJECTS_DIR = . \n";
596 t <<
"####### Files\n\n";
618 t <<
"DESTDIR = " <<
escapeFilePath(destDir) <<
" #avoid trailing-slash linebreak\n";
625 t <<
"####### Build rules\n\n";
632 t <<
"\t-$(COPY_FILE) $(DESTDIR_TARGET) "
647 dist_files <<
var(
"TRANSLATIONS");
657 <<
"$(ZIP) " <<
var(
"QMAKE_ORIG_TARGET") <<
".zip $(SOURCES) $(DIST) "
681 t <<
"LIBFLAGS = " <<
var(
"QMAKE_LIBFLAGS") <<
Qt::endl;
714 for (
int i = 0;
i < rcIncPaths.
count(); ++
i) {
747 if((
t !=
"target" &&
t !=
"dlltarget") ||
760 for (
int i = 0;
i < targets.
size(); ++
i) {
777 dst_prl = dst_prl.
right(dst_prl.
length() - slsh - 1);
813 ret +=
QString(
"-$(INSTALL_FILE) ") + src_targ +
' ' + dst_targ;
816 uninst.
append(
"-$(DEL_FILE) " + dst_targ);
821 QString src_targ =
"$(DESTDIR_TARGET)";
826 ret +=
QString(
"-$(INSTALL_FILE) ") + src_targ +
' ' + dst_targ;
829 uninst.
append(
"-$(DEL_FILE) " + dst_targ);
844 t <<
"SED = " <<
var(
"QMAKE_STREAM_EDITOR") <<
Qt::endl;
852 if (
ret.contains(
' ') ||
ret.contains(
'\t'))
854 debug_msg(2,
"EscapeFilePath: %s -> %s",
path.toLatin1().constData(),
ret.toLatin1().constData());
862 if (!
ret.isEmpty()) {
864 if (
ret.contains(criticalChars))
866 debug_msg(2,
"EscapeDependencyPath: %s -> %s",
path.toLatin1().constData(),
ret.toLatin1().constData());
883 return "DEST_TARGET";
small capitals from c petite p scientific i
[1]
LibrarySearchPath(QString &&s, bool isDefault=false)
LibrarySearchPath()=default
LibrarySearchPath(const QString &s)
QString fileVarList(const ProKey &var) const
bool exists(QString file) const
QString installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst) const
QStringList escapeFilePaths(const QStringList &paths) const
QString valList(const QStringList &varList) const
QStringList escapeDependencyPaths(const QStringList &paths) const
virtual void writeDefaultVariables(QTextStream &t)
virtual QString var(const ProKey &var) const
virtual bool processPrlFileBase(QString &origFile, QStringView origName, QStringView fixedBase, int slashOff)
QString mkdir_p_asstring(const QString &dir, bool escape=true) const
void writeExportedVariables(QTextStream &t)
void writeExtraCompilerVariables(QTextStream &t)
QString filePrefixRoot(const QString &, const QString &)
QString depVar(const ProKey &var) const
bool processPrlFile(QString &, bool baseOnly)
QFileInfo fileInfo(QString file) const
virtual QString installRoot() const
void writeExtraVariables(QTextStream &t)
QString pkgConfigFileName(bool fixify=true)
QString varGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const
void writeExtraCompilerTargets(QTextStream &t)
void writeExtraTargets(QTextStream &t)
ProStringList fixLibFlags(const ProKey &var)
void writeMakeQmake(QTextStream &t, bool noDummyQmakeAll=false)
QString fileFixify(const QString &file, FileFixifyTypes fix=FileFixifyDefault, bool canon=true) const
virtual LibFlagType parseLibFlag(const ProString &flag, ProString *arg)
QString fileVar(const ProKey &var) const
bool startsWith(const ProString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
ProString mid(int off, int len=-1) const
QString toQString() const
ProString & prepend(const ProString &other)
bool endsWith(const ProString &sub, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
void removeAll(const ProString &str)
QString join(const ProString &sep) const
bool contains(const ProString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QStringList toQStringList() const
The QByteArray class provides an array of bytes.
const char * constData() const noexcept
constexpr bool isDigit() const noexcept
The QDir class provides access to directory structures and their contents.
bool mkpath(const QString &dirPath) const
static QString cleanPath(const QString &path)
The QFile class provides an interface for reading from and writing to files.
bool open(OpenMode flags) override
QString fileName() const override
The QFileInfo class provides system-independent file information.
QString absoluteFilePath() const
qint64 write(const char *data, qint64 len)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
qsizetype size() const noexcept
bool isEmpty() const noexcept
iterator insert(qsizetype i, parameter_type t)
const_reference at(qsizetype i) const noexcept
qsizetype count() const noexcept
void prepend(rvalue_ref t)
const_iterator cend() const noexcept
void append(parameter_type t)
const_iterator cbegin() const noexcept
const_iterator ConstIterator
const QString & real() const
bool isEmpty(const ProKey &v) const
bool isActiveConfig(const QString &config, bool regex=false)
ProString first(const ProKey &variableName) const
ProStringList & values(const ProKey &v)
int intValue(const ProKey &v, int defaultValue=0) const
QStringList dependencies(const QString &file)
void addSourceFile(const QString &, uchar seek, SourceFileType type=TYPE_C)
The QRegularExpression class provides pattern matching using regular expressions.
The QString class provides a Unicode character string.
QString right(qsizetype n) const
QByteArray toLatin1() const &
qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
QString & replace(qsizetype i, qsizetype len, QChar after)
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString section(QChar sep, qsizetype start, qsizetype end=-1, SectionFlags flags=SectionDefault) const
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString & append(QChar c)
QString toUpper() const &
The QStringList class provides a list of strings.
The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QStrin...
constexpr qsizetype length() const noexcept
constexpr QStringView left(qsizetype n) const noexcept
constexpr QChar at(qsizetype n) const noexcept
The QTextStream class provides a convenient interface for reading and writing text.
bool findLibraries(bool linkPrl, bool mergeLflags) override
virtual void writeLibsPart(QTextStream &t)
virtual void writeBuildRulesPart(QTextStream &)
void writeDefaultVariables(QTextStream &t) override
static QString cQuoted(const QString &str)
virtual void writeImplicitRulesPart(QTextStream &t)
QString defaultInstall(const QString &) override
LibFlagType parseLibFlag(const ProString &flag, ProString *arg) override
virtual void writeStandardParts(QTextStream &t)
virtual void writeIncPart(QTextStream &t)
ProString fixLibFlag(const ProString &lib) override
ProKey fullTargetVariable() const override
virtual void writeCleanParts(QTextStream &t)
virtual void writeObjectsPart(QTextStream &t)
virtual void writeRcFilePart(QTextStream &t)
bool processPrlFileBase(QString &origFile, QStringView origName, QStringView fixedBase, int slashOff) override
virtual QString escapeFilePath(const QString &path) const=0
virtual QString escapeDependencyPath(const QString &path) const
QTextStream & endl(QTextStream &stream)
int distance(TestIterator &a, TestIterator &b)
QList< QString > QStringList
QString fixEnvVariables(const QString &x)
GLenum GLuint GLenum GLsizei length
GLsizei const GLchar *const * path
GLenum GLenum GLenum input
#define QStringLiteral(str)
QFileInfo fi("c:/temp/foo")
[newstuff]
settings remove("monkey")
static QStringList project_files
static QMAKE_MODE qmake_mode
static QString fixPathToTargetOS(const QString &in, bool fix_env=true, bool canonical=true)
static QString output_dir
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QString toQString(const T &t)