Commit Graph

477 Commits

Author SHA1 Message Date
FeRD (Frank Dana)
98a10290a8 cmSystemTools: Fix 'ErrorOccurred' spelling
Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to
's_ErrorOccurred' and 's_FatalErrorOccurred', respectively.

Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and
'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
2022-06-13 09:05:24 -04:00
Mehdi Chinoune
497397bd17 cmake-gui: Support non-ASCII chars on Windows with Qt6
Since commit baead1e2a8 (Encoding: Remove option to use ANSI code page
internally, 2016-11-01, v3.8.0-rc1~358^2), we always use UTF-8 strings
internally.  Using fromLocal8Bit/toLocal8Bit + QTextCodec is no longer
needed.  Convert to fromStdString/toStdString instead, which should work
both with Qt5 and Qt6.

Fixes: #23565
2022-06-10 14:33:20 -04:00
Brad King
9d89c9af46 Merge topic 'cmake-gui-locale'
ae13524e3b cmake-gui: Restore support for internationalization with Qt5 on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7303
2022-05-31 11:55:10 -04:00
Brad King
ae13524e3b cmake-gui: Restore support for internationalization with Qt5 on Windows
Restore the logic removed by commit 035078d847 (cmake-gui: Remove
explicit locale setup, 2020-12-17, v3.20.0-rc1~205^2~6), but only with
Qt5 on Windows.  Leave a FIXME comment to support Qt6 later.

Fixes: #23562
Issue: #23565
2022-05-27 11:52:51 -04:00
Ben Boeckel
aa3649eb04 clang-tidy: fix performance-unnecessary-copy-initialization lints 2022-05-24 09:09:44 -04:00
Ben Boeckel
a5f8cbe8b1 clang-tidy: address modernize-use-default-member-init lints 2022-05-24 09:09:43 -04:00
Carlo Marcelo Arenas Belón
072b318893 cmake-gui: avoid undefined font in recent macOS
Since commit 8fb74f97ef (ENH: Use fixed pitch font in output window,
2008-03-07), cmake-gui has been using a "Courier" font to print mono
spaced text in the output window, but at least in macOS 12, Courier
is no longer availablemand therefore will print the following warning
in the invoking terminal:

    qt.qpa.fonts: Populating font family aliases took 175 ms. Replace uses of missing font family "Courier" with one that exists to avoid this cost.

Change it to use "Courier New" instead, which has been provided as an
automatically selected alternative in Windows and comes preinstalled
in both systems, and add a hint to pull another monospaced font if not.
2022-04-15 08:33:40 -04:00
Reinaldo Deprera
ebc1c60d43 cmake-gui: Add "Building" category to freedesktop menu spec
Add "Building" to Categories parameters like suggested by the
specification [1] for better XFCE/GNome/Plasma menu integration.

[1] https://specifications.freedesktop.org/menu-spec/latest/apas02.html
2022-04-04 09:55:01 -04:00
Kyle Edwards
fd6ea2f67f Refactor: Rename cmCMakePresetsFile to cmCMakePresetsGraph
And change all references to "file" to say "graph" instead.
2022-01-06 18:52:30 -05:00
Marc Chevrier
cc56dc7468 Rename cmProp in cmValue 2021-09-21 17:14:04 +02:00
Marc Chevrier
e5cd39ca80 cmProp: refactoring: transform alias in class
To handle safely the values used by CMake variables and properties,
introduce the class cmProp as a replacement from the simple pointer
to std::string instance.
2021-08-08 16:19:08 +02:00
Alex Richardson
cadf2b632e Fix -Wpessimizing-move warnings in QCMake::loadPresets() 2021-06-22 16:13:21 +01:00
Marius Messerschmidt
bceb8e2ed2 cmMessenger: Pass title inside a metadata structure 2021-05-19 09:06:27 -04:00
Craig Scott
6c657173d8 cmake-gui: Address deprecation warnings with Qt6 2021-05-08 16:19:21 +10:00
friendlyanon
06e6981336 cmake-presets: Make generator and binaryDir fields optional
In v3 of the presets, generator and buildDir can be omitted to fall
back to regular cmake behavior when these values are not explicitly
provided by the user.

Fixes: #21987
2021-04-07 01:24:44 +02:00
Kyle Edwards
8bc5c8961e CMakePresets.json: Add the ability to conditionally disable presets 2021-03-22 15:04:54 -04:00
Brad King
9ec50ff157 cmake-gui: Restore search bar case insensitivity
Since these changes:

* commit f1de6f6682 (cmake-gui: Support building against Qt6,
                     2020-12-17, v3.20.0-rc1~205^2~7)
* commit 134d69121e (cmake-gui: Restore search bar for cache view and
                     environment dialog, 2021-02-22, v3.20.0-rc2~12^2)

the search bar is no longer case insensitive when using Qt 5.12.[0-1],
and possibly some later versions.  It works as of Qt 5.15 though, so
update our version check accordingly.

Fixes: #21884
2021-03-04 11:25:54 -05:00
Sankhesh Jhaveri
134d69121e cmake-gui: Restore search bar for cache view and environment dialog
This was broken by commit f1de6f6682 (cmake-gui: Support building
against Qt6, 2020-12-17, v3.20.0-rc1~205^2~7).

Fixes: #21850
2021-02-22 17:56:59 -05:00
Sam Freed
676ecf0d37 cmake-presets: Add build and test presets
Fixes: #21391
2021-02-01 11:59:40 -05:00
Matthew Woehlke
79d00c629f CMake GUI: Fix rendering issue
Remove style sheet from a combo box in the GUI. I have no idea why this
was being set, but it causes a render glitch. Also, use a more sensible
size policy on the same widget.
2021-01-15 11:43:34 -05:00
Matthew Woehlke
15e8072859 CMake GUI: Use system icons when available
Modify GUI to use system (theme) icons when available. This may only
affect builds on Linux platforms when using the system-provided Qt, but
will improve visual consistency with e.g. okay/cancel buttons which are
also using the system/theme icons. This also means that the GUI will
look slightly more "native" on Linux.
2021-01-15 11:43:29 -05:00
Matthew Woehlke
8aebd159fc CMake GUI: Don't use QToolButton
Replace QToolButton instances with QPushButton. QToolButton is only
meant to be used on tool bars and some other special situations. Worse,
we had a mix of QToolButton and QPushButton for things that clearly
should be using the same widget. This will improve visual consistency
and may fix some rendering issues.
2021-01-15 11:24:16 -05:00
Matthew Woehlke
0bc327a79c CMake GUI: Improve signal specification
Don't use subclasses to connect to QAbstractButton::clicked. This is
slightly dodgy, but of more immediate importance, tweaking it will allow
us to change the widget type of some QToolButton instances that should
be QPushButton.
2021-01-15 11:21:07 -05:00
Kyle Edwards
9f48a468cd Merge branch 'master' into cmake-gui-qrc-fix 2021-01-11 15:00:51 -05:00
Kyle Edwards
e20560a2dc cmake-gui: Restore linking of Qt resources
Refactoring in commit 41e223deb3 (CMake GUI: Split up into libraries,
add test shim, 2020-09-14, v3.19.0-rc1~116^2~2) broke linking of Qt
resources, such as the Add/Remove Entry button icons.

Fixes: #21682
2021-01-11 14:57:53 -05:00
Brad King
2c5f30b472 cmake-gui: Fix macOS styling for binaries distributed with Qt 5.10+
According to https://bugreports.qt.io/browse/QTBUG-59428, Qt 5.10 and
above moved macOS style handling into a separate `qmacstyle` plugin.
Install the plugin in our `CMake.app` package on macOS.

Issue: #21606
2021-01-07 16:10:07 -05:00
Brad King
63079b97f0 cmake-gui: Fix macOS styling for binaries distributed with Qt 5.10+
According to https://bugreports.qt.io/browse/QTBUG-59428, Qt 5.10 and
above moved macOS style handling into a separate `qmacstyle` plugin.
Install the plugin in our `CMake.app` package on macOS.

Issue: #21606
2021-01-07 13:22:31 -05:00
Brad King
a6abe70e72 cmake-gui: Restore minimal plugin installation for Qt5
Since commit f1de6f6682 (cmake-gui: Support building against Qt6,
2020-12-17) all available plugins for each Qt component are installed.
This installs more than we need for CMake, so restore Qt5-specific logic
to install only the plugins did before.
2021-01-07 13:19:48 -05:00
Brad King
8dd88a5224 cmake-gui: Restore exclusion of static plugin installation
This was broken by commit f1de6f6682 (cmake-gui: Support building
against Qt6, 2020-12-17).
2021-01-07 13:19:48 -05:00
Brad King
a65db7ef6a cmake-gui: Restore installation of Qt plugin dependencies
Fix logic from commit f1de6f6682 (cmake-gui: Support building against
Qt6, 2020-12-17) to restore population of the `QT_PLUGINS` variable used
in our `fixup_bundle` call.
2021-01-07 13:19:48 -05:00
Brad King
321cb5978f cmake-gui: Remove outdated FIXME comment about plugin installation
Qt plugin installation conventions are now well-established.
2021-01-07 13:19:48 -05:00
Brad King
d391d05e3a cmake-gui: Fix CMake_QT_MAJOR_VERSION string comparison
Fix the string comparison added by commit 2e4cbaa521 (cmake-gui: Add a
Qt version control variable, 2020-12-28).  The version-based comparison
is not meant for arbitrary strings.
2021-01-07 13:19:48 -05:00
Sankhesh Jhaveri
2e4cbaa521 cmake-gui: Add a Qt version control variable 2021-01-05 11:03:31 -05:00
Sankhesh Jhaveri
b3ee09290b cmake-gui: Conditionally switch between QDirModel and QFileSystemModel
Uses QT_VERSION_CHECK to determine Qt version. The code switches to
QFileSystemModel for Qt versions >= 6
2021-01-05 11:03:31 -05:00
Sankhesh Jhaveri
020b2766f3 cmake-gui: Replace obsolete QDirModel with QFileSystemModel 2021-01-05 11:03:30 -05:00
Sankhesh Jhaveri
684dcdbc5b cmake-gui: Prefer local variable for Qt major version
QT_DEFAULT_MAJOR_VERSION was added in Qt 5.15 and CMake supports Qt versions >= 5.9
2021-01-05 11:03:30 -05:00
Sankhesh Jhaveri
50fcc94bc5 cmake-gui: Support installation for both Qt5 and Qt6 plugins 2021-01-05 11:03:30 -05:00
Sankhesh Jhaveri
2a2942a42e cmake-gui: Use a consistent Qt major version variable name 2021-01-05 11:03:30 -05:00
Sankhesh Jhaveri
035078d847 cmake-gui: Remove explicit locale setup
Qt uses utf-8 encoding by default for versions >= Qt5.
2021-01-05 11:03:30 -05:00
Sankhesh Jhaveri
f1de6f6682 cmake-gui: Support building against Qt6 2021-01-05 11:03:30 -05:00
Brad King
d8654c2a02 Merge topic 'cmake-gui-system-icon'
47649baf60 cmake-gui: Use icon from system theme if available

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5616
2020-12-16 06:18:01 -05:00
Brad King
854f5ea1cb cmake-gui: Restore completion during path editing
Revert commit 0fc1818831 (QCMakeWidgets: replace QDirModel, 2020-06-15,
v3.19.0-rc1~696^2).  `QFileSystemModel` is not a drop-in replacement for
`QDirModel`.  Additional changes are needed to make it work fully.
Revert the change and suppress the `QDirModel` deprecation warning
pending further investigation.

Fixes: #21589
2020-12-15 08:40:13 -05:00
Loren Burkholder
47649baf60 cmake-gui: Use icon from system theme if available 2020-12-15 07:48:51 -05:00
Brad King
5f782119c8 cmake-gui: Restore workaround for crash in file dialog
In commit ce9dbceb42 (QtDialog: remove Qt4-only code, 2020-06-02,
v3.19.0-rc1~712^2~1) we removed an event filter that was thought to be
necessary only as a workaround for a bug in Qt.  However, that bug was
fixed in Qt 4.5, and the file dialog still crashes as of Qt 5.14 without
the filter.  Restore the workaround pending further investigation.

Fixes: #21400
2020-11-05 14:50:45 -05:00
Brad King
199247c21a Merge topic 'cmake-presets-help-flag' into release-3.19
c619be2784 ccmake: Don't list --preset in --help

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5428
2020-10-28 07:47:37 -04:00
Kyle Edwards
ef03124237 CMake GUI: Add --browse-manual argument 2020-10-27 12:05:41 -04:00
Kyle Edwards
c619be2784 ccmake: Don't list --preset in --help
And show available options in cmake-gui.

Fixes: #21313
2020-10-27 10:29:24 -04:00
Kyle Edwards
b7d7eca66d CMakePresets.json: Rework how --preset argument is handled
If a path argument with no -S or -B leads to a cache directory,
use that directory as the binary directory. Otherwise, use the
binary directory from the preset.

Fixes: #21311
2020-10-26 22:32:45 +11:00
Kyle Edwards
64afabdbcb CMakePresets.json: Split cmakeGeneratorConfig field
Make this field separate for both architecture and toolset. Allow
architecture and toolset to be either strings or objects with value
and strategy fields.

Fixes: #21317
2020-10-22 11:24:39 -04:00
Kyle Edwards
638557cbfe CMakePresets.json: Properly report macro expansion errors
Make a distinction between strings which simply use the
$vendor{<...>} macro, which is valid but makes it unusable by CMake,
and strings which actually contain invalid macro expansions.

Fixes: #21308
2020-10-21 09:20:52 -04:00