Commit Graph

96 Commits

Author SHA1 Message Date
Eike Ziller
df6967a897 Merge remote-tracking branch 'origin/4.14'
Change-Id: I6e67f23464fc14dda5a659004f0aa360d6f5d25f
2021-01-27 12:28:47 +01:00
Eike Ziller
24c03b51fd cmake build: Remove unused internal variables
Change-Id: I68ed91462c3b3c9f27c2a0a5749c373704ce467a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-25 10:44:43 +00:00
Eike Ziller
d95e1f940a Merge remote-tracking branch 'origin/4.14'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I5b8d93f2f08b62626c3f3447728c64d198b601ff
2021-01-04 09:09:21 +01:00
Eike Ziller
0f9a206bd5 cmake build: Make separate debug info optional
In the CMake build in general, but still use it for
RelWithDebInfo builds with the build*.py scripts.

Fixes: QTCREATORBUG-25151
Change-Id: I8414f953278ebb395f73414c12af0ed7bd4fcdbe
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-22 13:02:03 +00:00
Eike Ziller
305ca7e434 cmake build: Fix handling of test dependencies
Test dependencies are not "real" code dependencies, they just
declare that for testing the plugin the other plugin has to
be loaded, even though it is _not_ a code dependency.

Add PLUGIN_TEST_DEPENDS to add_qtc_plugin. We cannot assume
that the target exists at that point, so adapt the usual pattern.

Fixes: QTCREATORBUG-25024
Change-Id: I4165ff8df762309e0be0bfe9e8bedef796a3bf17
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-18 08:24:46 +00:00
Eike Ziller
4bc2b4741d Merge remote-tracking branch 'origin/4.14'
Change-Id: I842a7c7358fd0ff6d85c151806e440043914e09a
2020-12-14 14:19:15 +01:00
Eike Ziller
0a20b8e7de cmake build: Fix PLUGIN_RECOMMENDS
Use the right variable name, and syntax for iterating the list.
Fix plugin configuration order, so targets are found.
Fix misspelled plugin name.

Also remove unused and wrong "EXPERIMENTAL" option.

Change-Id: I77cc5d12ebdaa8bcd0315dd830a9435c648b2ba3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-12-11 11:07:14 +00:00
Eike Ziller
8245523653 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/designer/cpp/formclasswizard.h
	src/plugins/designer/cpp/formclasswizarddialog.h

Change-Id: I9f9d166e1a9249022305503f9cbe571136c2a2b1
2020-11-25 11:25:34 +01:00
Eike Ziller
05a1b2a6e8 cmake build: Remove unused component "Dependencies"
We don't use it for packaging, nor for github anymore, it duplicates a
whole lot of logic, and that only partially (as an example fixing the
RPATH for clang tools on macOS is missing), and the Clang part only
works with CMake >= 3.14 ("file(READ_SYMLINK"), which was the final
trigger of this patch.

Change-Id: I21ff6b01297009eff15bda36963e729dea4927c8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-23 10:46:39 +00:00
Eike Ziller
5ca70bdcb3 Merge remote-tracking branch 'origin/4.14'
Change-Id: Iea84f23cf394de13e99a9ed777c8c113e4eff473
2020-11-19 15:38:13 +01:00
Eike Ziller
2422a90f1e cmake build/macOS: Fix installing when built with Qt6
In a framework the actual library can be accessed via two different
paths:

- Foo.framework/Foo
- Foo.framework/Versions/A/Foo

It happens that Qt5 exports the first variant for the framework LOCATION
and Qt6 exports the second variant.
We want to cut the whole "Foo.framework" part for the framework's location,
so actually do that.

Amends 98db9774f2

Change-Id: Idad12e92f2bfbdc480256a832320c4dec76a0e5f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-18 11:11:22 +00:00
Eike Ziller
eb4d230e38 cmake build: Create DebugInfo component with separate debug info
When building with RelWithDebInfo. The CMake code is adapted from
corresponding (internal) functions from Qt 6.
Also let the scripts create an additional *-debug.7z with the debug
info.

Task-number: QTCREATORBUG-24916
Change-Id: Ibc3c8c0013718b9c5e868136e5ce01e1e99f84c4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-17 11:32:32 +00:00
Cristian Adam
ab324a626c CMake: Add convenience BUILD_PLUGINS|EXECUTABLES|LIBRARIES variables
By setting the CMake list variable "BUILD_PLUGINS=foo;bar" the
Qt Creator CMake API will set "BUILD_PLUGINS_BY_DEFAULT=OFF" and
"BUILD_PLUGIN_FOO=ON" and "BUILD_PLUGIN_BAR=ON"

Change-Id: I766d7451bfb7ccbd23c973f288b06a18ada79dda
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-16 08:51:44 +00:00
Eike Ziller
da78629153 cmake build: Use CMAKE_INSTALL_NAME_TOOL instead of hardcoding
Amends 98db9774f2

Change-Id: I4aaaddcfc0e5cc31bb0646a3a3ccc18ee2fa5ff1
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-13 14:20:17 +00:00
Eike Ziller
98db9774f2 cmake build: Do not copy whole app bundle directory when installing
CMake just copies the whole app bundle directory when installing a
target, but we copy various things there that should not be part of the
installation, like static libraries, executables with SKIP_INSTALL,
Clang resources, and potentially .dSYM bundles.

Fixes: QTCREATORBUG-24021
Change-Id: I98bb466b664d2d6d203f3adc20d8345d9b3ce3cc
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-13 11:04:32 +00:00
Eike Ziller
fd6fe3f4e6 cmake build: Remove branding from target names
Targets are never branded

Change-Id: If7f23ac005b5492d52f87ba71789e674bb077a00
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-11 15:21:13 +00:00
Eike Ziller
d24c34c747 cmake build: Disable refactoringbackend and pchmanagerbackend
Disable the libs and executables if not needed by either the plugins or
by the tests.

So far in the cmake build the ClangRefactoring and ClangPchManager
plugins were disabled by default, but the backend executables were still
built. With this change the executables are not built if the plugins are
not enabled, like it is the case in the qmake build.

To make it possible to build all the tests even though the plugins are
disabled by default, the backend libraries are still built if tests are
enabled.

Change-Id: I3b61479525e1472a55215f1b003fea9facaf9e93
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-11-05 15:11:39 +00:00
Eike Ziller
495dee98fc cmake build: Handle turning on/off libraries the same as plugins
Previously the library targets were added, but with EXCLUDE_FROM_ALL.
This had the effect that libraries were not compiled if nothing depends
on them, but lead to various issues: It wasn't possible to manually
control compilation, and it lead to the library targets still being
exported, leading to configuration errors when building external
plugins.

Implement the same mechanism with BUILD_LIBRARY_* as with plugins,
giving complete control.

Change-Id: Idea3371d130593c5c2fdceee374021b6923db0c9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-11-02 19:10:05 +00:00
Eike Ziller
bf8879ee5c TextEditor: Add missing file to dev package
The public header "textdocumentlayout.h" includes "State" from
KSyntaxHighlighting, so we need to export that.
Since it doesn't have the ".h" extension, it doesn't get exported
automatically either. Add a generic function for adding such special
public header files.

Fixes: QTCREATORBUG-24413
Change-Id: I841e6d601df7e925f48eedcc2a28d6b43c00350e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-29 12:58:52 +00:00
Eike Ziller
7ae976a8b9 cmake build: Use qtc_add_resources for StudioWelcome
Avoids creating resource file if plugin is disabled.

Change-Id: Ia3e1a127c49cae4b03547367a78ca7dd8c3689f3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-10-27 12:53:54 +00:00
Eike Ziller
43facbe090 Revert "cmake build: Disable clangpchmanagerbackend and refactoringbackend"
The change breaks the dev package:

The imported target "QtCreator::clangrefactoringbackend_lib" references
the file
"/home/qt/work/build/qtc_build/lib/qtcreator/libclangrefactoringbackend_lib.a"
but this file does not exist.

This reverts commit 20a6207459.

Change-Id: I68f3b6948bde611b9e5b841d1fde2b136877cbfc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-27 08:37:26 +00:00
Eike Ziller
781d54249e cmake build: add qtc_add_resources to API
Adapted from qt6_add_resources. Takes a list of files and compiles these
into a resource file.

Change-Id: I375aa17b76e283b90bc0cbe8b6859520bcac7da3
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-27 06:45:52 +00:00
Eike Ziller
20a6207459 cmake build: Disable clangpchmanagerbackend and refactoringbackend
By default. Previously only the corresponding plugins were disabled, but
not even building the backends makes more sense.

Change-Id: I36d61869a3050f37da1f480dea89e7539dda599a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-10-26 15:34:22 +00:00
Eike Ziller
c510cf79d8 cmake build: Add option for exporting plugins
That can be used for external plugins. Just add the option "EXPORT" to
your "add_qtc_plugin(MyPlugin ...." call. Other plugins can then do
"find_package(QtCreatorMyPlugin)" and link against
"QtCreator::MyPlugin".

Supports both using a Devel install or using a build directory of the
plugin that is depended on.

Task-number: QTCREATORBUG-22803
Change-Id: I80724eca8c828d2d5be307d32f3125c4e3bd8b3a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-22 11:45:12 +00:00
Eike Ziller
067cb61c7c cmake build: Fix export name in case of branding
We must use the same name everywhere for the export name, for simplicity
stay with QtCreator, since this is not user-visible anyhow.

Change-Id: I4f51982534662d46401dad1320eec3758eed055b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-22 11:44:58 +00:00
Eike Ziller
735078cd80 CMake build: Create shared lib for shared part of qmlpuppet
Which is used by external plugins.

Change-Id: I2d700c02ff3d4b2d692486bd64ef16449deffc4e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-06 10:16:55 +00:00
Eike Ziller
c3d461d494 CMake build: Add missing PROPERTIES to add_qtc_plugin
And use it for QmlDesigner

Change-Id: Id7221ee2288159ff2faaf4ac483570034927f1b4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-06 10:16:39 +00:00
Cristian Adam
0dda86c55b CMake Build: Add option to build plugins, libraries, executables by default
You might want to build only a specific list of plugins, libraries,
or executables by opting in, instead of building all of them and opting out.

Change-Id: Ic81da380828779e409ba4192f307aa1b77a89808
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-10-01 09:51:42 +00:00
Cristian Adam
de580388bb CMake Build: Enable PCH for tests
Because the tests were missing the visibility flags, and PCH targets
that didn't have the visibility flags were skipped, tests were build
without PCH.

Change-Id: I56ddc81fadcb9e1004032a7e6096ea2c0a480a19
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-21 10:45:02 +00:00
Eike Ziller
0ceb9f487c CMake build: Check minimum Qt version
Change-Id: I81244c2480d647a2cf48885b2a125a02b11767b4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-03 12:11:34 +00:00
Alessandro Portale
2555627b25 CMake build system: Avoid duplicated include paths
Clean the paths before adding them to targets.

This prevents the code completion from showing multiple identical
entries when completing an #include.

It also removes ~2MB from build.ninja.

Task-number: QTCREATORBUG-24514
Change-Id: I19f3df400e65d8dfc4747415a8e14dae05d4b88c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-21 10:39:08 +00:00
Eike Ziller
7f44d8582b CMake build: Remove timeout for dumper tests
They take much longer, but are also optional.
Makes it possible to run via e.g. "ctest -V -R tst_debugger_dumpers"

Change-Id: I8bbda6ca36e25cd896b1f3be5d1696a27b8acc53
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2020-06-30 11:39:24 +00:00
Eike Ziller
569ad98852 CMake build: Fix library version numbers on macOS
The plugin libraries got version 0 and compatibility version 0
and libraries compatibility version 4.0.0,
which is not compatible to plugins built with qmake and the runtime
linker prevents loading.
Use the correct IDE_VERSION and IDE_VERSION_COMPAT.

Change-Id: I9a17627c5d212052df644bbc6711dc8fb8307315
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-29 06:58:46 +00:00
Eike Ziller
e2670bf3e6 CMake build: Build tests with relaxed QString casting
Like in the qmake build.

Change-Id: I216649123b4f25e5c01f2a71162fc200e0a36d85
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-12 14:30:08 +00:00
Cristian Adam
be339abb16 CMake Build: Fix unittests
Change-Id: I4214954d880d19dbe9a070d031c417dc3caf068a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-06-09 12:44:29 +00:00
Eike Ziller
8dff37f0d3 Disable ClangRefactoring by default
It is too unstable even for experimental status.

Change-Id: I38e483eaece00aec0211a81414c6c5a000bf283f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-02 13:32:14 +00:00
Eike Ziller
d5443cea77 CMake build: Unify handling of qtc_add_... arguments
Unify handling of EXPLICIT_MOC, SKIP_AUTOMOC, EXTRA_TRANSLATIONS

Change-Id: I9f5cbe9fe6b58ec527edd5e25008153455857ed8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-18 11:19:01 +00:00
Eike Ziller
d09c453ff1 CMake build: Use some more extend_qtc_target even internally
To avoid duplication.

Change-Id: Ida6c1e17a21cfdca9208e089760287ff55bae595
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-18 11:18:50 +00:00
Eike Ziller
3c535503cb CMake build: Avoid using extend_qtc_target directly
Also add a extend_qtc_test which checks if the test is known.

Change-Id: Idd3b3a02ac61fce2622cb8681233cfbd96a77bc4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-18 11:18:26 +00:00
Eike Ziller
90612d14c7 CMake build: Move internal functions from QtCreatorAPI
Change-Id: Iade7ae7533abb8b8ed0ccba8bd246b4a734794b6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-18 11:18:15 +00:00
Eike Ziller
172833bb1e CMake build: Allow files with relative paths in qtc_copy_to_builddir
Files with absolute paths still go directly into DESTINATION directory.
Follow-up of a9aa561234

Change-Id: I558616f78b3e49a8b3be4372791281f5ca9138c9
Reviewed-by: Alexis Murzeau <amubtdx@gmail.com>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-13 10:37:12 +00:00
Alexis Murzeau
a9aa561234 CMake: copy clang and resource files only if necessary
Uses a timestamp file in the build directory to detect when the input
changes using DEPENDS from add_custom_command.

Total copied files size sum up to more than 260 MB. This was copied at every
incremental build, even if nothing changed.

This leads to faster build, especially when the copied files are not
cached in RAM or when not using a SSD.

Change-Id: I3a0b691b961e1d8591068bacf40ae2467c8637cf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-11 22:36:30 +00:00
Cristian Adam
646d26b9cb CMake Build: Set BUID_WITH_PCH to OFF if CMake version less 3.16
Change-Id: I11a58cf2e67272b9d45a877dfa20c089706cfc2a
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-05-07 16:29:13 +00:00
Eike Ziller
ae080facf5 CMake build: export less generic public includes
Do not put every plugin's and lib's source folder into public includes.
We require includes of the style <somelib/foo.h> and <someplugin/bar.h>
if someone depends on somelib or someplugin.

Change-Id: I3a9f200b7c3879cf431b00a1bab4a70f7aa0a9ec
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-04-24 11:40:51 +00:00
Eike Ziller
49626f7ea9 CMake build: Fix devel package issues
Include paths and headers were missing for building a separator
Qt Quick Designer plugin.

Task-number: QTCREATORBUG-23778
Change-Id: Ib6ba96ad42a8b2b36e0ee2f0e3c51c27f3365d37
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-04-23 10:03:37 +00:00
Eike Ziller
d347aa4003 CMake build: Support QTC_PLUGIN_REVISION
Change-Id: Icc3735b9b7d0d1fa8a9e8695da3cb39275b96219
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-04-09 10:22:52 +00:00
Cristian Adam
6d169ae7aa CMake Build: Less file creating during configure
Change-Id: I263853f0a903d81a8d869bc4f5683e1a1b0078e2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-03-02 11:31:39 +00:00
Cristian Adam
82b6de6db6 CMake Build: Add qtdiag to Dependencies install target
Change-Id: If1c56ff6e366ec4d5c4bb97e4a176cf9cf8dc4c5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-26 11:56:32 +00:00
Alessandro Portale
3a29497717 CMake build: Add a qtc_glob_resources function
This is the CMake equivalent of "RESOURCES = $$files()" from qmake.

Use it in StudioWelcome for the Qml resources.

Change-Id: I2f495e2c4bad9f0bb488dee7e8966e31acb51b5a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-02-24 16:37:27 +00:00
Cristian Adam
266991740b CMake Build: Set CXX_EXTENSIONS to OFF for QtCreator plugins
This makes sure that if you have a plugin and set the
C++ standard to 14, but forget to set CXX_EXTENSIONS to OFF
you don't get weird PCH compilation failures.

Change-Id: I66edf6431624f667ba400e8ef79f2ad6170e3ca2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-19 13:59:01 +00:00