Commit Graph

169 Commits

Author SHA1 Message Date
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
Cristian Adam
873a543c6f CMake Build: Do not set suffix for qtcreatorcdbext dll
Change-Id: Id0b5692df1661fe1e20b77d1e538c01fbb974b5e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-19 10:34:08 +00:00
Cristian Adam
f580b6f9f7 CMake Build: Skip PCH for targets that do not have QT_NO_CAST_TO_ASCII
One example is perfparser_lib.

Change-Id: I63f20dcba3aedbc8fbf948d30980baf6afd8c110
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-14 11:13:57 +00:00
Cristian Adam
4610112e7f CMake Build: Exclude Dependencies component from ALL
Change-Id: Iedc69399ec2983ecd3359969bf80bdcdfafad37a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-13 11:33:52 +00:00
Eike Ziller
09894c6e0b CMake build: Fix libexec path on Linux
It's just libexec/qtcreator/ without a trailing bin/

Change-Id: I96015dc5c3bb023dabd5b64f1bb9f83bd85b4d51
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-02-13 10:37:35 +00:00
Cristian Adam
eed49de35b CMake Build: Use install component Dependencies
Fixes: QTCREATORBUG-23593
Change-Id: If9861a0ee09f2ce12ac093c2fde600a77958723a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-12 09:30:05 +00:00
Eike Ziller
0e0c0185d2 CMake build: Put wininterrupt and cdbextension into separate components
And make it possible to turn off building the cdbextension library.
So they can be installed and packaged separately

Change-Id: Ic7da1411aa3973604b897e1cbf57ad9c5b0fe460
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-02-11 09:40:19 +00:00
Cristian Adam
a5178afb61 CMake Deployment: Move creation of qt.conf to add_qtc_executable
Change-Id: Icbeed128cc99b077aad925f278aaf9534d3f9fec
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-06 18:19:50 +00:00
Cristian Adam
decb6866b9 CMake Deployment: Fix deployment / rpath handing on Linux
Change-Id: Ic8eb8665e4ac43a49ecbf07f2a92873453c9faca
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-06 17:34:01 +00:00
Cristian Adam
ba2a23834c CMake Build: Brought back GoogleTest unittest
It was removed by accident from ctest, and it was not ran on
GitHub Actions.

Change-Id: I044bc5fc96e71211982c07c8796974e97fff5737
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-31 16:08:52 +00:00
Cristian Adam
1fac0d49a2 CMake Build: Add include guards for QtCreatorAPI
Commit e8fceb821e re-includes the file,
and things go bad.

Change-Id: Ifad79824f1a64459cd01337656b1a1300f49d06b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-31 12:59:07 +00:00
Cristian Adam
b3caf501ce CMake Build: Add Dependencies install target
Change-Id: I17f8d26500a9a75bef64e23c3b64492c1bb929cc
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-30 18:03:28 +00:00
Cristian Adam
48de5294c7 CMake Build: set a 5s timeout per test
At the moment MinGW build is running for 5 hours because a test
hangs.

The test suite should finish the 2700 tests in 120 seconds.

Change-Id: I71e2e740f916bb304c91a6a3054ae097b4076543
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-28 14:18:27 +00:00
Cristian Adam
e6e0b0ca3b CMake Build: add perfparser
Change-Id: Ib16548befefbb827f2752300f9e67da3cf91570c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-28 14:18:19 +00:00
Eike Ziller
bc4fd14ee4 CMake build: Some clean up for macOS
Don't install qtcreator.sh, it cannot be used.
Don't install application into bin/ subfolder. App-bundles do not follow
the UNIX bin/, lib/, share/ convention, so don't even try. (This makes
bundling it into a 7z consistent with what we do on the other
platforms.)

Change-Id: Ib3faa2909a9b30a11193586f279528f1b8bd96fa
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-24 11:43:27 +00:00
Alessandro Portale
aac0f2a8f5 CMake build system: Fix skipping tests with unmet dependencies
Handle google tests
amends: I0eadf5

Change-Id: I02837e2e3edcb7f4d9ae07991e2e311226c37a28
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-16 18:05:55 +00:00
Alessandro Portale
048f0f63c9 CMake build system: Skip building tests with unmet dependencies
Change-Id: I0eadf5a8d2c98486d2d8aabfe835f5ab0dbc9190
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-16 17:02:46 +00:00
Cristian Adam
ec5c626d15 CMake Build: do not set .dll extension for static libraries on Windows
Change-Id: Ic0cd8958641577164e7291f103dbd571fb0024cb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-15 16:06:29 +00:00
Eike Ziller
1c37415604 Merge remote-tracking branch 'origin/4.11'
Change-Id: Ib47833b23e90c5f08b318d3d4985a4f3a450ee4b
2020-01-15 07:21:52 +01:00
Cristian Adam
91d50d4d46 CMake Build: match qmake naming scheme on Windows
Plugin4.dll and Library4.dll

Change-Id: Ifec8c04f4f0f2ee4315d31db288379fad2b41d48
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-01-14 17:36:46 +00:00
Eike Ziller
c22a840b10 CMake build: Fix version number in library file names
Make it compatible with the qmake build, with just the major version.

Change-Id: I3134b21b4775e7e83d135652dd66a51f3bdf91ab
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-14 15:39:10 +00:00
Orgad Shaneh
49f6b0146a Merge remote-tracking branch 'origin/4.11'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/mcusupport/mcusupportrunconfiguration.cpp
	src/plugins/python/pythonproject.cpp
	src/plugins/qmakeprojectmanager/qmakestep.cpp
	src/plugins/qmlprojectmanager/qmlproject.cpp
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I22507be28fd80c49c9fee0dff5937a40db176a82
2019-12-07 18:39:54 +02:00
Cristian Adam
ba31c5d554 CMake Build: do not fail to install on missing targets
The install target will install all targets that what have been built.

If some plugin is not being built (all Clang* plugins) by not having
the necesssary dependencies, it's not a failure not to have that plugin
at installation time.

Change-Id: I78b71a3fcae462d3eae7520744bfebab3f924bb4
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-12-03 15:00:37 +00:00
Eike Ziller
646c7860cb Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/genericprojectmanager/genericprojectplugin.cpp
	src/plugins/projectexplorer/environmentaspect.cpp
	src/plugins/projectexplorer/environmentaspect.h
	src/plugins/projectexplorer/environmentaspectwidget.cpp

Change-Id: Id21d62cf14419febd1e06c9b429fcdf4501c0eaf
2019-11-11 12:58:11 +01:00
Cristian Adam
eebf36adc7 CMake: Make sure that explicit plugin.h files depend on the json file
ClangCodeModel plugin was not updating its version number because of
the EXPLICIT_MOC call.

Change-Id: I109d80c93d8af628c8981d49c93dcb0ebe21f1ee
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-11-07 14:15:46 +00:00
Eike Ziller
4843216192 macOS: Fix execution of helper executables with UI
The qt.conf that is written into the Resources/ folder
is used for the main Qt Creator executable, so that cannot
be used for the helper executables.

Move the executables one more level down and add a separate qt.conf
for them.

Fixes: QTCREATORBUG-23120
Change-Id: Icd8842d246a1bc0e8d44656e2bc580d6698afbda
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-11-05 12:31:40 +00:00
Cristian Adam
6c25049019 Windows: Remove explicit usage of _WIN32_WINNT and WINVER macros
The are set in a central place, in the precompile header file.
Or as DEFAULT_DEFINES when the precompile header file is not used.

Change-Id: Ie020f916b64eabcd5a8153f4be5474986f5afed5
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-10-31 11:45:20 +00:00
Tobias Hunger
b128d498b2 CMake Buildsystem: Enable visibility settings for binaries
This should not matter, but makes the add_qtc_executable targets
match up with the PCH, so that they should build a bit faster.

Change-Id: Ibecaaf7fd98d5b927d52e4956b1bea4a5775afba
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-10-21 11:20:14 +00:00