qt5base-lts/util
Marc Mutz dffca8bb0e Add a simple Qt 6/CMake-compatible script a la includemocs.py
Perl is dead and I don't speak Python, so if someone wants to port it,
be my guest. I needed something that I can use to roll out includemocs
across all Qt modules, and this is it. It works for me™, so I don't
expect to do much development with it.

This is an automated committer script I've been using so far:

    # SRCDIR=~~~
    # BUILDDIR=~~~~
    cd $BUILDDIR
    find */src -name mocs_compilation.cpp | while read FILE; do
        if grep -qsE '^#include' "$FILE"; then
            DIR="$(dirname "$FILE")"
            LIB="$(basename "$DIR")"
            case "$LIB" in
            Q*)
                LIB="${LIB%%_autogen}"
                ;;
            *)
                LIB="Qt${LIB%%_autogen}"
                ;;
            esac
            DIR="${DIR%/*}"
            path/to/includemocs6.sh "$SRCROOT/$DIR" "$DIR" "$FILE"
            (cd "$SRCROOT/$DIR" && git commit -am "$LIB: includemocs

$(cat "$SRCROOT/commit-msg.txt")" --no-edit)
        fi
    done

If the script cannot associate a moc file with a cpp file, it will
print a warning and continue.

The script tries to include the moc-file right after the
QT_END_NAMESPACE to work around many TUs ending in an #endif from some
#if QT_CONFIG or other. If there's no QT_END_NAMESPACE, it appends
the include and prints a warning.

Fixes: QTBUG-102886
Pick-to: 6.3 6.2
Change-Id: I16c5a9f845777ea2e82f15611b4fdd32f98ce0bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-05-05 04:26:19 +00:00
..
accessibilityinspector Another round of replacing 0 with nullptr 2020-10-07 23:02:47 +02:00
aglfn Updated license headers 2016-01-21 18:55:18 +00:00
android Properly wait for the Android emulator to fully boot 2022-01-07 19:34:50 +01:00
cmake Remove the qmake2cmake wrapper scripts and document where they are 2022-04-12 10:34:40 +02:00
edid qedidvendortable.py: include something before using macros 2022-02-24 12:07:00 -08:00
glgen Remove the openglextensions module 2020-06-10 09:35:04 +02:00
gradientgen Replace Qt CONSTEXPR defines with constexpr 2020-08-14 15:52:58 +02:00
includemocs Add a simple Qt 6/CMake-compatible script a la includemocs.py 2022-05-05 04:26:19 +00:00
integrity Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
lexgen Replace QtTest headers with QTest 2020-12-22 15:20:30 +01:00
locale_database QLocale: Extend support for language codes 2021-12-09 03:45:08 +01:00
plugintest Updated license headers 2016-01-21 18:55:18 +00:00
qfloat16-tables Round float->qfloat16 to even 2020-09-06 12:35:12 +02:00
testrunner Generalize exclusion list 2022-04-22 15:39:03 +02:00
unicode Update UCD to Revision 28 2021-10-18 16:45:10 +00:00
wasm Add WASM testrunner 2022-03-31 16:50:25 +02:00
x86simdgen Fix generation of qsimd_x86 files to require no hand-editing 2022-04-07 23:04:04 +02:00
xkbdatagen Add the "Territory" enumerated type for QLocale 2021-04-15 20:17:49 +08:00