Commit Graph

3443 Commits

Author SHA1 Message Date
Tim Jenssen
22121885fe baseqtversion: commands are FilePathes
also renamed the qmlscene* qmlRuntime*

Change-Id: Ifd522e21f5ce30aaa54060fdcebee2cd8b9463c4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-07-14 09:50:01 +00:00
hjk
a4c05f585f Docker: Move some cmake detection logic to cmake plugin
This make the code better re-usable from other places that
wish to put a cmake version into a new kit.

Change-Id: I1ef7770a7f8efa36e88b2f3862b011fecd38de98
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-14 09:41:30 +00:00
Tor Arne Vestbø
a71d725e46 Add workarounds for running under Rosetta on macOS
When Qt Creator is built as an Intel binary, and runs on
an Apple Silicon (ARM) Mac, it will be run via the Rosetta
translation layer. This means any process spawned by QtC,
including qmake, CMake, and lldb, will launch as x86_64
binaries as well.

For qmake and CMake, this affects their default choice of
build architecture, resulting in x86_64 builds of user
applications. We want to produce native arm64 apps, even
if Qt Creator itself isn't one, so we explicitly detect
the situation, and if Qt has an arm64 slice, we default
to arm64 builds.

The logic of adding CONFIG+=x86_64 to the qmake step has
been disabled, as the assumption that a single qmake run
and build will produce only a single architecture does no
longer hold. The corresponding logic in Qt was removed
in 2015 (qtbase f58e95f098c8d78a5f2db7729606126fe093cbdf).

In the case of lldb, running it as an x86_64 binary fails
to attach to the running application. We work around this
by using the 'arch' tool to explicitly launch it as an
arm64 binary. This works for debugging both arm64 and
x86_64 applications.

Change-Id: I65cc0f600223990f25c76cef18d927895e551260
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-07-13 11:18:23 +00:00
hjk
1e19786312 CMake: Simplify CMakeConfigItem::sortOperator
A simple function is faster and less code.

Change-Id: Ibea38936bb0866bb7a8f884d44551e2c4d1bf6a3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-13 08:37:53 +00:00
Eike Ziller
e895a0380b Fix lupdate issues
Some tr functions missing, some places where we need full qualification
because lupdate gets confused with namespaces.

Change-Id: Ic1d6ef3b31960dda02bc0788a255857117acdca9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-07-09 13:05:03 +00:00
Eike Ziller
e3b639047f Don't update extra compilers individually after project load
Each call of CppModelManager::updateSourceFiles detaches the current
snapshot.
The extra compilers where set up and triggered individually, and
resulted in individual updateSourceFiles calls with the single result
file of the extra compiler. For Qt Creator this would lead to 200
calls in quick succession after project load, potentially leading to a
freeze of multiple seconds.

Instead of updating the result files of the extra compilers individually
after project load, integrate the update into the regular project source
file update. So we end up with only a single call of updateSourceFiles.
For this the project updater needs to trigger the extra compilers, and
wait for all to finish as well as the regular project part update,
before
triggering the parser.

Task-number: QTCREATORBUG-25783
Change-Id: I34f6df0fc0f96bcb42ee65019bee39cf49176c1f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-05 08:16:25 +00:00
hjk
a58dd22f2d Utils: Use FilePath in TemporaryDirectory API
This helps to lower impedance in the using code.

Even though TemporaryDirectory will very likely always stay on the local
host, this is one of the entry points into path related string
manipulation
that we want to base on FilePath nowadays.

Change-Id: I302016b8d65e54df94296659a54a93935d9e4627
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-02 05:05:12 +00:00
hjk
92904480f0 Utils: Merge FileUtils::removeRecursively() into FilePath
This simplify the interface by removing a possibly wrong choice
ensures it works also on remote paths.

Change-Id: I01e198958900a91b99dcf2dbb491a593485493ba
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-02 04:57:24 +00:00
Cristian Adam
8ed5836746 Project: Remove knowsAllBuildExecutables feature
This is feature is no longer needed.

Change-Id: Ia0798402fcb4c06fb4dd38225359738306211176
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Reviewed-by: hjk <hjk@qt.io>
2021-07-01 15:49:01 +00:00
Cristian Adam
b3c83b79f7 CMakePM: Project settings widgets grouping
Group together Initial CMake Parameters and Re-Configure button.

Change-Id: Ieb7d5d65b9465f3e77f1e350bc003777817f1af2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-30 14:37:33 +00:00
Cristian Adam
2d8cd0c90c CMakePM: Update missing expandable CMake variables at project load
The following variables:
    "CMAKE_C_COMPILER",
    "CMAKE_CXX_COMPILER",
    "QT_QMAKE_EXECUTABLE",
    "QT_HOST_PATH",
    "CMAKE_PREFIX_PATH",
    "CMAKE_FIND_ROOT_PATH",
    "CMAKE_PROJECT_INCLUDE_BEFORE",
    "CMAKE_TOOLCHAIN_FILE"

will be checked to see if the existing values have the same values
from the initial cmake parameters list.

Only the CMakeCache.txt values that do not exist on the file system
will be updated.

If not, the updated value will be presented in the dialog for upgrade,
or marked as bold in the settings dialog.

CMAKE_PROJECT_INCLUDE_BEFORE is dependent on Qt Creator version / path
and needs to be updated.

Fixes: QTCREATORBUG-24443
Change-Id: I1eeb44df3a7914051084ef405af5f5621cc5a4e2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-30 14:36:41 +00:00
Christian Stenger
7fd4691a7a CMakePM: Try to improve file information for ctest
The ctest information regarding the test case itself cannot be as
adequate as the information coming from the code model.
Nevertheless depending on the used mechanism we might end up in
places that will not be helpful when using the test tree to open
files of ctest. Try to get closer to the real declaration source
if we can.

Change-Id: Ia9d217f0cdc6de6230d89dd342b60856cf1312b8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-30 09:48:45 +00:00
hjk
d8bd855c02 CMake: Use FilePath::dirEntries file api parser
Change-Id: Id83284518029414721cf1a44111d8f63cae9246f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 13:16:53 +00:00
hjk
d857e17b13 CMake: Use FilePath::ensureExistingFile in file API
Change-Id: I38c2e97711bbc1c72c51eeb59429572ea7931e4d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 12:35:02 +00:00
hjk
5ead2afeeb Utils: Implement FilePath::removeRecursively
Sprinkle a few QTC_ASSERT to make sure we are in a known
context.

Cmake's FileApiReader uses this before moving directories
as QFile::rename does not do anything if the target exists.

Change-Id: I555f99e81a9fe7d93ae66145eeebfa9d5880bc51
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-29 09:34:28 +00:00
hjk
24190d9c0b CMake: Use local paths with file system watcher
Change-Id: I6eb831255f90b56115a5c5d79175a8985052ff83
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-29 08:58:25 +00:00
Cristian Adam
2d08b296b7 CMakePM: Remove wishlist comment
The comment is no longer valid.

Change-Id: Ica19e26039e147ccdd77559cc85bfcb5e784b68c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-28 17:45:13 +00:00
hjk
54b4022987 Utils: Implement FilePath::rename()
And uses it in CMake's fileapi reader.

Change-Id: I9e719aa4b253eaca17c6b304eab5e7268fcfab29
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-28 13:03:32 +00:00
Assam Boudjelthia
cd20ad8ff4 Revert "Android: add prepare_apk_dir CMake target by default"
This reverts commit 9dcbb8ca01.

Reason for revert: This workaround is not needed anymore, since
Qt 6.1.2 (see 71348437939e62b0e3b86888e966b300ff1e2855).

Change-Id: I089457dc58c5b97136b30190fdf17cfb303f8bd8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-28 10:29:10 +00:00
Cristian Adam
3340fa88e4 CMakePM: Proper restore user saved CMake tools changes
If you had an auto detected CMake tool from the sdk you would
not be able to change the "Autorun CMake" state from ON to OFF
because the sdk value would always be used instead of the
user one.

Fixes: QTCREATORBUG-25911
Change-Id: Ibe3b393a2b9e4d397251018fda8a9508ad096791
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-28 08:07:42 +00:00
Cristian Adam
fc493c3fcb CMakePM: Resolve paths to build directories
With the default build directory template the CMake build directories
will be displayed as project-source/../build-project-name-kit-build-type
which can be irritating.

With this commit the build directory will contain the resolved path.

Change-Id: I968260caba5b9a47e1bda4eeaea386a04fe817b1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-28 08:07:20 +00:00
Cristian Adam
20366297ed CMakePM: Keep always created run configurations up to date
Qt Creator will do an update of run configurations after a project
configuration.

If an always created target was no longer existing, it shouldn't be
part of the run configuration.

For some reason this was not the case for CMake projects.

With this patchset if a target's name is changed, the previous target
name is no longer part of the run configuration.

Fixes: QTCREATORBUG-25906
Fixes: QTCREATORBUG-24914
Change-Id: I086a2540eaad9039e41fb48194d5901c7be22be8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-28 08:07:06 +00:00
Eike Ziller
2e09518e9c Pass the new node in ProjectTree::currentNodeChanged
Avoids some roundtrips asking for ProjectTree::currentNode()
which traverses the project tree every time.

Change-Id: I650728eab5a47a7f4760cf88844a4b7106365255
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-28 06:55:51 +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
hjk
6d26f4f5b0 CMake: Allow autodetected tools to associate themselves with kits
Change-Id: I5b48ddf36ba1b9c4eb6476017be63c4d43b60627
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-25 13:57:36 +00:00
Christian Kandeler
b1837036b3 Fix some warnings about unused lambda captures
Change-Id: Icfb1b963b3c55656c760497e4ae3ece2bdccbbc7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-24 12:07:31 +00:00
Eike Ziller
8f30ff6987 CMake: Show build directory when asking if it should be used
When changing the build directory to a new or empty directory, we ask if
the build directory should be changed and the project be configured
there. Mention the new directory in the dialog.

Change-Id: Ie4d7e9b132e6e90004e4d498b2182562375e7441
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-24 11:58:52 +00:00
Christian Kandeler
c6a4cd293b CMake: Fix initializer re-ordering warning
Change-Id: Iffcc4eb562a06ff12d641d23687dc4c44c797ce8
Reviewed-by: hjk <hjk@qt.io>
2021-06-24 10:35:59 +00:00
Wojciech Smigaj
194569b471 ProjectTree: Add an option to hide Source and Headers file groups
A new checkbox "Show Source and Header Groups" is added to
the filter menu in the project tree. It is checked by default.

Unchecking it removes the extra level of virtual folders containing
sources and headers.

Change-Id: I25f4514e7f1f6cdfcb531a911e54cc6e7e42a3e2
Fixes: QTCREATORBUG-25313
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-24 05:24:26 +00:00
Eike Ziller
0bcab32657 Avoid expanding QRC nodes in main thread
For CMake and Qbs projects and users of TreeScanner, where the tree is
already created in a separate thread.

Expanding the QRC nodes means reading and parsing the QRC files, which
can take up a considerable time (second(s)) if there are hundreds of
them in a larger project like Qt Creator.

Task-number: QTCREATORBUG-25783
Change-Id: I5ca818b9f75ea6e8ef23f837cc9e15df7e6630e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-23 14:27:44 +00:00
Eike Ziller
9109a6895e CMake: Do not create file system node in main thread
The file system scanning was already in a thread, but creating a tree
from the flat list of file nodes was still done in the main thread.
Creating the tree looks for and creates folder nodes as needed for each
file node, which is not that big of a deal but still takes 1/3 of a
second for the Qt Creator source tree.

Task-number: QTCREATORBUG-25783
Change-Id: I28948ed3ff5233f6fc4b86e93da94d882b81e231
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-23 14:25:08 +00:00
Eike Ziller
1d600101ee CMake: Apply build directory change on editingFinished
Otherwise every time a character is typed, a dialog pops up, and that
dialog is closed without triggering a cmake run, the value is reset.

Add that behavior optionally to StringAspect.

Change-Id: I6831d1622f08acae6df43d4ceb2bf7367c96a747
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-23 12:05:45 +00:00
hjk
430e81facd All: Replace most SynchronousProcess by QtcProcess
Change-Id: I0bf22fef2cd4a7297ef5a1e9aa9c3e2b9348ba42
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 07:55:31 +00:00
hjk
953ea730b8 Utils: Merge QtcProcess and SynchronousProcess
Keep SynchronousProcess as type alias for a transition period.

Change-Id: I2540b6cecc17eb46f40ed57d27589011693728f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 06:31:57 +00:00
hjk
60ab92ec1b CMake: Use line based QtcProcess callbacks in CMakeProcess
This also fixes a potential issue where contents in the local
'rest' strings outlive the process and get part of the next run.

Change-Id: Ia9272bff80213084e430436d677183b4faabd250
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-22 08:57:42 +00:00
hjk
6d688f3199 CMake: Display cmake version on the cmake settings page
Mostly for informational purposes. Helpful e.g. to check whether
an auto-detected cmake binary from a docker device matches
expectations.

Change-Id: I546b0ab6edc240cc779bbf0560e00165cb524fcb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-21 16:21:47 +00:00
hjk
d3994dd903 CMake: Use local path names in android build parameters
This is directly passed to cmake and used in the context of the build device.

Change-Id: If22764b0d962f96b51897b754b413c2310818c33
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-21 10:29:19 +00:00
Eike Ziller
905f5d4e1b Merge remote-tracking branch 'origin/4.15'
Conflicts:
	coin/instructions/common_environment.yaml

Change-Id: I2084c24f7e052b9647b30f810207b3c8beecce3c
2021-06-16 11:48:08 +02:00
hjk
cf8a05fbec CMake: Use FilePath in FileApi{Reader,Parser}
Helps docker.

Change-Id: I2e1eba61be983340260211bbee6c1bab8a59f883
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-16 07:21:08 +00:00
Eike Ziller
fa6490efbc CMake: Avoid iterating project tree for each build target
Reduces lock-up in main thread after loading projects

Task-number: QTCREATORBUG-25783
Change-Id: Ie769074f1689698379bd6fd60f74957086cfce37
Reviewed-by: hjk <hjk@qt.io>
2021-06-15 13:51:04 +00:00
hjk
fe7d6f0def Utils: Drop QProcess specific parameters from QtcProcess::finished()
Mid-term plan is to concentrate on use of QtcProcess::result()
instead which is a bit more system-agnostic.

There's quite a bit of potential for downstream cleanup by
re-using QtcProcess::exitMessage() now.

Change-Id: I3806b3f5933d96e64b7cfb18cc6c52823fddcbcd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-14 13:31:05 +00:00
hjk
e35235ea72 CMake: Collect also remote filenames from generateBuildTargets()
QDir::cleanPath(...) doesn't do the right thing on stringified
Utils::FilePaths. Use FilePath functions instead.

Change-Id: Ied66f38dd30a15694bce12ed57d37411bb87f680
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-14 08:43:45 +00:00
Eike Ziller
2f7f645983 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ibd07b5b5ff7c3282134b062ed28b1c4951061c97
2021-06-11 14:20:21 +02:00
Christian Stenger
9542ccd14e CMakePM: Raise timeout for ctest run
Depending on the size of projects and the underlying toolchain we
may end up with no tests as the timeout for the ctest run was just
too small.

Fixes: QTCREATORBUG-25851
Change-Id: I5617987a9e43b16c02a2c0b4afd598a3ff909299
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-11 09:52:53 +00:00
Christian Stenger
caf515929b CMakePM: Widen ctest detection
If tests are not set up using add_test() but are supported
by ctest due to a different registering mechanism we failed
to get these right.
Expect also tests configured differently and just omit the
respective file information.

Fixes: QTCREATORBUG-25847
Change-Id: I16fcbec1a3a262f7d77ffdf15e4114e5a15e3757
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-11 08:29:08 +00:00
Cristian Adam
7a074608b6 CMakePM: Do not emit error signal in destructor while project is parsed
Do not emit error occurred in the fileapireader destructor
if it's parsing. This will cause the fallback file system view
tree to be generated just before the parsing will be stopped.

This can lead to crashes.

Task-number: QTCREATORBUG-25837
Change-Id: Ic7a2dfc394ed8e259da3366727a3c5fa65d98776
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-06-10 14:29:09 +00:00
hjk
eed82176b2 CMake: Listen to BuildSystem::parsingFinished, not Target::parsingFinished
There's a 1:1 relationship between CMakeBuildConfigurations and
CMakeBuildSystem objects. No need to react in one
CMakeBuildConfiguration to the signals of someone elses buddy.

Change-Id: I53f7d02d8852a85b9530bd55d8e059916a22579c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-06-10 14:03:49 +00:00
Cristian Adam
26e856254c CMakePM: Allow copy / editing of build directory
This reverts 69b0a2cafc

The build directory is preset and by having the ability to edit, you can
easily do a new build by appending a number.

When you have a new build directory a dialog will warn you that you'll
start from scratch. This is enough of a hinderniss to the user to start
typing and get lots of build directories. No need to have it read only.

Fixes: QTCREATORBUG-24451
Change-Id: Id1bc77d0fbcb071608f5ac83ddd6b8af943fdac5
Reviewed-by: hjk <hjk@qt.io>
2021-06-10 13:42:29 +00:00
Cristian Adam
0e613918b6 CMakePM: Always create build directories
Having two configurations for a project, one in /tmp and one in the
right build directory is confusing and for big projects can take some
time.

Fixes: QTCREATORBUG-25532
Change-Id: Ib0dad267117b3c025d668646ef076b0f77bff166
Reviewed-by: hjk <hjk@qt.io>
2021-06-10 13:42:14 +00:00
Cristian Adam
4c699d5181 CMakePM: Enable extra compilers only for files in the project
Qt Creator 4.15 added the "<File System>" project node containing all
the files in the source directory.

Qt Creator for its "find extra compilers" step needs only the files
from the project and not all the files in the system.

Task-number: QTCREATORBUG-25783
Change-Id: I5d33d5296f67ab3f321c232e5071f32e56d29101
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-09 15:03:42 +00:00