Commit Graph

457 Commits

Author SHA1 Message Date
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
Kyle Edwards
d471406f0b CMake GUI: Disable preset fields instead of hiding them 2020-10-16 15:16:04 -04:00
Brad King
440ee739c4 cmake-gui: Attach icons only to main GUI executables
In commit efe48189bf (cmake-gui: Restore application icon on macOS,
2020-10-13, v3.19.0-rc1~2^2) and commit f7ae4f572b (cmake-gui: Restore
application icon on Windows, 2020-10-13, v3.19.0-rc1~1^2) we attached
the icon source files to all consumers of `CMakeGUILib`, but that
includes other libraries like `CMakeGUIMainLib`.  The latter library is
meant only for direct consumption by a GUI executable, so use that to
propagate the icons instead.
2020-10-14 09:35:58 -04:00
Brad King
f7ae4f572b cmake-gui: Restore application icon on Windows
In commit 41e223deb3 (CMake GUI: Split up into libraries, add test shim,
2020-09-14) the Windows resource source file that references the icon
was moved to CMakeGUILib, but it needs to be directly in the main
application in order to be attached properly.
2020-10-13 12:09:28 -04:00
Brad King
efe48189bf cmake-gui: Restore application icon on macOS
In commit 41e223deb3 (CMake GUI: Split up into libraries, add test shim,
2020-09-14) the macOS icon source file was moved to CMakeGUILib, but it
needs to be directly in the main application in order to be attached to
the `.app` in the right place.
2020-10-13 10:35:14 -04:00
Kyle Edwards
a4382f72d7 CMake GUI: Add presets functionality 2020-10-05 09:49:59 -04:00
Kyle Edwards
0fe2ee3d43 CMake GUI: Add "CMake Reference Manual" help item
And switch the ordering of "Help" and "About".
2020-09-30 16:17:31 -04:00
Kyle Edwards
85f5009d27 CMake GUI: Add environment editor 2020-09-28 09:46:35 -04:00
Kyle Edwards
ab8f6fdd8c CMake GUI: Modernize signal-slot connections
Qt5 supports passing function pointers to QObject::connect(), and
prefers this over SIGNAL() and SLOT(). Modernize the connections,
stop using a deprecated signal from QComboBox, and modernize a few
QKeySequence's.
2020-09-27 12:06:54 -04:00
Kyle Edwards
41e223deb3 CMake GUI: Split up into libraries, add test shim 2020-09-23 14:10:40 -04:00
Kyle Edwards
b7995b62f0 QCMakeCacheView: Default to nullptr for parent 2020-09-23 14:10:40 -04:00
Kitware Robot
bdca8b01d2 Modernize: Use #pragma once in all header files
#pragma once is a widely supported compiler pragma, even though it is
not part of the C++ standard. Many of the issues keeping #pragma once
from being standardized (distributed filesystems, build farms, hard
links, etc.) do not apply to CMake - it is easy to build CMake on a
single machine. CMake also does not install any header files which can
be consumed by other projects (though cmCPluginAPI.h has been
deliberately omitted from this conversion in case anyone is still using
it.) Finally, #pragma once has been required to build CMake since at
least August 2017 (7f29bbe6 enabled server mode unconditionally, which
had been using #pragma once since September 2016 (b13d3e0d)). The fact
that we now require C++11 filters out old compilers, and it is unlikely
that there is a compiler which supports C++11 but does not support
#pragma once.
2020-09-03 09:30:21 -04:00
Brad King
f3d93edb36 Merge topic 'cmake-gui-qt-5.14'
af6cf586f6 cmake-gui: Fix crash when built with Qt 5.14 or later

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5045
2020-07-23 08:20:48 -04:00
Brad King
af6cf586f6 cmake-gui: Fix crash when built with Qt 5.14 or later
In commit d7679f6427 (QCMakeCacheView: use non-deprecated List and Set
constructions, 2020-06-10, v3.18.0-rc2~13^2) the conversion of the
`this->properties()` value to QSet is incorrect for Qt 5.14+.  The
problem is that `this->properties()` returns by value, so the range
`this->properties().begin(), this->properties().end()` provides
iterators to two different instances.  Use an intermediate temporary
copy of the value to get a consistent iterator range.

Fixes: #20981
2020-07-22 15:19:51 -04:00
Brad King
6bdbc7dba0 Merge topic 'cmake-gui-qt-5.14'
8eb7cf9b5f cmake-gui: Fix compilation as C++14 with Qt 5.14

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !4978
2020-07-07 09:17:23 -04:00
Brad King
8eb7cf9b5f cmake-gui: Fix compilation as C++14 with Qt 5.14
Fix code added by commit d7679f6427 (QCMakeCacheView: use non-deprecated
List and Set constructions, 2020-06-10, v3.18.0-rc2~13^2), used
conditionally on Qt 5.14 or above, to compile as C++14.
2020-07-06 11:45:03 -04:00
Brad King
df6b077625 cmake: Remove broken '--warn-unused-vars' option
This option has been broken since commit b9f9915516 (cmMakefile: Remove
VarUsageStack., 2015-05-17, v3.3.0-rc1~52^2).  That commit removed the
check that an initialized variable has actually been used and caused the
option to warn on every variable ever set.  This was not caught by the
test suite because the test for the feature only checked that warnings
appear when needed and not that they do not appear when not needed.

The option was never very practical to use.  Remove it to avoid the
runtime cost of usage tracking and checks for every variable (which we
were doing even when the option was not used).
2020-06-29 17:23:27 -04:00
Ben Boeckel
0fc1818831 QCMakeWidgets: replace QDirModel 2020-06-15 07:13:23 -04:00
Ben Boeckel
736fb34294 QCMake: use loadRelaxed if available
Added in 5.14 and load() was deprecated at the same time.
2020-06-15 07:12:49 -04:00
Brad King
068551cfb2 Merge topic 'cmake-gui-qt5-only'
4037beb747 QtDialog: remove Qt4 definition
ce9dbceb42 QtDialog: remove Qt4-only code
8ea50749da QtDialog: use Qt5's imported targets
4ccc9921be QtDialog: use qt5 functions for special Qt sources
e4d6015460 QtDialog: remove Qt4 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4836
2020-06-12 10:11:54 -04:00
Ben Boeckel
d7679f6427 QCMakeCacheView: use non-deprecated List and Set constructions 2020-06-10 16:42:56 -04:00