diff options
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/Makefile.unix | 3 | ||||
-rw-r--r-- | qmake/Makefile.win32 | 2 | ||||
-rw-r--r-- | qmake/doc/snippets/code/doc_src_qmake-manual.pro | 61 | ||||
-rw-r--r-- | qmake/doc/src/qmake-manual.qdoc | 74 | ||||
-rw-r--r-- | qmake/generators/integrity/gbuild.cpp | 1 | ||||
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 6 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 2 | ||||
-rw-r--r-- | qmake/qmake.pri | 2 |
8 files changed, 143 insertions, 8 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index 2f8f07eb2d..a77b1b22dc 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -92,7 +92,8 @@ CPPFLAGS = -g $(EXTRA_CPPFLAGS) \ -I$(SOURCE_PATH)/tools/shared \ -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \ - -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM + -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ + -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 CXXFLAGS = $(EXTRA_CXXFLAGS) $(CPPFLAGS) diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 979155678e..9a772d9760 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -41,7 +41,7 @@ CFLAGS_BARE = -c -Fo./ \ -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \ -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ - -DUNICODE + -DUNICODE -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 CFLAGS = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch $(CFLAGS_BARE) $(CFLAGS) $(EXTRA_CPPFLAGS) CXXFLAGS_BARE = $(CFLAGS_BARE) diff --git a/qmake/doc/snippets/code/doc_src_qmake-manual.pro b/qmake/doc/snippets/code/doc_src_qmake-manual.pro index 0ee4785887..aa3f7f3502 100644 --- a/qmake/doc/snippets/code/doc_src_qmake-manual.pro +++ b/qmake/doc/snippets/code/doc_src_qmake-manual.pro @@ -915,3 +915,64 @@ greaterThan(TMP_VALUE, x456): message("Condition may be true.") #! [173] message("First line$$escape_expand(\\n)Second line") #! [173] + + +#! [174] +TEMPLATE = subdirs +SUBDIRS = one two three +prepareRecursiveTarget(check) +#! [174] + + +#! [175] +two.CONFIG += no_check_target +#! [175] + + +#! [176] +QMAKE_EXTRA_TARGETS += check +#! [176] + + +#! [177] +# <project root>/features/mycheck.prf +equals(TEMPLATE, subdirs) { + prepareRecursiveTarget(check) +} else { + check.commands = echo hello user +} +QMAKE_EXTRA_TARGETS += check +#! [177] + + +#! [178] +# <project root>/.qmake.conf +CONFIG += mycheck +#! [178] + + +#! [179] +# <project root>/project.pro +load(configure) +#! [179] + + +#! [180] +# <project root>/config.tests/test/test.pro +SOURCES = main.cpp +LIBS += -ltheFeature +# Note that the test project is built without Qt by default. +#! [180] + + +#! [181] +// <project root>/config.tests/test/main.cpp +#include <TheFeature/MainHeader.h> +int main() { return featureFunction(); } +#! [181] + + +#! [182] +# <project root>/project.pro +qtCompileTest(test) +#! [182] diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index a00d00d8c1..73538a7932 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -3067,6 +3067,80 @@ And then, in the code: \snippet code/doc_src_qmake-manual.pro 158 + + \section2 prepareRecursiveTarget(target) + + Facilitates the creation of project-wide targets similar to the \c install + target by preparing a target that iterates through all subdirectories. For + example: + + \snippet code/doc_src_qmake-manual.pro 174 + + Subdirs that have \c have_no_default or \c no_<target>_target specified in + their .CONFIG are excluded from this target: + + \snippet code/doc_src_qmake-manual.pro 175 + + You must add the prepared target manually to \l{QMAKE_EXTRA_TARGETS}: + + \snippet code/doc_src_qmake-manual.pro 176 + + To make the target global, the code above needs to be included into every + subdirs subproject. In addition, to make these targets do anything, + non-subdirs subprojects need to include respective code. The easiest way to + achieve this is creating a custom feature file. For example: + + \snippet code/doc_src_qmake-manual.pro 177 + + The feature file needs to be injected into each subproject, for example by + .qmake.conf: + + \snippet code/doc_src_qmake-manual.pro 178 + + \section2 qtCompileTest(test) + + Builds a test project. If the test passes, true is returned and + \c {config_<test>} is added to the \l{CONFIG} variable. Otherwise, false is + returned. + + To make this function available, you need to load the respective feature + file: + + \snippet code/doc_src_qmake-manual.pro 179 + + This also sets the variable QMAKE_CONFIG_TESTS_DIR to the + \c config.tests subdirectory of the project's parent directory. + It is possible to override this value after loading the feature file. + + Inside the tests directory, there has to be one subdirectory per test that + contains a simple qmake project. The following code snippet illustrates the + .pro file of the project: + + \snippet code/doc_src_qmake-manual.pro 180 + + The following code snippet illustrates the main .cpp file of the project: + + \snippet code/doc_src_qmake-manual.pro 181 + + The following code snippet shows the invocation of the test: + + \snippet code/doc_src_qmake-manual.pro 182 + + If the test project is built successfully, the test passes. + + The test results are automatically cached, which also makes them + available to all subprojects. It is therefore recommended to run + all configuration tests in the top-level project file. + + To suppress the re-use of cached results, pass \c{CONFIG+=recheck} + to qmake. + + See also \l{load(feature)}{load()}. + + \section2 qtHaveModule(name) + + Checks whether the Qt module specified by \c name is present. + For a list of possible values, see \l{Variables#QT}{QT}. */ /*! diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index f6bd448cba..8a3a75b7d9 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -44,7 +44,6 @@ #include "meta.h" #include <qdir.h> #include <qregexp.h> -#include <qcryptographichash.h> #include <qdebug.h> #include <stdlib.h> #include <time.h> diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index d1c70900fb..b8e6d05728 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -66,9 +66,9 @@ QT_BEGIN_NAMESPACE using namespace QMakeInternal; -static QString qtMD5(const QByteArray &src) +static QString qtSha1(const QByteArray &src) { - QByteArray digest = QCryptographicHash::hash(src, QCryptographicHash::Md5); + QByteArray digest = QCryptographicHash::hash(src, QCryptographicHash::Sha1); return QString::fromLatin1(digest.toHex()); } @@ -1547,7 +1547,7 @@ ProjectBuilderMakefileGenerator::keyFor(const QString &block) #endif QString ret; if(!keys.contains(block)) { - ret = qtMD5(block.toUtf8()).left(24).toUpper(); + ret = qtSha1(block.toUtf8()).left(24).toUpper(); keys.insert(block, ret); } else { ret = keys[block]; diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index dfcb0ec352..d550748c9b 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -340,7 +340,7 @@ QUuid VcprojGenerator::getProjectUUID(const QString &filename) // If none, create one based on the MD5 of absolute project path if(uuid.isNull() || !filename.isEmpty()) { QString abspath = Option::fixPathToLocalOS(filename.isEmpty()?project->first("QMAKE_MAKEFILE").toQString():filename); - QByteArray digest = QCryptographicHash::hash(abspath.toUtf8(), QCryptographicHash::Md5); + QByteArray digest = QCryptographicHash::hash(abspath.toUtf8(), QCryptographicHash::Sha1); memcpy((unsigned char*)(&uuid), digest.constData(), sizeof(QUuid)); validUUID = !uuid.isNull(); uuid.data4[0] = (uuid.data4[0] & 0x3F) | 0x80; // UV_DCE variant diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 4cc401bc13..39959efe7b 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -147,7 +147,7 @@ bootstrap { #Qt code CFLAGS += -fhonor-std LFLAGS += -lcpp } - DEFINES *= QT_NO_QOBJECT + DEFINES *= QT_NO_QOBJECT QT_CRYPTOGRAPHICHASH_ONLY_SHA1 } else { CONFIG += qt QT = core |