Commit Graph

37878 Commits

Author SHA1 Message Date
Alexandru Croitor
84af8f9b0b Fix build of qmake on macOS
Two changes were needed:
- correctly link against frameworks
- use qcore_mac.cpp instead of qcore_mac_objc.mm, because we don't
  link against AppKit

Change-Id: Ibd9d6d367a7fcdf7dce277c1b06d36c491294eeb
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-27 16:11:53 +00:00
Alexandru Croitor
58bd86443c Fix usage of linker -no-undefined flag for macOS
Change-Id: I41c55871a8db3d860fc20ad17eb9a97b01d62448
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-27 16:11:43 +00:00
Tobias Hunger
c971d2d359 CMake: pro2cmake.py: Handle values with () in assignments
Change-Id: I0f59c7fa57cd6c64b151f439d4eea4ae56dca288
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:03:20 +00:00
Tobias Hunger
22dc78f417 CMake: pro2cmake.py: Fix handling of TEMPLATE=subdir .pro-files
Change-Id: I52f575df199c4d9b38123ab5d838f2e85344835d
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:03:07 +00:00
Tobias Hunger
8c04d6c967 CMake: pro2cmake.py: Improve condition simplification code
Improve the code that simplifies conditions to take "OS families"
into account. E.g. if a system must be ANDROID, then it is redundant
to express that it is NOT APPLE_OSX.

Change-Id: Ib7e62726c309bf84b9e5e0d6a6e3465511db0ead
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:02:58 +00:00
Tobias Hunger
35f23a3dad CMake: pro2cmake.py: Better parsing of scopes with else
Parse conditions more exactly as before, enabling proper handling
of else scopes.

Change-Id: Icb5dcc73010be4833b2d1cbc1396191992df1ee4
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:02:45 +00:00
Tobias Hunger
b1fa25e7b8 CMake: Small unsorted fixes in preparation of upgrading to dev branch
Change-Id: Id4d03558e956c6994dc6a8b701030ba4edf86adf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-27 16:02:29 +00:00
Mikhail Svetkin
885494c50f CMake: Fix build without double-conversion on macOS
Change-Id: I5102e93141eec95044df44884dcf6ecd1b9e8dd0
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-02-27 15:28:11 +00:00
Albert Astals Cid
ca1113728e cmake: Make it so that eglfs plugin doesn't hang on make -jN
Since the dependency on moc is in CorePrivate (o Core) we need
the target to depend on it otherwise cmake will try to use moc before
it is built.

This is because what we do with cmake is say "moc is in this
path, you can use it", but it's actually not built yet so
we need to depend on a target that depends on moc directly otherwise
cmake will trust us and try to use a cmake that doesn't exist and just
hang forever when running make -jN

Change-Id: Icf55c62092fd3fd3754a4f4f28c8c313bf374615
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-27 15:06:21 +00:00
Albert Astals Cid
31e1dda94b cmake: Give the egl_x11 test the necessary libs to compile
And add the eglfs_x11 plugin

We need to actually try to compile the test as the comment it it says
that having x11 and egl is not enough since sometimes they are actually
incompatible

Change-Id: If6bdc08c21b91fa9c41663f2fa653fd59e5ddd2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-27 15:04:59 +00:00
Albert Astals Cid
e03596c2a7 pro2cmake: account for child .pro files having includes
Change-Id: Ic2213578c9bd27787ae9788acbe4455252a1158c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-02-27 15:04:48 +00:00
Albert Astals Cid
a25f9a1507 cmake: Start adding compiler flags
Only has warnings for now

Next to come is the support for developer-build and enabling Werror

Change-Id: I8070dc06eb439c2a03007cce975c8147ff7e1582
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2019-02-21 13:51:19 +00:00
Albert Astals Cid
632d014afd cmake: set a CMAKE_BUILD_TYPE if none was specified
Because the default "empty" CMAKE_BUILD_TYPE is a weird default

Change-Id: I5768f67aa85dce4108e421d2f4eacdfb1cb5beb0
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2019-02-21 13:51:05 +00:00
Liang Qi
b88110a3d7 cmake: fix a syntax for else
This amends d885226544.

Change-Id: Ia7b2fb6e0e762c73d3c0775cdd106c1dec646ab2
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-21 11:04:38 +00:00
Simon Hausmann
d885226544 Fix ELF interpreter detection
Use the same approach as with qmake, by using readelf -l /bin/ls and
then a regular expression to extract the program interpreter path. It's
a little simpler in cmake because we can avoid the perl dance and quotes
and just use cmake's built-in regular expression matching.

This change also excludes static builds, as with qmake.

Change-Id: I699e166c4b38b3fe98e6390316206109ad6363f9
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2019-02-20 11:14:59 +00:00
Simon Hausmann
22bd8576cb Update FindEGL.cmake from upstream
Upstream commit 7c64db9568296e1caafcfd7163cea3ab1b1626ae fixed the
suffix path checking and thus the build on FreeBSD.

Change-Id: I0cceeac0639c2899c617ffd6359098d2154acf5b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-20 09:33:28 +00:00
Simon Hausmann
d61b6ea30a Add support for building conveniently with ccache
Pass -DQT_USE_CCACHE=ON to enable the use of ccache. This avoids having
to set up symlinks, which is useful when cross-compiling against
different targets.

Change-Id: I023fff105baaa538730997948aa122d2678887ce
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2019-02-19 08:59:12 +00:00
Simon Hausmann
c604a1265a Fix use of uic when cross-compiling
Don't try to build uic but instead import it. This is done centrally now
in add_qt_tool.

Change-Id: I241fbb924de68549e9c0320e157351bd7b1bf5c3
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2019-02-19 08:45:35 +00:00
Simon Hausmann
b2f03791c1 Provide some basic instructions for cross-compiling and using CCache
Change-Id: I8bb90746d0cef2ea61a5494ef358713d732dcfce
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2019-02-19 08:45:19 +00:00
Simon Hausmann
ec410d31cd Fix source file name on Android
Change-Id: I0814cb02ef7205bb5d197ea0e5cc7e26a8bc15eb
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2019-02-18 16:43:41 +00:00
Simon Hausmann
0b13578dcb Skip the qmake build when cross-compiling
Change-Id: I24da7eb9587235aa937a984e91a833284b4f28e5
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2019-02-18 16:19:10 +00:00
Albert Astals Cid
af7fe32ebd cmake: build eglfs_emu
Change-Id: I793865f55114d08c342477f4e786d1089239ace4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-18 08:07:42 +00:00
Albert Astals Cid
df17678ab1 cmake: build eglfs_kms_egldevice
Change-Id: Ib224140d64efdc9c7190add7b568484313ecd7a3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-18 08:07:28 +00:00
Albert Astals Cid
d03b915c20 cmake: build eglfs_kms plugin
Change-Id: I362c17a67c2cb4c243c39f760c598bfc7e1071bd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-18 08:07:18 +00:00
Albert Astals Cid
b56d9916d9 cmake: build eglfs_kms_support
Change-Id: I0c1cca14756519f60f71143150e56380fa3a6289
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-18 08:07:08 +00:00
Albert Astals Cid
5f8e4b7cf0 cmake: add more mappings to helper.py
Change-Id: Ie5096c1fe74105db84ccd60655a20d389a887b14
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-18 08:06:49 +00:00
Albert Astals Cid
697f358466 cmake: add deviceintegration/CMakeLists.txt
Change-Id: I2b30c27bb4f17f40143a66e89b3d5986375a76a6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-18 08:06:36 +00:00
Albert Astals Cid
dc0870db74 pro2cmake: Target dependencies can be on -private libs
so use map_qt_library instead of map_qt_base_library

Change-Id: I4dd0097fff3ffd9ec4aad36d11d79ea23a08cb90
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-18 08:05:49 +00:00
Albert Astals Cid
a9d3baa9f4 cmake: Add the eglfs platform plugin
Change-Id: I1caef781db690a3c25e871947c11175cde5cc97b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-15 15:08:29 +00:00
Albert Astals Cid
db9cb61993 cmake: helper.py more mappings
Change-Id: I69a1715bbda8f5ddfb367e7c7c693e4ec412f5c3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-15 15:08:12 +00:00
Kevin Funk
d37fd195a2 cmake: Compile qobject.cpp with same flags as Core
Makes sure qobject.cpp.o also sees -DQT_BUILD_CORE_LIB

Change-Id: I2aaf1cec62eeab07bbec6e4135bbe144d4ae7fba
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-02-15 09:31:33 +00:00
Liang Qi
2bdb808929 cmake: printsupport depends on core, gui and widgets
Change-Id: Ifd1f8c23eca3daa788f814b450ad326f6415212f
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-14 11:16:18 +00:00
Kevin Funk
cf7426e8c9 cmake: Make sure to finddeps of private target
Public interface libraries of the private target need to be first looked
up via `find_dependency(...)` in the CMake config files as well.

This patch is just changing the foreach() loop and defer the package
config file generation.

Change-Id: Iecaf7f778379b526f12ac6a42e76d714d9349b2c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-14 07:39:21 +00:00
Kevin Funk
0896e203d6 cmake: Make sure QT_SYNCQT is persisted
Lifetime of the variable is bound to the function body. Use a CACHE
variable to escape it (and to speed up future calls to the function).

Change-Id: I2d164a1c94e64cc652e65c1eea0522f3d911ad82
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-14 07:38:50 +00:00
Kevin Funk
b2337e1d00 cmake: Make sure QtModuleConfig.cmake.in is found
... when QtBuild.cmake is being included from another Qt module

Change-Id: Ia55e03422cc84a56dd9eac640621e5b2ee9681bd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-14 07:38:47 +00:00
Kevin Funk
766701a9b2 cmake: Install all necessary .cmake files
... for other modules

Change-Id: Iea184036a46816e524de247e1d650ae417de294c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-14 07:38:45 +00:00
Kevin Funk
e1a750a102 cmake: Minor fix in QtModuleConfig.cmake.in
Change-Id: Ia01e935582b5291fa8ed6bf46866fbb74d41f4b0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-14 07:38:40 +00:00
Kevin Funk
f0d6fd6b95 cmake: Also use -Wl,--no-undefined for Clang
Change-Id: Ida6bf41e496a0e800f1146d15edf192d0635a3c9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-13 11:48:02 +00:00
Kevin Funk
35a17f1941 cmake: src/printsupport: Rerun conversion script
Change-Id: I0bdc4eefa5e1e78ba7f68da5848e32297c6af5a1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-13 11:46:44 +00:00
Kevin Funk
4c51273f1f cmake: Build qmake using CMake
Change-Id: Ia2ad09774252154d19d7c80abfcd72ecd09025ae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-13 11:16:28 +00:00
Simon Hausmann
cdab00c7ee Replace "our" FindEGL.cmake with the ECM version
The ECM version now also does a compile test, which was the only real
"functional" difference.

Change-Id: I1d5cd590359feba7c7a38ff374992349d5943070
Reviewed-by: Volker Krause <volker.krause@kdab.com>
2019-02-13 09:40:50 +00:00
Simon Hausmann
96c0dc07a7 Use rpath by default not only for building but also installed binaries
This makes it possible to use the binaries out of the box. This is
particularly relevant for program binaries that link against QtCore
dynamically, when trying to use these binaries during cross-compilation.

Change-Id: I7dee93194be3fff5c6e3bbb9e202e4cf5e19b6d0
Reviewed-by: Volker Krause <volker.krause@kdab.com>
2019-02-13 08:59:49 +00:00
Albert Astals Cid
d523a642dc cmake: enable vnc platform plugin
Change-Id: I5015681aff3c9ceb5c0b72571bc8756f3ada104c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-12 17:02:02 +00:00
Albert Astals Cid
9a01b4312b cmake: set WrapOpenGL_FOUND to ON
Otherwise the cmake summary at the end says
-- The following packages have not been found:

 * WrapOpenGL

It's OpenGL or GLESv2 that will show there as missing if needed

Change-Id: I182f1299b86e1a4e24762d0bad6533c6136cbbcc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-12 17:01:36 +00:00
Albert Astals Cid
6235fd68d5 cmake: FindWrapOpenGL->WrapOpenGL
Change-Id: Ic44d3ee806cf287a2c3cb36811b99418ea92d8a0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-12 17:01:02 +00:00
Volker Krause
cc8e2c4572 Use CMakePushCheckState
Change-Id: I58d779674363a7f7db4a7ea4ca4a9f4a9e271798
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-02-12 16:02:58 +00:00
Simon Hausmann
1f96506748 Fix build without Vulkan
The syncqt generated headers are optional, i.e. their source may not
exist -- so for now make their installation optional (as it seems to
have been the case with qmake).

Change-Id: Ieaeb3d13a1d8ff1f158b5b1c918750fec48d3bef
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
2019-02-12 15:33:06 +00:00
Simon Hausmann
519ef817ff Fix Desktop GL/EGL/GLESv2 linkage
This change fixes a few things in one go:

  * cmake's FindOpenGL cannot be used reliably to detect EGL. So use a
    custom module for that.
  * Added a custom module for GLESv2 detection, as cmake's FindOpenGL
    does not support that.
  * Map CONFIG += opengl to a WrapOpenGL target, which links against
    either GLESv2 or libGL - just like mkspecs/features/*/opengl.prf
  * cmake's FindOpenGL remains in use solely to detect the availability
    of desktop gl.

Change-Id: I9315e5ad1fd88e1b7dc7e920053e98fb51fea7fc
Reviewed-by: Volker Krause <volker.krause@kdab.com>
2019-02-12 14:57:30 +00:00
Albert Astals Cid
6424e70bbe cmake: compile the networkmanager bearer plugin
Change-Id: Ia744afec6114266fcb693702db257fe36ba94b92
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-02-12 14:40:34 +00:00
Liang Qi
863cea981b cmake: add localserver in network
Change-Id: I319ffad73bb5f8285b1b2fa583d813667498c3dd
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-02-12 14:40:30 +00:00