Commit Graph

267 Commits

Author SHA1 Message Date
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
Eike Ziller
4498c12ddc Merge remote-tracking branch 'origin/4.14'
Change-Id: I790a8b9002a55f52090d085b65d9fe58b7eb1d20
2020-11-16 11:26:03 +01:00
Eike Ziller
9ff91ef0d9 cmake build: Fix building with PCHs
- fix target name
- build pchs without extensions like all other targets
- require CMake 3.10 for plugins

Amends c038abb0ab

Change-Id: I0eae58a9e7ce91c0df6103790cb91a5229d06051
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-16 10:00:58 +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
Cristian Adam
c038abb0ab CMake Build: Fix problems with PCH and super repo
Make sure that every project will have its own precompile headers
sets.

This fixes problems with MSVC.

Change-Id: I37d58c9652f679545283907e7cad70cd579911a8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-13 18:48:18 +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
Orgad Shaneh
d0df1527a6 yaml-cpp: Fix/suppress MSVC warnings
* C4251: 'YAML::Binary::m_data': class 'std::vector<unsigned char,std::allocator<unsigned char>>'
  needs to have dll-interface to be used by clients of class 'YAML::Binary'
* C4275: non dll-interface class 'std::runtime_error' used as base for
  dll-interface class 'YAML::Exception'
* STL4015: The std::iterator class template (used as a base class to provide
  typedefs) is deprecated in C++17.

Change-Id: I37e32df84ee2d2946181aad790dabd0c3ed58c08
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-12 14:01:10 +00:00
Eike Ziller
c92adb199e cmake build: Map generic IMPORTED_LOCATION for Qt6 tools
There once was a time where the Qt6 build only set
IMPORTED_LOCATION_<CONFIG> but nowadays it also sets
IMPORTED_LOCATION. Use the latter to make it work with both debug
and release builds of Qt6.

Change-Id: Ic8b14209cb97b47eb6136e23390045e115a12ac0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-11 15:34:43 +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
743877730b cmake build: Fix branding
The cmake build used IDE_ID in too many paths that are actually
not branded (yet?).

Change-Id: I019dd806975ef2205aa946bc3b27b0675233e1ea
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-09 11:04:50 +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
eeb9856064 cmake build: Fix disabling of documentation targets
Change-Id: I8827dcc38c908ef9e19b9a59bb9559d29b0ff77e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-05 07:27:21 +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
c135f4a253 cmake build: Fix documentation generation with Qt6
qhelpgenerator moved to a separate package "Tools" which doesn't exist in Qt5.

Task-number: QTCREATORBUG-24098
Change-Id: If7d0d638d6cee27f9154141ca415fb412745d1ee
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-11-02 07:09:40 +00:00
Eike Ziller
acd2aaa0f0 cmake build: Add missing rcc alias for Qt6
Change-Id: I353ded95f8ee8fd263d7a9f830cdcf662a250bd1
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-30 09:20:19 +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
d5d5068009 Bump version to 4.14 beta2
Change-Id: Ife5666e272697da19e1ba1a96d93281943deb37e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-29 10:24:08 +00:00
Eike Ziller
240fba0222 cmake build: Allow branding to change documentation file
Task-number: QTCREATORBUG-22488
Change-Id: I80a1feafa7b027dc99acdb019359037ae0259573
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-28 08:53:23 +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
Cristian Adam
3c4f7967e3 CMake Build: Allow building unittests when targets are missing
when configuring a minimal build make sure that when querying
for target properties like SOURCE_DIR the target actually exists.

Change-Id: Ib754b79be6461e3ddd4cdeb1abac123cf4535068
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-20 14:12:54 +00:00
Cristian Adam
d7e24f28ba CMake Build: Fix missing pythonXY.zip on MSVC
Ammends 94b9b33a17

Change-Id: I531a648a108233fbefbe6878f65f8ab7186db39a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-10-19 09:45:04 +00:00
Cristian Adam
b9cd1cc15e CMake Build: Fix PCH builds for non MSVC platforms
Ammends 2129a04c5d

Change-Id: I50fc1bf2e5ef4742243aa08a4e5ad2bfee459eb1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-10-08 10:26:21 +00:00
Cristian Adam
2129a04c5d CMake Build: Fix MSVC PCH build
Ammends 735078cd80

Change-Id: I01296641ca0681d4fef376087368e247dce011f8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-07 11:52:00 +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
94008aa71e CMake: Fix compilation error when QmlPlugin is not built
Ammends 6fe11f80d6

Change-Id: Ifa909d8e2946c4fdd8e2a5301bab2686a615d89a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-09-25 10:00:47 +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
Orgad Shaneh
1c53cff4fa CMake build: Fix unittest linkage
GoogleTest depends on pthread.

Change-Id: I2ed93257a7c8fa73d47d51a3a0a4c25b2fb88dae
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-11 13:07:39 +00:00
Eike Ziller
102d8d48db CMake build: Make Qt6::Core5Compat available in a portable way
While porting to Qt6 we'll need the compat library at some places.
Add a custom Qt6Core5Compat target that we can unconditionally use.
For Qt5 it refers to a dummy target.
For Qt6 it refers to the actual compat library.

Task-number: QTCREATORBUG-24098
Change-Id: Idd2b9f285352f685cfe715eee3fa046dfb468873
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-07 10:13:39 +00:00
Eike Ziller
43ee53c233 CMake build: Qt6 build fixes
Set Qt5_VERSION for version checks (e.g. currently still JavaScript
locator filter).

Export special FindQt5.cmake for external plugins and super-repo builds.

Change-Id: I5edb8b0e8bef1a341cd2ff04a13d0a6ce22f6558
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-04 07:41:57 +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
Eike Ziller
6cff79d377 CMake build: Support building clang tooling without static libs
Create a FindClang.cmake and move all Clang configuration there.
Find Clang and choose static libraries if available, otherwise use
clang-cpp if available.
Add option to link to clang-cpp even if static libraries are available.

Fixes: QTCREATORBUG-23172
Change-Id: If40304d174469df0c786259e724cbee8de0e2d0e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-09-03 10:03:45 +00:00
Eike Ziller
00ced26f47 Merge remote-tracking branch 'origin/4.13' into master
Change-Id: Ib60df85a85fc1c94d8cc0dc23ea9fcdb4822bcab
2020-08-25 12:42:04 +02: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
Cristian Adam
d6c3846ab1 CMake Build: Add Google Testing 1.10.x as submodule
Fixes: QTCREATORBUG-24510
Change-Id: I763d72524f2e581671e18bcd9cda42d5bf7bccdf
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-08-19 15:50:37 +00:00
Eike Ziller
e9f74df8cf Bump version to 4.13.0
Change-Id: Id1d2ebca1c2bca86683a3172bfe2f95123e1b897
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-14 10:06:21 +00:00
Tobias Hunger
2eb9e12b5d CMake: Use Qt5::DesignerComponents
QTBUG-75867 about missing Qt5::DesignerComponents support has been
fixed, so use that over our own hand-rolled version.

Change-Id: I6d8bb7f7d5359050f20a095adb4a074f143e8d49
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-10 14:52:01 +00:00
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02:00
Orgad Shaneh
bafc8381c6 CMake: Replace QT_USE_FAST_{OPERATOR_PLUS,CONCATENTION} by QT_USE_QSTRINGBUILDER
Missed in commit 52b2ca55c9

Change-Id: I1f1862e5ad8fd5a29c3e0a56adbc7960e538f441
Reviewed-by: hjk <hjk@qt.io>
2020-08-10 02:57:48 +00:00
Eike Ziller
9dd28206cd Bump version to 4.13.0-rc1
Change-Id: Icc4b98903a16d05d978ad27c2aeffac8dbf22227
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-07-27 08:40:11 +00:00