Commit Graph

120 Commits

Author SHA1 Message Date
Eike Ziller
0b7cd967a2 CMake build: Fix pdb file names (Windows)
They should have the same base name as the DLL/.lib, but were missing
the version number.

Fixes: QTCREATORBUG-25968
Change-Id: I30e39a62b94264bd5a4852f0b1100044fa47d811
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-08-10 12:23:16 +00:00
Eike Ziller
dbb5ab932c CMake build: Don't re-link libraries unnecessarily
If a library changes its implementation only, don't relink all
libraries that depend on it. This is usually not necessary since the
API stayed the same.

Fixes: QTCREATORBUG-25962
Change-Id: I0221b09afd92463c3dad40bd0107ba0d5668ac79
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-07-05 13:23:01 +00:00
Cristian Adam
f8a77287bf CMakePM: Add support for qtc_runnable feature
This will allow for the Qt Creator's CMake build only qtcreator
target to be selected as runnable.

Similar to qmake's qtc_runnable or Qbs's qtcRunnable features.

Fixes: QTCREATORBUG-25908
Change-Id: I6416873d0ad9cfec4960d98fc4b289ec98cc58b1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-25 14:24:41 +00:00
Eike Ziller
6bc9cddb9e Merge remote-tracking branch 'origin/4.15' into 5.0
Conflicts:
	src/plugins/cmakeprojectmanager/projecttreehelper.cpp
	src/plugins/coreplugin/mainwindow.cpp

Change-Id: Ie3a281b8635e79ca5fa794a127ed0039f33fe2ee
2021-06-24 10:43:10 +02:00
Eike Ziller
4290c26414 CMake build: Force optimization of CPlusPlus lib
Even in the debug build, as done for the qmake build system. This is for
performance optimization of this critical part for C++ parsing even in
debug / developer builds.

Change-Id: I9552ba9fc44e213f2df1d2d2a64a126af3603fd1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-22 10:10:14 +00:00
Cristian Adam
aef432ec13 CMake: Add BUILD_TESTS CMake variable to filter tests to build
This allows building one test: -DBUILD_TESTS=tst_my_test, this will set
BUILD_TESTS_BY_DEFAULT to OFF (default value is ON) and set
BUILD_TEST_TST_MY_TEST to ON.

Change-Id: I7800f3d238121725bb9fa4146f76ddcd2b10bde9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-11 13:40:24 +00:00
Eike Ziller
dcfc467959 Revert "CMakePM: Filter test also by BUILD_EXECUTABLES list"
This reverts commit 99396421de.

The patch does not solve the use case (building Qt Creator without
tests and then only building individual tests), and has lots of
side effects like tests landing in the application bundle on macOS
and in bin on Windows, and tests being installed.

Change-Id: I593627b55577e13a3d2cf1758deac99efa521954
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-11 11:49:08 +00:00
Cristian Adam
99396421de CMakePM: Filter test also by BUILD_EXECUTABLES list
This way one can build only one test.

Change-Id: Iebf9686108988793193106ebed312f7e86ee2e61
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-10 16:47:44 +00:00
Eike Ziller
8650e42be8 Merge remote-tracking branch 'origin/4.15'
Change-Id: I07ac7113947cae2e7c3e51b8fa95563fe02b3dc8
2021-06-09 09:03:41 +02:00
Eike Ziller
6e9acfe08e CMake build: Add files from qtc_copy_to_builddir to tree
Make the files from qtc_copy_to_builddir part of the project tree, so
they get included in searches etc.

Change-Id: I191f88c8520b9e4a16fd6a5acfeda9cf880cea89
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-07 08:04:14 +00:00
Eike Ziller
57f889feb5 CMake build: Fix extend_qtc_test
extend_qtc_test should gracefully do nothing if the test was declared,
but disabled for any reason.

add_qtc_test failed to add the test to the list of declared tests, if
dependencies were missing, so extend_qtc_test was complaining that the
test didn't exist in that case.

add_qtc_test must always add the test to the list of declared tests, and
extend_qtc_test must only fail if the test was never declared, but do
nothing if the test target does not exist (because the test was disabled
for some reason).

Change-Id: I414a169e3e23c3c0e11c11e2ee86effa706b545c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-28 08:34:21 +00:00
Alessandro Portale
588af658ee CMake build system: Fix error message in extend_qtc_test
Print out "${target_name}"

Change-Id: I6978856bfe010cdfc934260db1a3490a1329eb6a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-05-27 21:35:14 +00:00
Eike Ziller
0b0226b112 CMake build: Gracefully handle turned off target in qtc_add_resources
Otherwise qtc_add_resources fails when turning off corresponding
BUILD_.... flags, or needs to be wrapped with "if(TARGET ...)" everywhere.

Change-Id: I34e230569ab9619b1c107404bf2fdf8e8e86bd7e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-05-26 11:24:29 +00:00
Eike Ziller
759e15dbb4 CMake build: put .lib files next to .dll files for libraries
- there is no reason for putting them elsewhere
- since CMake file-api only reports the .lib location for linked
  libraries, Qt Creator has difficulties with adding the correct
  PATH for running e.g. manual tests, when the .lib files are at
  an arbitrary location

Fixes: QTCREATORBUG-25684
Change-Id: I24b26a79c70fd5384f534f8f0b66b51fca1ecc56
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-20 10:03:11 +00:00
Eike Ziller
b66a403f36 Enhance qtc_add_resources with CONDITION
like most other functions

Amends 201786d3fc

Change-Id: Id35b9730dd6c9b55e80b99068a8ec98d30538705
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-05-11 10:02:14 +00:00
Christian Stenger
0bcb5953ed CMake: Ensure test defines are present for tools as well
Fixes the sdktool auto test.

Change-Id: I9e1779dc17a0cb79131e17182290255aed2f7d0e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-30 11:22:05 +00:00
Eike Ziller
79afbe7f14 COIN: Add hack to support debug info with sccache and MSVC
sccache does not support the "/Zi /FS" option for debug information
with MSVC. Optionally replace "/Zi" by "/Z7", which leaves debug
information in the object files and only collects it at link time.
See also qtbase 2354274f39934b94383923834479901106489def.

Change-Id: Id94c2116f3c4192556dbdf8fe82b12ce0a204273
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-26 07:01:51 +00:00
Eike Ziller
4b3a746332 CMake build: Fix remaining issues with Devel package
On Linux (and Windows) we should not create toplevel files (README.md
etc) or directories (doc/, scripts/ etc).

On macOS, move the whole Devel package contents into the app bundle,
because that is installed toplevel in the Qt installers, and we
shouldn't even create include/, lib/ or any other directory at the
toplevel at all.

Since the prefix path must now point to the Resources folder inside the
app bundle, adapt build_plugin.py to also accept --qtc-path pointing to
the app bundle (Qt Creator.app) itself, and also to the app bundles
parent directory. Adapt the Qt Creator plugin project template
similarly.

Task-number: QTCREATORBUG-25414
Fixes: QTCREATORBUG-25415
Change-Id: Ic756237fb920b54b1ec95d076649ad947b39a7e8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-06 10:59:27 +00:00
Eike Ziller
62011851ae Merge remote-tracking branch 'origin/4.14' into 4.15
Change-Id: Ie467c5d63420041a9acffeb4a726130988ec0f41
2021-03-18 09:29:51 +01:00
Eike Ziller
38ce4fb4ec CMake build: Fix issues with Devel package for qmake-based plugins
Add the pch files that qmake uses.
On Windows, the .lib files must have the major version too,
like the DLLs.

Change-Id: I437bbeac0323c5b9bc174ddea8c0d9be6497b4e6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-17 13:15:58 +00:00
Eike Ziller
30da5aafd7 CMake build/Qt6: Automatically disable build of profilers
Tracing library does not build with Qt 6. Disable that automatically
and also the plugins that depend on it. Add some feature info for
the Tracing library, though we usually do not add feature information
for libraries in general.

Change-Id: I51b6993e30ec69d63a031c7bf404ea3887e14d84
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-05 12:29:57 +00:00
Eike Ziller
a0f12f5b98 CMake build: Add version number to external plugin dlls
Fixes: QTCREATORBUG-24590
Change-Id: I01996e25af0b8ab7056c5d2012cd7951c3757ae5
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-26 18:27:26 +00:00
Eike Ziller
c55e59cb77 Merge remote-tracking branch 'origin/4.14'
Change-Id: Ib9512b4fc5e17b04ca4be79fc315e79a52d06497
2021-02-22 12:19:58 +01:00
Eike Ziller
7cb81fb5ba CMake build: Add .pri files to development package
This adds at least partial, transitional support for building
3rdparty plugins with qmake against Qt Creator built with CMake.

This might still miss some other .pri files that follow
their own naming conventions.

Fixes: QTCREATORBUG-24055
Fixes: QTCREATORBUG-25334
Change-Id: I83cc547da938976c2ec12a21a17f286b937147f7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-22 07:30:33 +00:00
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