This way the CMake Project Manager will behave in the same way as QMake
Project Manager!
Change-Id: I3c4bd6b2f4f0f5d4dfc73edb2049d6e251154d54
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Amends 76dcc069d6
As a user I expect that the "Forms" and "State charts" source groups
should go away if I select the filter "Hide Source and Header Groups" in
Projects view.
They are not meant to be user defined source groups.
Change-Id: I17db9eb7e1da17b93a45f6093782add19c2b5cb1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
All CMakeLists.txt from the Project view are marked as generated, except
the root one. This means that in normal case they will be hidden.
Every CMake Target (except Utility) will get a CMakeLists.txt:<number>
entry with the definition line of the target.
The CMake Folders will get an entry with the CMakeLists.txt which can be
accessed via context menu and "Open...".
The CMake Folder that only had a CMakeLists.txt will be removed when the
filter "Hide Empty Directories" is checked. This for example makes a
reduced plugin Qt Creator only display the enabled plugins, and not all
plugins!
With this change the "Simplify Tree" view will no longer have many
CMakeLists.txt entries, which makes the view more useful.
Fixes: QTCREATORBUG-31362
Change-Id: I708171e4b114100fae6fb592044a19fc36239261
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
In Projects view you can right click on a CMake target and select
"Open...", in the context menu you will have a stack of functions that
were used in the creation of the target.
If you are using a custom CMake API you would want the highlevel
function on top, and not on bottom.
Task-number: QTCREATORBUG-31362
Change-Id: I42e436d99f6c5f7a8d1cd67da84a6087bc18e8cd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
"loop variable ‘var’ of type ‘const QByteArray&’ binds to a temporary
constructed from type ‘const char* const’ [-Wrange-loop-construct]"
Change-Id: I663dcb0c990ee125be9b90640e2925014f7166d1
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This will result in "Project View" the "CMake Modules" folder to be
hidden if it only contains CMake files from CMAKE_PREFIX_PATH or
CMAKE_FIND_ROOT_PATH.
Users of QtQuick or Qt Widgets applications will no longer have to see
the "CMake Modules" with "<Other Locations>" and the paths to the Qt
CMake files.
This way the CMake projects will resmble the QMake projects.
Change-Id: Icde9a556be5bceccdb4abb11072fbd17b59dce4d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Amends 6c5717844d
The CMakeBuildSystem::clearCMakeCache() would call
BuildSystem::emitParsingFinished which would clear the configuration in
the widget, effectively removing any "Initial Configuration" changes when
clicking on the "Re-configure with Initial Parameters" button.
This commit makes sure that the updateInitialCMakeArguments() function
is called before CMakeBuildSystem::clearCMakeCache(), and that only the
"Build > Clear CMake Configuration" action would
"disableCMakeBuildMenuActions" which is what an user would expect.
Fixes: QTCREATORBUG-31320
Change-Id: Ie7810c9bed000ca19a31a6ab8e7a281ae9f5e6f0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Previously only backslashes were taken into consideration. Now also
slashes, since CMake supports them for Xcode and Visual Studio
generators.
Fixes: QTCREATORBUG-31305
Change-Id: I096540769ee53ce7c30c0543d1bd250f098ac19c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Do not set CMAKE_OSX_ARCHITECTURES, the defaults are fine.
It builds for x86_64 for Qt/Simulator/x86_64 and for arm64 for Qt/
Device/arm64 automatically, and then also for custom Qt/Simulator/arm64
builds that didn't work before because we enforced x86_64 for Simulator.
Task-number: QTBUG-101276
Change-Id: Ic33eab6d418210ad6384951e0b0f1972a2287a6b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Remove code that was added to handle the case of Qt Creator running as
an Intel binary on ARM Macs, which required some passing of flags to
qmake/CMake/LLDB.
Nowadays, Qt Creator can be built for the corresponding architecture
(and by default we provide universal binaries).
Partially reverts a71d725e46
Change-Id: I842f85b85a26d09cff72199ae86c602fd8f14e33
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It has some platform specific warts, filepath.h is somewhat
cheaper and less ugly overall.
Partially clean up surroundings
Change-Id: Ida1fd470ec020f69c446109427f92a08e879789f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
See the CMake documentation https://cmake.org/cmake/help/latest/
prop_tgt/FOLDER.html
This allows placement of targets in the project view in specific folders
like e.g. "tests"
Qt Creator (ab)uses the FOLDER property for the "qtc_runnable" feature,
see https://doc.qt.io/qtcreator/creator-run-settings.html
which would not allow to have both.
The "qtc_runnable" should be fixed by having a property "QTC_RUNNABLE"
for a target and have Qt Creator parse the code.
Fixes: QTCREATORBUG-28873
Change-Id: I73433de78b9a86f631ee9d7903db535b69b734f6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Amends baf20b8491
which removed the inheritance from the contextHelp method.
CMakeEditor now registers a context help function, which called
BaseTextEditor::contextHelp if no documentation was found, which was
correct when contextHelp was still virtual. Now
BaseTextEditor::contextHelp is the same as IContext::contextHelp which
calls the function that CMakeEditor registered again, leading to endless
recursion.
Change-Id: I912f69e0d0d3285c9fa77194f84b0819085c99b7
Reviewed-by: hjk <hjk@qt.io>
By default are marked as Autodetected, which is not the case for CMake
presets.
Fixes: QTCREATORBUG-31255
Change-Id: I5c3da7c6e7c68a8a2e80e415393010121b33efb4
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
CMake Project Manager is using a small CMake project as a compiler probe
when a CMake preset is being setup. Now this CMake project is saving
more variable as cache variables.
These CMake variables could be only visible inside the CMake preset
probe project via a CMake toolchain file.
CMAKE_SYSROOT was important to be set in the Kit. The CMAKE_C|
XX_COMPILER_TARGET variables are set to override the original triplet
for the code model.
Fixes: QTCREATORBUG-31249
Change-Id: I3c3294b839629c22ce760596b92b2b393eed6a8b
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
CMake will fail with an error for the "--target clean install"
combination.
Change-Id: I6de31539a3ead57bbcde5ce9905a22c9aeb3fd12
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This way the user will not have actions that will result in the
following error: "Error: could not load cache".
Change-Id: I4b4f2015e1215d4c12c6aefc03f4ee5b419016c3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
... and in some cases move it closer to the aspect setup. I kept
the original location in cases where the order possibly matters.
Change-Id: I4774ea355d0d1e3cf890676a84121195fca6d406
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Other build systems like qmake / qbs do not do this.
Change-Id: I615ea3556c694e7a18426558c5bf6f3ea142068d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This "edit-copy" icon used for source folders is very confusing. The
linked bug report has screenshots comparing Qt Creator and Xcode. Xcode
just uses consistently a folder icon for all nodes that are actually
folders.
This change will make Qt Creator also display a folder icon for the
source folders.
Task-number: QTCREATORBUG-30012
Change-Id: Ibfcc4f55e779ed368edd30bfbc711bd81a4aa499
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
It's conceptionally const, and would be useful to use as such, but
the current implementations often modifie mutable state.
To ease the transition pain, rename the previous non-const version to
addToLayoutImpl() and call it after const_cast'ing.
Change-Id: Ic8ca38e40f5df69c3d11121f96ea37648cf4feb7
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
If qmake -query fails for some reason then %{Qt:QT_INSTALL_PREFIX} would
evaluate to an empty string and CMAKE_PREFIX_PATH will not help CMake
find Qt packages.
By using the path to qmake itself we can safely determine a valid
CMAKE_PREFIX_PATH and CMAKE_FIND_ROOT_PATH.
Fixes: QTCREATORBUG-31194
Change-Id: Ib649dd57bfe3a97ef93a42603d83331922f99612
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Where they were missing. The text is shown as a paragraph in the
extension manager.
Change-Id: I6e15c89fe4023b222e9c476f4312e13fcb0905c0
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
A failed CMake run configuration could be the result of an compiler
update which then would cause CMake to fail.
Make sure to offer an upgrade path to the new Kit compiler values.
Change-Id: Ibabeb853259e23fe012d8b00e3d48979deee61a5
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Visual Studio is getting a fair number of updates. This involves also an
update of the Visual C++ toolchain.
This implies changing directory paths from "MSVC/14.39.33519" to "MSVC/
14.40.33807".
The linker "link.exe" is also stored in the same directory as the
compiler "cl.exe".
This commit makes sure that the linker also gets updated, not just the
compiler.
Change-Id: If8cd6e716604bc948ec8990921a14425ebcc7c30
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Do not apply the changes directly to the model, cache and then apply at
the right time.
Fixes: QTCREATORBUG-27005
Change-Id: Id099f21196900cd0e9787ac27887f2eec36f8045
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Qt SDK is setting "Ninja" as default generator, make sure to get a
working generator when CMake is newly registered as a default tool.
Fixes: QTCREATORBUG-31129
Change-Id: I6b93a8904696eedadec04c882495c644db7ddce7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
If a class is being added to a target that has a variable resulted from
a `file(GLOB|_RECURSE)` call, we skip adding the files to the target.
Do not add the files, just run CMake which would gather the new sources
into the project.
Adding sources to a globbed target will no longer open the
CMakeLists.txt file, since nothing has changed.
CMake will be run after adding, renaming and removing of sources files.
Fixes: QTCREATORBUG-30445
Change-Id: I82e126737789f215a6400f5a43f303dcc57de005
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Amends f866b03b19
This would do what the QMake build system does on new build types, it
asks for a name and uses that name in the build directory.
Fixes: QTCREATORBUG-26066
Change-Id: Iec5b4ace1e203affad718b42ec2bcbbc87aef51f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Use consistent wording for things that failed.
Change-Id: If8593077352b48418ca739d6933beef588057ac1
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Amends b240bfb3db
Having the assignement sepparate makes the code easier to understand.
Change-Id: I10112224c9752788e157012d53f638406b79793b
Reviewed-by: hjk <hjk@qt.io>
This fixes renaming of "my/class.cpp my/class.h" via "../class.h" and
resulting into "class.cpp class.h".
"oldRelPathName" was not needed since it was saved in the
"m_filesToBeRenamed" map and it was computed from the new filename. This
was prone to error.
Task-number: QTCREATORBUG-30830
Change-Id: I839fab3bd6a6172f5ebfbaf9a4b6501cd5693fa8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
A lot of code had a more suitable place to live in, some was even
unused.
Change-Id: I36478ef473aa14395a182c9ac5e3738fc93134b6
Reviewed-by: David Schulz <david.schulz@qt.io>