summaryrefslogtreecommitdiffstats
path: root/src/dbus/Qt6DBusMacros.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Remove the Unnecessary CMake Module, `include(CMakeParseArguments)`Amir Masoud Abdol2022-10-251-2/+0
| | | | | | | | | | | | From CMake 3.7 both flavors of `cmake_parse_arguments` are natively available in CMake, and loading the `CMakeParseArguments` module is not needed anymore. Fixes: QTBUG-107574 Pick-to: 6.4 Change-Id: I7c8a6c5871cdb2f92a4aa43932b6f2ee99e1f57f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Qt6DBusMacros: Fix regression after moc filename changesJonas Kvinge2022-09-151-19/+31
| | | | | | | | | | | | | | This fixes an regression after commit aa99bf532da51fc024c70e989e54b014e4cec199, where the moc filename was changed. It does not check if basename contains a relative path. This checks if basename contains a relative path. In that case, make sure to correctly set the path in the `_moc` variable. Fixes: QTBUG-106571 Change-Id: I88ec156d7c666b626d85018e9cde0dc397051035 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qdbusxml2cpp: modify the behavior of -m/--moc optionMate Barany2022-09-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | qdbusxml2cpp has a -m/--moc option. Change and modify the behavior such that -p foo -m includes moc_foo.cpp in the generated .cpp -p :foo.cpp includes moc_foo.cpp in the generated .cpp -p foo.h:foo.cpp includes moc_foo.cpp in the generated .cpp Change the Qt6DbusMacros.cmake file accordingly. [ChangeLog][qdbusxml2cpp] The -m/--moc option now generates idiomatic moc file names (moc_base.cpp for headers, base.moc for implementation files)(was: always base.moc). Build systems using workarounds for the non-idiomatic naming of moc files used by qdbusxml2cpp in the past can now drop these workarounds for Qt versions >= 6.5. Fixes: QTBUG-103313 Change-Id: I754b1b276f130cb8645166470e1b457a676590f7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-08-031-30/+2
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Handle empty string args for versionless wrappers of dbus CMake commandsCraig Scott2021-09-201-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | CMake silently drops empty list items when passing ${someVar} to a function unquoted. The versionless wrapper functions typically use ${ARGV} or ${ARGN} to pass through arguments from the caller to the versioned implementation, but this doesn't preserve empty arguments. For qt_add_dbus_adaptor() in particular, this was problematic because that meant arguments after the empty arg effectively "moved left" and were interpreted as the wrong arguments. Use named arguments and pass through each one explicitly for the qt_add_dbus_adaptor(). This takes advantage of the implementation of the versioned function, which also checks each optional positional argument explicitly. We can only do this because we know the upper bound on the number of arguments, so it is possible to represent each argument with its own variable. A more general solution that didn't need to know the number of arguments would require the cmake_language(EVAL) command, but that requires CMake 3.18 or later. Fixes: QTBUG-96594 Pick-to: 6.2 Change-Id: Ibb1de19217191768ca5ead969b20a1d28c466868 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Revert "Ensure versionless wrappers do not introduce a new variable scope"Craig Scott2021-09-061-14/+17
| | | | | | | | | | | | | This reverts commit 08180e76e6116f0ef66476ca00b2b676b3aa50da. Macros add another level of escaping that functions do not. The conversion of the versionless wrappers to macros may alter the behavior, so revert that change. Task-number: QTBUG-96219 Pick-to: 6.2 Change-Id: Ic5dcff3081123d957888584ba1d76ae0580d9083 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Ensure versionless wrappers do not introduce a new variable scopeCraig Scott2021-08-311-17/+14
| | | | | | | | | | | | | | Using function instead of macro prevented the wrappers from being able to pass back any variables set in the wrapped function. In some cases, these variables were being explicitly passed back to the caller, but that isn't needed if you just make each wrapper a macro. This also makes things more future-proof because any newly introduced output variables will work without having to update the wrappers. Task-number: QTBUG-96121 Pick-to: 6.2 Change-Id: Ic4486de668694c06b47e466587b2cdcb969ea047 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* dbus: Skip AUTOUIC on generated sourcesKevin Funk2020-09-211-2/+8
| | | | | | | | | | | | | | | | | | Skip AUTOUIC on sources generated by the qt_add_dbus_interface and qt_add_dbus_adaptor macros. Otherwise CMake will warn due to policy CMP0071: ``` For compatibility, CMake is excluding the GENERATED source file(s): (...) from processing by AUTOMOC and AUTOUIC. (...) ``` Pick-to: 5.15 Change-Id: I7d14b23c9343940964d5bc0d1d18fc19b41b5cd0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Workaround building DBus 'car' example with qmakeAlexandru Croitor2020-08-231-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While trying to implement instructions for building examples with qmake in the CI, an issue has surfaced. When building examples with CMake with -DBUILD_EXAMPLES=ON in the CI, the examples are built in-source, aka source dir == build dir. This means that the header files generated by qdbusxml2cpp will be placed in the qtbase source dir. The instructions that try to build examples with qmake build the examples in a separate build dir after building the examples with CMake. Unfortunately the qtbase/examples/dbus/remotecontrolledcar/car example includes the generated DBus adaptor header via a statement like #include "car_adaptor.h" and the compiler prefers to pick up the header file from the example source dir (the one generated by CMake), rather than the one generated by qmake in the example build dir. Because CMake's DBus integration uses different flags than qmake's DBus integration, the generated header file code is not compatible with the qmake generated cpp file, and the example fails to link when building with qmake, because it can't find an appropriate constructor symbol. In an ideal world, we wouldn't do in-source builds with the CMake build, but that leads to other issues which I currently don't recall. To circumvent the issue, adapt the CMake DBus qt6_add_dbus_adaptor function to allow not passing the problematic '-l' flag by making it optional. This shouldn't break existing code, but allows us to generate a compatible header that will be used by qmake and succeed in linking the example. Task-number: QTBUG-85986 Change-Id: I06759f79aeb66bb32da7f158f55dd4734c4a9887 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Update add_custom_command and add_custom_target dependenciesLeander Beernaert2020-02-031-4/+9
| | | | | | | | | | | If we don't add the executable used by the custom_target and/or custom_command to list of the command's/target's dependencies (DEPENDS) the generated file will not update should the executable change. Change-Id: Idce30f3dd4f756d9e8f6848c5e16f5dd6c7c8f0a Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add Qt 5 backward compatible CMake APIAlexandru Croitor2020-01-271-0/+43
| | | | | | | | | | | Create versionless function names, that coincide with the Qt 5 CMake API. Task-number: QTBUG-74137 Task-number: QTBUG-80477 Change-Id: I8559b2c8a49b23e5a89ec81603aaec54ea634d70 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/dev' into merge-devLeander Beernaert2020-01-241-4/+4
| | | | Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
* Update public CMake macros' versionLeander Beernaert2019-08-231-7/+7
| | | | | | | Update all public Qt macros to use qt6/QT6 instead of qt5/QT6. Change-Id: Ib178f4fa21f37dfb8da7d4d8c097aa0e96c9d9f9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-06-141-0/+154
This changes many different CMake places to mention Qt6 instead of Qt5. Note that some old qt5 cmake config files in corelib are probably not needed anymore, but I still renamed and kept them for now. Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4