Commit Graph

38 Commits

Author SHA1 Message Date
hjk
dbdd6a0701 CMake: Pass CMakeBuildConfig to the settings widget
... instead of the build system. Less indirections overall.

Change-Id: I59b2fd4508b24a72357426439cac7fbd563e05bf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-07-10 11:50:10 +00:00
Cristian Adam
10bbc7ce33 CMakePM: Add QTC_RUN environment variable for the CMake run
This way one can do certain things knowing that CMake is being run in Qt
Creator.

Change-Id: If3ac8a52f30f9fa73a756212199a25632c757dcd
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2023-02-21 10:08:48 +00:00
Cristian Adam
a6ccfb09e5 CMakePM: Copy auto package-manager to ${buildDir}/.qtc/ directory
By copying the ${IDE:ResourcePath}/package-manager to
${buildDir}/.qtc/ the problem with hardcoding paths
to old an Qt Creator version can no longer occur.

This also fixes the issue with remote projects by reffering
to the code residing on the host.

With the above issues fixed, enable "Package manager auto setup"
by default.

Change-Id: Ia49654a3b9059f83886e64d065019b2d55e9299c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-02-08 16:17:49 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
hjk
ab4c9b9679 CMake: Move to Tr::tr
Change-Id: I169da93b5184351cb915d4c198fd33318fcfe06f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-30 06:56:21 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Cristian Adam
d86d278044 CMakePM: Add configure environment widget
CMakePresets have the concept of modifying the configure process
environment variables.

Qt Creator had only one "build environment".

Change-Id: I131d54971b4bf7e5f87e680f817f93868d62ab29
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-08-16 18:56:36 +00:00
Cristian Adam
8d99df9a7c CMakePM: remove unused headers, enforce sorting of headers
Used clangd hints.

Change-Id: Iade4de67c1d2e5fdd1a880c5603b31203170ebbe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-11 08:43:09 +00:00
Eike Ziller
65e043961e CMake: Fix missing path to ninja for ExternalProject_Add
ExternalProject_Add runs CMake not during the CMake run of the toplevel
project, but instead it runs CMake for the external project during the
build step. And while ExternalProject passes the CMAKE_COMMAND on to the
external project, it does not do so for the CMAKE_MAKE_PROGRAM.

Make sure that the make program is also found when configuring the
external project during the build step, by adding the path to ninja to
the build environment, instead of just the CMake process.

Fixes: QTCREATORBUG-27495
Change-Id: I672ec04881387a7411836ab94655176b7a5fb681
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-06-17 07:31:01 +00:00
hjk
cc4c12b281 CMake: Drop some unneeded includes
Change-Id: I212d518e47529ff0cacdd968c1d09a7f0970c8d4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-06-16 06:19:11 +00:00
hjk
ebf3144f22 CMake: Shift remaining data to buildsystem
Change-Id: I04518a21ce571399c89608d2e59e746f8e6e0d4a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-05-05 12:10:28 +00:00
hjk
ac488e0529 CMake: Pass BuildSystem instead of BuildConfig to BuildDirParams
Less indirections.

Change-Id: I33ae36aa32aa8fab7223822fd9ec80c64d6d4651
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-02 13:10:33 +00:00
Cristian Adam
a0836a29c7 CMakePM: Refactor "Initial Parameters" as a tab bar item
Now we have "Initial Configuration" and "Current Configuration"
as tab bar buttons.

This way the UI can be shared between the two configuration states.

Task-number: QTCREATORBUG-26869
Change-Id: I8206032a2a5ac076629865057816edb99706f2ff
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-01-17 15:23:19 +00:00
hjk
652b9844e6 Utils: FilePathify Environment::{ap,pre}pendOrSetPath etc
Change-Id: Idfa5ec247337570936b0236cab9d3a5669792ca0
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-11-10 07:26:31 +00:00
hjk
a05414adf6 CMake: Fix remote search of non-standard ninja installations
Change-Id: I9ec636b126b621bb7a676e55a31845328c9e5ba1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-21 06:17:39 +00:00
hjk
341132dd0a CMake: Code cosmetics
- use newer approach to settings page layout building
- no SHOUTING enums
- namespaces
- proper dialog parent for message

Change-Id: I7adfb7487d502b8fd706c4a0c5645f4d2153e39c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-30 08:57:31 +00:00
Cristian Adam
637d45c66a CMakePM: Make "Build type" aspect visible
For single configuration projects if you change the build type
aspect you will change the CMAKE_BUILD_TYPE variable.

When switching the build directory the existing CMAKE_BUILD_TYPE
will be set as build type aspect.

Fixes: QTCREATORBUG-25451
Change-Id: I13519e95c316c556cc1348fba6121637d2fd4275
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-19 13:38:18 +00:00
Cristian Adam
fc411cd0d1 CMakeProjectManager: Make backup of CMake configuration before starting CMake
CMake's fileapi functionality will save the project structure in json
files in the .cmake/api/v1/reply directory.

When issuing a cmake command with -D variables CMake will update its
CMakeCache.txt file even if cmake will fail.

This commit will rename .cmake/api/v1/reply as .cmake/api/v1/reply.prev
and make a copy of CMakeCache.txt before starting CMake, and if
something fails, replace the existing files with the previous values.

Also make sure the changed values are not dissappearing when the
old .cmake/api/v1/reply gets parsed.

Fixes: QTCREATORBUG-24593
Change-Id: I82141786fea7068699e0f761a8978ba1f3203e47
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-18 13:21:11 +00:00
Eike Ziller
9bd8dc41d2 Add signing options to CMake/iOS build configuration
Adds the signing settings to iOS configurations.
Adds placeholders for signing flags to the initial CMake arguments, and
updates the CMake configuration when signing settings change.

The new configuration doesn't get automatically applied. Only the "Apply
Configuration Changes" button gets enabled and the user has to press
that explicitly. This seems to be a more general issue affecting the QML
debugging setting too, though.

Task-number: QTCREATORBUG-23574
Change-Id: I3e8d45f565347e1ad2ac274a21b1552f1510e8f4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-02-16 14:04:08 +00:00
Cristian Adam
6cbdae8070 CMakeProjectManager: Support for multi-config generators
CMake has multi-config generators like:

  * Visual Studio
  * Xcode
  * Ninja Multi-Config

The first two have different special targets for "all", "install",
"package", "test" namely: "ALL_BUILD", "INSTALL", "PACKAGE",
"RUN_TESTS".

All of them need to get the build type passed via "--config <build-
type>" and not via "CMAKE_BUILD_TYPE".

The multi-config generators will use only one build directory.

Fixes: QTCREATORBUG-24984
Change-Id: I8aa7ff73ce2af1e163b21a6504d26fcf95530edf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-21 09:31:30 +00:00
Cristian Adam
707a3cfaf3 CMakeProjectManager: Use CMAKE_HOME_DIRECTORY as source directory
The CMakeCache.txt file has CMAKE_HOME_DIRECTORY pointing to the
project source directory used to configure the project.

When importing a cmake build the CMAKE_HOME_DIRECTORY from
CMakeCache.txt might not point to the same CMakeLists.txt that was
opened as a project.

qt-cmake-standalone-test from Qt6 uses a CMake template project which
does a add_subdirectory with the test source directory, which will not
work if opened standalone.

Normally this is a user error though, so ask the user if this was
intended, before actually importing the build.

Task-number: QTBUG-88776
Change-Id: Ifdd5e1d1cb8a1ef9955d22493eba3a1a55dc689f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-08 16:25:24 +00:00
hjk
cec468d78a Utils/ProjectExplorer: Move re-usabled bits of aspects to Utils
Classes involved are BaseAspect and some derived classes,
LayoutBuilder and VariableChooser.

This is mostly mechanical, with various include/using changes
to make it compile.

Change-Id: I624a457f3555f102e541c4c71e33a9423af32250
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-23 07:44:42 +00:00
Eike Ziller
b18711da91 Merge remote-tracking branch 'origin/4.12' into 4.13
Conflicts:
	share/qtcreator/debugger/lldbbridge.py

Change-Id: Ia444f6424fb35b9a539e157afcee868161535272
2020-07-06 16:23:13 +02:00
Eike Ziller
b684d4c827 CMake: Fix handling of setting for Ninja path
When Ninja is installed via the installer, it writes the full path to
the Ninja binary into the settings.

Change-Id: I95a19c8c1afbf980c899fb1eeb8656e7e86ad4a2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-06-30 10:33:31 +00:00
Tobias Hunger
01b0d4f8f5 CMake: Remove magic configuration from CMake
Get rid of magic configuration handling in the CMakeProjectManager.

* Use CMakeCache.txt as the sole source of truth, do not keep
  a shadow copy of configuration in the .user file
* Have initial CMake arguments that are easy to edit in batch
  (Fixes: QTCREATORBUG-18179) used whenever no CMakeCache.txt
  file is in the build directory. These allow for any thing that
  can be passed to CMake on the command line.
  (Fixes: QTCREATORBUG-16296)
* Ask when changes to CMake configuration were not applied
  (Fixes: QTCREATORBUG-18504)
* Run cmake with arguments effecting its configuration only when
  the CMake settings are changed in the UI, run CMake without any
  special arguments in all other cases.
* Get rid of the confusing dialog used to keep settings in sync between
  what is in CMakeCache.txt and Creator (Fixes: QTCREATORBUG-23218)

Change-Id: I26d55be7df733f084f5691ecf7d7b4352f58b8e7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-09 16:34:00 +00:00
Tobias Hunger
5350288e45 CMake: Fix includes all over the CMake plugin
Keep internals internal, remove some unnecessary includes, add
some that should have been there.

This reduces the number of files that get rebuild when working
on CMake internals from over 1000 to about 200.

This patch also moves some code around that ended up being
in the wrong file.

Change-Id: Icd7366ac760dc85031040720418fbb16336dce9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-20 10:05:24 +00:00
Eike Ziller
fa517bd72a Fix build
Amends 13daf11d03

Change-Id: Id29430cd41d522cd5b4b8b1767b4d29a68c97dd5
Reviewed-by: hjk <hjk@qt.io>
2020-04-09 13:35:51 +00:00
Tobias Hunger
13daf11d03 CMake: Simplify BuildDirParameters
Remove some useless bool, Creator would crash if that was ever set.

Change-Id: I148cad6b6139332a6010698f075b584c87dec338
Reviewed-by: hjk <hjk@qt.io>
2020-04-09 12:22:50 +00:00
Tobias Hunger
a6dad316c2 CMake: Remove dead code from BuildDirParameters
Change-Id: Iae900ad0a3b901d2e83a2ea8eb2895b5627897fc
Reviewed-by: hjk <hjk@qt.io>
2020-04-08 07:04:13 +00:00
hjk
3f68292dbe ProjectExplorer: Introduce ToolChainKitAspect::{c,cxx}ToolChain
Special accessors to the repeatedly used C and C++ cases to denoise
and slim down user code.  Plus some code cosmetics nearby.

Change-Id: Iba4662bd4731d8c4256e658529f39d5c995691ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-19 15:59:12 +00:00
Eike Ziller
4e6142c932 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/autotest/testresultspane.cpp
	src/plugins/cmakeprojectmanager/cmaketool.cpp

Change-Id: Iade695ac9cab8bf3e3a1abd6e2c71f4a19132ac0
2019-11-21 22:18:35 +02:00
Cristian Adam
da25ac6322 CMakeProjectManager: Add ability to specify path to ninja
Task-number: QTBUG-79885
Change-Id: If0c5efc534e2fc6f0041b9407e2ae24ed671ac8a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-11-20 11:37:00 +00:00
hjk
2758682723 ProjectExplorer: Move BuildSystem owership to BuildConfiguration
... or Target.

This patch moves build system from conceptually "one per project"
to "one per target (i.e. per project-and-kit)" or "per
BuildConfigurations" for targets where the builds differ
significantly.

Building requires usually items from the kit (Qt version, compiler,
...) so a target-agnostic build is practically almost always wrong.

Moving the build system to the target also has the potential
to solve issues caused by switching targets while parsing, that
used Project::activeTarget() regularly, with potentially different
results before and after the switch.

This patch might create performance/size regressions when several
targets are set up per project as the build system implementation's
internal data are duplicated in this case.

The idea is to fix that by sharing per-project pieces again in
the project implementation once these problems occur.

Change-Id: I87f640ce418b93175b5029124eaa55f3b8721dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-19 11:05:52 +00:00
Orgad Shaneh
7a5d8f4aab CMake: Fix inconsistent copy ctor/operator=
Detected by GCC9.

Looks like inCMakeCache was left out by mistake in df62701801.

Change-Id: I231d0d3e102edb95b657aef42c3f2f2f834514a0
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2019-05-07 08:56:55 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Tobias Hunger
a1ba378d8c CMake: Do not try to use icecream for cmake configuration runs
Task-number: QTCREATORBUG-21003
Change-Id: I166fdf2e540238d9ddd8694a0a7ad65e238e3331
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-09-05 11:41:28 +00:00
Tobias Hunger
88b065db3f CMake: Do not crash when deleting cmake tools
Do not crash when the cmake tool that was used to parse the project
gets removed.

Change-Id: Ieda3ae2025dbcfb1f90d9bd01c5f0ed960756c6a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-28 12:36:33 +00:00
Tobias Hunger
02533e61cf CMake: Fix project parsing notification
This builds on top of 08677c0b01 and
fixes one more code path to go through a common entry/exit point.

Change-Id: I1d00fa9242f247028e5d3b0ef3b5fe1d3f4cb03d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-06 09:53:40 +00:00