Commit Graph

81 Commits

Author SHA1 Message Date
Kevin Funk
b71b7461b0 CMake: Set SKIP_AUTOMOC/AUTOUIC where needed
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>
2017-11-22 13:51:30 +00:00
Kai Koehne
b2efaeba79 tests: Unify license to GPL-EXCEPT
Change-Id: Ic718650a8a7bddd4ee28c5650a3f5baf70886e51
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-04-03 07:18:46 +00:00
Stephen Kelly
8266de089c CMake: Create a Qt5::<ModuleName>Private target for each module
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>
2016-12-23 19:24:35 +00:00
Liang Qi
216f57ef86 Merge remote-tracking branch 'origin/5.6' into 5.7
Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
2016-04-04 08:59:18 +02:00
Kai Pastor
9bc352e38d Enable cmake auto tests for -no-gui
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>
2016-03-30 07:16:50 +00:00
Liang Qi
6cb8121a44 Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/widgets/styles/qgtkstyle_p.cpp
	tests/auto/corelib/io/qtextstream/test/test.pro
	tests/auto/corelib/plugin/plugin.pro

Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
2016-03-21 09:02:57 +01:00
Stephen Kelly
6ec89bec0a Fix QFINDTESTDATA when using cmake ninja generator
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>
2016-03-19 13:44:21 +00:00
Liang Qi
0a1af55a9b Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-26 11:27:37 +00:00
Jani Heikkinen
f776595cc1 Updated license headers
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>
2016-01-21 18:55:18 +00:00
Stephen Kelly
99e25dd7d8 CMake: Don't attempt gui-tests if Qt is built with -no-gui
Change-Id: I5f327fa1b0c7827535a4b00ca7d0d4281b1eec7b
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-18 13:00:03 +00:00
Kevin Funk
558f69a18b CMake: Ensure that -fPIC is passed in tests.
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>
2016-01-11 09:53:37 +00:00
Kevin Funk
000c4358ce CMake: Make all tests link to Qt libraries
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>
2016-01-09 15:35:20 +00:00
Simon Hausmann
c7797184f0 Prospective fix for running cmake tests with -no-widgets
Don't try to run test_interface when Qt is configured without QtWidgets.

Change-Id: If6c376c250215c1d639b06881d16c0141091f288
Reviewed-by: Stephen Kelly <ske@ableton.com>
2016-01-07 19:29:36 +00:00
André Klitzing
cacae82a70 CMake: Fix regression with quoted OPTIONS parameter
If a parameter contains quotes the check for "-binary" fails.

Change-Id: I27148b590d85291a93f1992dfd277fb857bec6e2
Reviewed-by: Stephen Kelly <steveire@gmail.com>
2015-03-11 07:31:33 +00:00
Sergio Ahumada
e82d3b1a1e Update text to the new license header
Change-Id: I643049a865b0a8936e132e12f7845d5527f4f808
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
Reviewed-by: André Klitzing <aklitzing@gmail.com>
2015-02-12 18:29:40 +00:00
A. Klitzing
2af1277631 CMake: Introduce qt5_add_binary_resources
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>
2015-02-11 20:59:35 +00:00
Jani Heikkinen
83a5694dc2 Update copyright headers
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>
2015-02-11 06:49:51 +00:00
Frederik Gladhorn
8bd84b11d3 Fix cmake test_moc_macro_target with namespace
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>
2014-12-30 10:05:58 +01:00
Matti Paaso
974c210835 Update license headers and add new license files
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3
- Removed LICENSE.GPL

Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
2014-09-24 12:26:19 +02:00
Friedemann Kleint
61269c26f6 Fix cmake-test for Dynamic OpenGL.
Change-Id: I604501d07b4728c5158e88a6760b9f1e31311991
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-05 06:34:33 +02:00
Oswald Buddenhagen
a4ec90175c purge vestiges of opengl es 1 support
amends 0d5170256c.

Change-Id: Ifa178d38f602bb7c66ef13334673ff47e332af5b
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-04-04 19:32:21 +02:00
Friedemann Kleint
3d73e11ccc Increase CI timeout for cmake tests.
Change-Id: I1711f99f9e46f1d195684e3c3a714b00618dca2e
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-03-06 17:22:55 +01:00
Stephen Kelly
955052c0d9 Teach CMake about Qt 5 plugins.
Change-Id: Idd3225759f9f5ec620f79e29035eb176f965bef7
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-10 14:38:18 +02:00
Stephen Kelly
8074693425 CMake: Allow specifying a TARGET in invocations of macros.
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>
2013-08-21 16:39:55 +02:00
Stephen Kelly
ee50096830 Populate INTERFACE_LINK_LIBRARIES property in the cmake files.
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>
2013-08-21 16:39:55 +02:00
Stephen Kelly
782ed5eebb Don't check for the existence of private include directories.
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>
2013-07-22 15:41:45 +02:00
Stephen Kelly
3483336889 Only expect EGL libraries in the cmake files if Qt is configured to use it.
Change-Id: Ida382a80dba882bbeb920756adc0c16321efe37e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-05-07 22:43:14 +02:00
Stephen Kelly
1c17275047 Run the CMake tests with QPrinter, not QPrintDialog.
QPrinter is not implemented on android, so the test fails to
link there.

Change-Id: I10ca0179323362a9c9f74325332043c968d67d3c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-04-24 16:24:40 +02:00
Stephen Kelly
4341ae32f4 Enable OpenGL library detection for mac.
Change-Id: If99d3faf2b08ac5109d619ff69efdaa3857c007f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-24 01:30:20 +02:00
Stephen Kelly
bc4fbcd215 Add IMPORTED targets for the GL libraries used by Qt.
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>
2013-04-22 18:35:52 +02:00
Stephen Kelly
bcc14954d3 Update test exclusion following bug fix in recent cmake versions.
Change-Id: I8174ca78b4e2d8b4344278acf8ca4b0db3115d1a
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-04-17 22:14:19 +02:00
Stephen Kelly
30d01db3a5 Test that the CMake files create appropriate version variables.
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>
2013-04-05 14:20:39 +02:00
Stephen Kelly
ec37cdbc80 Populate includes, defines and pic flags in target interfaces.
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>
2013-03-27 14:54:49 +01:00
Oswald Buddenhagen
76c0be34cd Merge branch 'dev' into stable
This starts Qt 5.1 release cycle

Conflicts:
	src/gui/text/qfontdatabase.cpp
	src/gui/text/qharfbuzz_copy_p.h
	src/widgets/kernel/qapplication.cpp
	src/widgets/kernel/qcoreapplication.cpp

Change-Id: I72fbf83ab3c2206aeea1b089428b0fc2a89bd62b
2013-03-20 13:49:28 +01:00
Stephen Kelly
bc1fb206bb Run CMake dbus tests if dbus is expected to be available.
Instead of first finding it and then testing that we can find it.

Change-Id: I1a1090693520b1d6adadef93839f25d277947e76
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-19 11:26:41 +01:00
Stephen Kelly
4111a676f1 Make the qtbase cmake tests work without the Widgets module.
Task-number: QTBUG-28540

Change-Id: I916d104c8aba551ee9a5b34da3fd85dcb26bbf64
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-18 20:17:10 +01:00
Stephen Kelly
d87c5db10a Make cmake tests not depend on QtWidgets where not needed.
Change-Id: Ib6347360d678bbe54445ebb0680ad66d77a7f3c7
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-15 10:04:30 +01:00
Stephen Kelly
d0ea65b5cb Clean up cmake test regarding dependencies.
There is no need to list the dependencies of the Widgets module.

Change-Id: I9469d4f352685f7122a258f1a44bd017fdc5b3a7
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-15 10:04:23 +01:00
Stephen Kelly
0ec541c9ad Test the OpenGLExtensions cmake module.
Change-Id: I3cc71e035fd1c34e05ecb470f897a72a39f42ca4
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-03-14 16:38:57 +01:00
Stephen Kelly
91cd2009bd Generate a Qt5ConfigVersion.cmake file.
This allows finding a minimum particular version of Qt 5.

Change-Id: I96112f1be90f397ec60a2b233989ac0e0380bef9
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-13 16:07:09 +01:00
Stephen Kelly
d89fe1c7b3 Test that the ConfigVersion.cmake files work.
Invoking find_package with a version but without the version
file present results in an error.

Change-Id: I29d662081ad5dbd7b2259abeec06affda97cbb6a
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-13 09:48:58 +01:00
Stephen Kelly
8cdcff460d Clean up the CMake dbus module test.
The DBus module is aware of its QtCore dependency, and it doesn't need
to be found explicitly. This test probably dates from when that was not
the case.

Change-Id: I3c78997660efed14d84b062d38d8c68dd4f7ae56
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-03-13 09:48:26 +01:00
Frederik Gladhorn
5e8ae03578 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	configure
	qmake/generators/mac/pbuilder_pbx.cpp
	src/corelib/kernel/qtimerinfo_unix.cpp
	src/plugins/platforms/cocoa/qcocoabackingstore.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/windows/qwindowswindow.cpp
	src/plugins/platforms/xcb/qglxintegration.cpp

Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
2013-03-05 13:42:11 +01:00
Stephen Kelly
7477d50fce Populate the cmake variables only one time.
Since we're only including the Extras file one time, invoking set() for
the include dirs again will overwrite the addition of include dirs in
the extras file.

We only need to populate these variables if not set anyway, so do that.

Change-Id: I04dad0674778e79c8c12c18231b8ce6c92edf881
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-02-21 22:41:05 +01:00
Frederik Gladhorn
02ba93dd3d Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
2013-01-28 11:10:29 +01:00
Sze Howe Koh
63569a68d2 Doc: Fix module name format
Follow the conventions at
http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation

QtCore         -> Qt Core
QtDBus         -> Qt D-Bus
QtDesigner     -> Qt Designer
QtGui          -> Qt GUI
QtImageFormats -> Qt Image Formats
QtNetwork      -> Qt Network
QtPrintSupport -> Qt Print Support
QtScript       -> Qt Script
QtSql          -> Qt SQL
QtSvg          -> Qt SVG
QtTest         -> Qt Test
QtWebKit       -> Qt WebKit
QtWidgets      -> Qt Widgets
QtXml          -> Qt XML

QtConcurrent   -> Qt Concurrent (partial)
QtQuick        -> Qt Quick      (partial)

Also, distinguish between "module" and "library"

Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-01-25 17:27:44 +01:00
Stephen Kelly
314e5ce5ee Add an umbrella cmake config file for Qt 5.
Change-Id: I96b6e96539a84a5919992afbaee757fa080b7ae0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-01-24 20:37:34 +01:00
Stephen Kelly
03b9b423b0 Generate instances of types in the CMake tests.
All modules currently have a test_modules CMake test. The
new module_includes test has very similar requirements, and can
obsolete the hand-maintained test_modules tests in all modules.

After all test_modules have been removed in other repos, the
module_includes test can be renamed to that name.

The types chosen need to have a constructor which can be invoked
with no arguments. QtConcurrent has no public classes which fit
that description so it is still tested separately

Change-Id: Id7929cd32b3112c293cbf5e6964cc894a697f9b1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-10-31 07:16:03 +01:00
Stephen Kelly
49555e3ac9 Add a CMake macro to test module includes
The variations of includes which should work are tested. For example,
in the case of testing the QtCore module and QObject include, the
following includes are generated and compiled:

      #include <QObject>
      #include <QtCore/QObject>
      #include <QtCore>
      #include <QtCore/QtCore>

As the private include directories are not available to the compiler,
this also tests that private headers are not included from public ones.

Change-Id: Id03d0fe290c9691e0f7515015892991d1701ab72
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-10-26 15:23:30 +02:00
Stephen Kelly
1550c46179 Add missing test for the Qt5PrintSupport module.
Change-Id: Ic3860cc13fbb37a1d3ae63ad100b7d722a987272
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-10-25 14:10:04 +02:00