summaryrefslogtreecommitdiffstats
path: root/tests/auto/cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Fix configuration of CMake tests in-build-treeAlexandru Croitor2020-07-201-0/+5
| | | | | | | | | | | | Qt6 package was not found the tests were configured in-tree as opposed to standalone tests. Use the same trick we do for building examples in-tree. Specify the path to the build tree packages, and don't create targets. Amends 96e3ee06598d00e7155f3f8574759ea658a134e5 Change-Id: Ia60de416ce0afff5bd40be8c0c6e3c7898fd7ebf Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Get tests/auto/cmake tests workingAlexandru Croitor2020-07-1736-369/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests/auto/cmake project can be configured separately as a standalone project with qt-cmake, or as part of the overall qtbase standalone tests. To do that a bunch of things were done - Ported all Qt5 strings to Qt6 - Replaced in all projects the use of add_definitions and include_directories with a target based approach, except for 2 tests where we check that the old-style approach works, otherwise the tests would file - Removed some (possibly unneeded) EGL / OpenGL tests - Fixed some C++ code - Added setup code to tests/auto/cmake/CMakeLists.txt to figure out which modules are available and should be tested - Fixed Qt6CTestMacros.cmake to be loaded by Qt6Core - Removed the CMake tests to not be run in qmake builds of Qt because they would fail anyway - Enabled the CMake tests to be part of standalone tests - Disabled auto-passing of the C and CXX compiler cache vars when cross-compiling so that the tests can somewhat pass on boot2qt. This is the issue we encountered in e2b2cd9397c76e91ac1ebe493bcac7696767c02e - Ultimately disabled tests for boot2qt, because the -rpath-link flag is not generated by CMake for some reason. - Added code to setup the environment when running an executable that was built as part of the test, so that the proper Qt libraries are found. This handles both the standalone tests case and separate project case. The remaining unported tests are test_import_plugins which requires quite a bit of work to get some modules and plugins built that were done as part of the qmake .pro files, test_plugins that checks some Network plugins which I'm not sure about, and test_add_big_resource which doesn't work with namespaced builds and there's no good way of detecting those at the moment either. Change-Id: Ic8809c72817d1db81af6c6014c11df6473ad8c75 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Use QList instead of QVector in other qtbase testsJarek Kobus2020-07-071-2/+2
| | | | | | Task-number: QTBUG-84469 Change-Id: Ie0455c890c048c52eacad1badd6d21df999badf9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove the openglextensions moduleEirik Aavitsland2020-06-104-67/+0
| | | | | | | | | | | | | [ChangeLog][General] The QtOpenglExtensions module has been discontinued. It provided only convenience functionality for certain direct OpenGL usage. With the new RHI graphics API abstraction, that is no longer a primary use case. Applications that still need to access that API have a number of alternative options, including QOpenGLExtraFunctions. Fixes: QTBUG-84085 Change-Id: I272af61c69ebcec207b576d67d08b59623d485ec Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-05-052-0/+24
|\ | | | | | | Change-Id: I003c0d6271c6444748bf30b4331eca3fb2410f44
| * Allow switching of QT_NO_CREATE_VERSIONLESS_TARGETSKai Koehne2020-05-052-0/+24
| | | | | | | | | | | | Fixes: QTBUG-83774 Change-Id: Ib3f2507a917046426b94a779e205012ce52cbfe9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Get rid of QT_OPENGL_ES*Eskil Abrahamsen Blomfeldt2020-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | The QT_OPENGL_ES* macros are leftovers from an earlier, ad hoc configuration system, which has since been replaced by QT_CONFIG. To clean things up in Qt 6, we use the new way instead. Task-number: QTBUG-83467 Change-Id: I578dc7695bff9d5ee303b22e44f60fee22fe0c28 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Remove qt6_use_modulesKai Koehne2020-03-254-107/+0
|/ | | | | | | | | | | qt5_use_modules has been deprecated in 2013 (commit d9ea4bb144153) and removed for the first time in 2018, but then brought back - see discussion in https://lists.qt-project.org/pipermail/development/2018-June/032837.html . Anyhow, I think we can finally put it to a rest in Qt 6. Change-Id: I770f7e93406ad68535d1d90e4a3bacfb920e2d5a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add support for auto-importing plugins in CMakeKyle Edwards2019-08-1238-1/+1079
| | | | | | | | | | | | | | | | | | | | | This commit adds transitive dependencies to the plugins, so that a sane set of default plugins get auto-imported when linking against a module. It also provides a new function, qt5_import_plugins(), which allows you to override the set of plugins that get imported. The decision of whether or not to import a specific plugin is based on several custom target properties and a very clever generator expression. Note that this change only imports plugins on static Qt builds. It does nothing on shared Qt builds, as the shared libraries already have their own plugin import mechanism. [ChangeLog][CMake] Added ability to auto-import non-qml plugins on CMake builds Task-number: QTBUG-38913 Task-number: QTBUG-76562 Change-Id: I2d6c8908b521cf6ba1ebbbc33a87cb7ddd9935cf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Fix some failing cmake testsKyle Edwards2019-08-073-2/+8
| | | | | Change-Id: I74f2bf270726feba8367ea222a3c669110c99e08 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: correct version dependency for qt5_add_big_resourcesLiang Qi2019-05-202-2/+7
| | | | | | | | | | | | | qt5_add_big_resources is only available if using CMake 3.9 and later. This amends cdccd0222bbed1954d5d7fe0da9d2308c202f3b1. Task-number: QTBUG-55680 Task-number: QTBUG-75806 Change-Id: Ibba7af6ee7edfb226368937d543b7ec5cc93eb16 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Export modules' enabled/disabled features to cmakeFriedemann Kleint2018-09-281-0/+14
| | | | | | | | | | | | | | | | | Add properties enabled_features and disabled_features the respective library targets. This makes it possible to query the enabled classes in dependent libraries (for example, Qt for Python). Add a test verifying whether the Open GL configuration is reflected correctly in the feature properties to the existing test_opengl_lib autotest. Change-Id: I645c947073dbb36da3be81de6bc62ee0ba1e73d6 Reviewed-by: Kevin Funk <kevin.funk@kdab.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge dev into 5.12Oswald Buddenhagen2018-08-211-0/+1
|\ | | | | | | Change-Id: I63f632b595f66d2fc93e9aa713500e3799e3df2a
| * tests: Fix top-level CMakeLists.txtKevin Funk2018-08-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: CMake Error in CMakeLists.txt: A logical block opening on the line .../qtbase/tests/auto/cmake/CMakeLists.txt:149 (if) is not closed. Broken by change 02ed1b36daebed5f3997bb676cf5e818c0db9d3c Change-Id: I6c04721edbccaa9fcdb53af92d33dfa87eeaebb8 Reviewed-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Add support for big resources with CMakeAndy Shaw2018-08-168-0/+116
|/ | | | | | Task-number: QTBUG-55680 Change-Id: I09570a4e959ffd0e6d378bc315b13d57baaa82e8 Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* CMake: Restore qt5_use_modules() functionKevin Funk2018-06-154-0/+107
| | | | | | | | | | | | | | | It appears that in the 5 years since we deprecated this function, people have not stopped using it. The removal of qt5_use_modules() caused lots of troubles in packages still using it when they were compiled against Qt 5.11.0. Instead, let's revive this function and keep it for the Qt5 life time. See discussion on qt-development mailing list: http://lists.qt-project.org/pipermail/development/2018-June/032837.html Change-Id: Ic263e3bb6706268cb9ea38a0711665f166a3aa9e Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove CMake code for CMake < 3.1Kevin Funk2018-03-244-125/+4
| | | | | | | | | This removes the following functions from Qt5CoreMacros: - qt5_use_modules(...) Task-number: QTBUG-63519 Change-Id: I59769060a3a93686bf319b558c0ede55755fdb70 Reviewed-by: David Faure <david.faure@kdab.com>
* CMake: Set SKIP_AUTOMOC/AUTOUIC where neededKevin Funk2017-11-226-3/+172
| | | | | | | | | | Make sure we don't run into warnings for CMake 3.10 Task-number: QTBUG-63442 Change-Id: Ida004705646f0c32fb4bf6006036d80b1f279fd7 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Sebastian Holtermann <sebholt@xwmw.org> Reviewed-by: Rolf Eike Beer <eb@emlix.com>
* tests: Unify license to GPL-EXCEPTKai Koehne2017-04-031-16/+11
| | | | | | Change-Id: Ic718650a8a7bddd4ee28c5650a3f5baf70886e51 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* CMake: Create a Qt5::<ModuleName>Private target for each moduleStephen Kelly2016-12-233-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make it depend on the corresponding Private target of each dependency. This way, user code can write find_package(Qt5Gui REQUIRED) add_executable(hello hello.cpp) target_link_libraries(hello Qt5::GuiPrivate) and get the private include directories for both Qt5Core and Qt5Gui. Don't create the Private target if any of the private include directories do not exist. This way, if user code uses one of the targets, CMake will issue an error if the private include directories do not exist. Unfortunately the error is somewhat cryptic (eg, 'the "Qt5::CorePrivate" was not found'), but this is still an improvement over an error at compile time. This is an improvement on the situation described in QTBUG-37417 using Modern CMake features. Change-Id: I034f8216c3ec64d1a3309682456a713cac9bf854 Reviewed-by: Kai Pastor <dg0yt@darc.de> Reviewed-by: Stephen Kelly <steveire@gmail.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-042-2/+9
|\ | | | | | | Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
| * Enable cmake auto tests for -no-guiKai Pastor2016-03-302-2/+9
| | | | | | | | | | | | | | | | This change disables tests which require QtGui. Change-Id: Ib647afd086f54536054cb4c0cde5696d762ee8c4 Reviewed-by: Stephen Kelly <steveire@gmail.com> Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-215-0/+89
|\| | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qgtkstyle_p.cpp tests/auto/corelib/io/qtextstream/test/test.pro tests/auto/corelib/plugin/plugin.pro Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
| * Fix QFINDTESTDATA when using cmake ninja generatorStephen Kelly2016-03-195-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt CI does not have ninja, but the autotest can be used for manual regression finding. cd qtbase/tests/auto/cmake qmake make check cd build cmake . -DHAVE_NINJA=ON ctest -R FINDTESTDATA Change-Id: Ic3f3748f6ab04e37fa5287c59486e5cd46dcabb4 Reviewed-by: Stephen Kelly <steveire@gmail.com>
* | Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/devLiang Qi2016-01-261-1/+3
|\|
| * CMake: Don't attempt gui-tests if Qt is built with -no-guiStephen Kelly2016-01-181-1/+3
| | | | | | | | | | Change-Id: I5f327fa1b0c7827535a4b00ca7d0d4281b1eec7b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-2138-608/+418
|/ | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* CMake: Ensure that -fPIC is passed in tests.Kevin Funk2016-01-112-0/+4
| | | | | | | | CMake newer than 2.8.12 automatically adds the appropriate flag, but CI still runs 2.8.11. Change-Id: Ie61375f2feb54a92c9d8f0ed6ad5227a67343bc5 Reviewed-by: Stephen Kelly <ske@ableton.com>
* CMake: Make all tests link to Qt librariesKevin Funk2016-01-093-3/+4
| | | | | | | | | | | | | | | | | | This is needed as of commit v5.6.0-beta1~483 (Add an automatic use of the ELF-versioned QtCore symbol, 2015-10-20). Even if a translation unit only contains #include <QtCore/QString> int main(int,char**) { return 0; } it must link to QtCore which provides the qt_version_tag symbol. Change-Id: I827c0a7403320e7e5b384d8608face20fcecdaea Reviewed-by: Stephen Kelly <ske@ableton.com>
* Prospective fix for running cmake tests with -no-widgetsSimon Hausmann2016-01-071-1/+1
| | | | | | | Don't try to run test_interface when Qt is configured without QtWidgets. Change-Id: If6c376c250215c1d639b06881d16c0141091f288 Reviewed-by: Stephen Kelly <ske@ableton.com>
* CMake: Fix regression with quoted OPTIONS parameterAndré Klitzing2015-03-111-0/+3
| | | | | | | If a parameter contains quotes the check for "-binary" fails. Change-Id: I27148b590d85291a93f1992dfd277fb857bec6e2 Reviewed-by: Stephen Kelly <steveire@gmail.com>
* Update text to the new license headerSergio Ahumada2015-02-121-6/+6
| | | | | | Change-Id: I643049a865b0a8936e132e12f7845d5527f4f808 Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com> Reviewed-by: André Klitzing <aklitzing@gmail.com>
* CMake: Introduce qt5_add_binary_resourcesA. Klitzing2015-02-116-0/+79
| | | | | | | | | | | Optional parameter DESTINATION to set target rcc file Example: qt5_add_binary_resources(GenerateFixture "fixture.qrc") Task-number: QTBUG-41728 Change-Id: I9dc2fe8e7d5e9ad3873b89f75ab84a2a1b9d1d29 Reviewed-by: Stephen Kelly <steveire@gmail.com>
* Update copyright headersJani Heikkinen2015-02-1137-222/+222
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Fix cmake test_moc_macro_target with namespaceFrederik Gladhorn2014-12-301-0/+6
| | | | | | | | | | | The interface macro needs to be in the Qt namespace, otherwise the template specialization in Q_DECLARE_INTERFACE fails. Task-number: QTBUG-41959 Change-Id: I818da5ba8460219d73c0d248ee410ac92f7498f4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com> Reviewed-by: Stephen Kelly <steveire@gmail.com>
* Update license headers and add new license filesMatti Paaso2014-09-2437-666/+370
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Fix cmake-test for Dynamic OpenGL.Friedemann Kleint2014-08-051-12/+19
| | | | | Change-Id: I604501d07b4728c5158e88a6760b9f1e31311991 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* purge vestiges of opengl es 1 supportOswald Buddenhagen2014-04-042-6/+2
| | | | | | | | amends 0d5170256c1. Change-Id: Ifa178d38f602bb7c66ef13334673ff47e332af5b Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Increase CI timeout for cmake tests.Friedemann Kleint2014-03-061-0/+1
| | | | | | Change-Id: I1711f99f9e46f1d195684e3c3a714b00618dca2e Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Teach CMake about Qt 5 plugins.Stephen Kelly2013-09-101-0/+27
| | | | | Change-Id: Idd3225759f9f5ec620f79e29035eb176f965bef7 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* CMake: Allow specifying a TARGET in invocations of macros.Stephen Kelly2013-08-216-0/+245
| | | | | | | | | | | | Forward-port of 9ce60ff509c4ff27fe861fc5b2080f50897a68c4 (Qt4Macros: Allow specifying a TARGET in invokations of macros., 2013-02-26) from cmake.git. This causes the INCLUDE_DIRECTORIES and COMPILE_DEFINITIONS to be used from the specified target when running moc. Change-Id: I868a35ade3c6b059e64d226291cf2046709d86d4 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Populate INTERFACE_LINK_LIBRARIES property in the cmake files.Stephen Kelly2013-08-215-0/+183
| | | | | | | | This is new in CMake 2.8.12 and replaces the old properties matching IMPORTED_INTERFACE_LINK_LIBRARIES_<CONFIG>. Change-Id: I5d4c454972f2535f6792e95718c73d80c56ac24c Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Don't check for the existence of private include directories.Stephen Kelly2013-07-221-1/+1
| | | | | | | | | | | Some packagers don't want to install the private headers. Check the existence of private headers only if the 'Private' component is specified when finding the package. Task-number: QTBUG-32466 Change-Id: I1fdbfb25e8ce485cd051564b937f766b2733741a Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Only expect EGL libraries in the cmake files if Qt is configured to use it.Stephen Kelly2013-05-071-1/+1
| | | | | | Change-Id: Ida382a80dba882bbeb920756adc0c16321efe37e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Run the CMake tests with QPrinter, not QPrintDialog.Stephen Kelly2013-04-241-1/+1
| | | | | | | | QPrinter is not implemented on android, so the test fails to link there. Change-Id: I10ca0179323362a9c9f74325332043c968d67d3c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Enable OpenGL library detection for mac.Stephen Kelly2013-04-241-5/+3
| | | | | Change-Id: If99d3faf2b08ac5109d619ff69efdaa3857c007f Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add IMPORTED targets for the GL libraries used by Qt.Stephen Kelly2013-04-225-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | There may be multiple libraries specified in the mkspec, such as EGL and Mali, as used in devices/linux-sh4-stmicro-ST7108-g++, so create an imported target for each one. Also populate the Qt5Gui_EGL_LIBS variable with all created imported targets. Similar variables are created for the used OPENGL implementation. In the case of using the packaged ANGLE library, we already know the exact locations of the binaries. This makes it possible for third parties to use the same GL implementation as used by the Qt build itself. As these are used only privately by QtGui, they are also added to the DEPENDENT_LIBRARIES of that target so that they are found for rpath-link usage. On some platforms (eg Raspberry Pi), multiple include directories must be set to include egl.h, as the headers it includes for vcos are a bit scattered. Task-number: QTBUG-29132 Change-Id: I1126da3d37cd51c88d3670347c8b6405b285efb5 Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Update test exclusion following bug fix in recent cmake versions.Stephen Kelly2013-04-171-2/+2
| | | | | | Change-Id: I8174ca78b4e2d8b4344278acf8ca4b0db3115d1a Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Test that the CMake files create appropriate version variables.Stephen Kelly2013-04-051-0/+10
| | | | | | | Change-Id: I1d8061302fbb8494b5ae31e20a644745fe969f10 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Brad King <brad.king@kitware.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Populate includes, defines and pic flags in target interfaces.Stephen Kelly2013-03-275-0/+203
| | | | | | | | | | | | | | | Used by features in CMake 2.8.11. This matches the features in FindQt4 in that version of CMake, namely that the IMPORTED targets contain the appropriate INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS and that the qtmain.lib static library is automatically linked to on Windows by executables. Additionally, the INTERFACE_POSITION_INDEPENDENT_CODE property is set appropriately if Qt requires users to use position independent code. Change-Id: Ide341f43fcaf7d722a7bdf1a12b1071c7e548ccc Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>