Commit Graph

540 Commits

Author SHA1 Message Date
Joerg Bornemann
327f50083b cmake-gui: Fix {begin|end}ResetModel warnings
QStandardItemModel::beginResetModel() and
QStandardItemModel::endResetModel() calls cannot be nested, and Qt will
produce warnings at runtime if such nesting is detected.

The nesting happened in two places:
1. QCMakeCacheModel::setViewType calls QCMakeCacheModel::setProperties.
Both called beginResetModel.
2. QCMakeCacheModel::setProperties calls QStandardItemModel::clear(),
which also calls beginResetModel.

The fix for 1 is to remove the {begin|end}ResetModel calls from
setViewType. The setProperties calls take care of the
{begin|end}ResetModel calls.

The fix for 2 is to replace the clear() call with a call that removes
all data rows.

Issue: #27376
2025-11-13 08:08:15 -05:00
Brad King
e290d4f2a3 cmake: Infer command set from role 2025-11-07 09:35:54 -05:00
Brad King
0aab75bf0e cmake: Clarify name of enum backing CMAKE_ROLE property 2025-11-07 09:35:53 -05:00
Brad King
9e36f22684 cmake: Clarify name of enum identifying set of commands added 2025-11-07 09:35:53 -05:00
Brad King
4a2d32e7c4 cmake: Remove unnecessary initialization of empty source and build paths
The explicit initialization with empty paths from commit 57bdc1a2f7
(cmState: Compute and store directory components., 2015-05-04,
v3.3.0-rc1~61^2~4) has not been needed since commit 6afd35b98a (cmState:
remove unused code, 2016-06-16, v3.7.0-rc1~90^2).
2025-11-07 09:35:52 -05:00
Brad King
0f18aa010e ci: Update to Qt 6.9.3 on macOS
Get Qt updates fix `cmake-gui` button rendering when compiled with a
macOS 26 SDK.

Issue: #27325
2025-11-04 09:58:38 -05:00
Brad King
2ae318bb5d cmake-gui: Install only necessary plugins for Qt 6 2025-11-03 11:05:04 -05:00
Brad King
74dec2c7fd cmake-gui: Detect Qt lib directory on macOS more robustly
Avoid assuming a specific path within a framework.
2025-11-03 11:05:04 -05:00
Brad King
0d1321770d cmake-gui: Clarify signature of QCheckBox::checkStateChanged callbacks
In commit cbf0d3da52 (cmake-gui: Port away from deprecated API in Qt >=
6.7, 2025-02-21, v4.1.0-rc1~755^2~4) we assumed that `Qt::CheckState` is
implemented as an `int`.  Spell out the type explicitly for the Qt 6.7+
callback signatures.
2025-11-03 11:05:04 -05:00
Brad King
7ebad5d201 cmake-gui: Refactor installation into CMake.app/Contents on macOS
Instead of mutating `CMAKE_INSTALL_PREFIX`, add a `CMake.app/Contents/`
prefix to install destinations besides the `cmake-gui` target itself.
2025-10-31 09:33:52 -04:00
Brad King
a65d986850 cmake-gui: Simplify macOS bundle version logic 2025-10-31 09:33:51 -04:00
Richard Thomson
18f1f19c82 cmake-gui: Support configure presets version 3+ without generator field
Presets allow this since commit 06e6981336 (cmake-presets: Make
generator and binaryDir fields optional, 2021-03-26, v3.21.0-rc1~346^2).

Fixes: #25817
2025-09-01 14:34:06 -04:00
Brad King
cef4676d3a StdIo: Factor out helper to initialize stdin, stdout, and stderr
Move logic from commit c85524a94a (Ensure stdin, stdout, and stderr pipes
are always open, 2019-05-02, v3.15.0-rc1~171^2) and commit 96010cc968
(Ensure stdin, stdout, stderr FILE streams are open on Windows, 2024-01-24,
v3.29.0-rc1~65^2) to a dedicated source.  Expose it through an `Init` class
constructor to make it optionally available during static initialization.

Issue: #26924
2025-05-08 13:39:48 -04:00
Brad King
6f0ad398f1 cmake-gui: Clarify "Open Project" button implementation details 2025-03-10 10:48:24 -04:00
Brad King
4e7aed2cd2 Merge topic 'cmake-gui-incidental-errors'
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10429
2025-03-07 12:10:18 -05:00
Juan Ramos
e9c494005c cmake-gui: Fix regression that prints an incidental error on fresh build trees
Since commit a872844908 (cmake-gui: Handle relative paths in the build
directory text input, 2024-04-24, v3.30.0-rc1~5^2), `cmake-gui` gave an
incidental error message even when a valid build directory was being
passed.  Fix this by checking for a non-empty path before using it.

Fixes: #26744
2025-03-06 11:13:06 -05:00
Kitware Robot
1772622772 LICENSE: Replace references to Copyright.txt with LICENSE.rst
```
git grep -lz 'Copyright.txt or https://cmake.org/licensing ' |
  while IFS= read -r -d $'\0' f ; do
    sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / {
              s/Copyright.txt/LICENSE.rst/
            }' "$f" ; done
```
2025-03-03 10:43:35 -05:00
Brad King
67b6964efa Merge branch 'backport-license-rst' (early part) into license-rst 2025-03-03 10:42:50 -05:00
Brad King
3035ee4ff3 CMake: De-duplicate extraction of copyright line from license file 2025-03-03 08:59:09 -05:00
Brad King
068ea4bfc1 cmake-gui: Update credits in About dialog to reflect status quo 2025-03-03 08:59:08 -05:00
Brad King
3bdf63e84d Merge topic 'cmake-gui-reload-presets'
74be7f5d79 cmake-gui: Add 'Reload Presets' button, replacing reload timer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10361
2025-02-26 08:44:31 -05:00
Will Bowers
74be7f5d79 cmake-gui: Add 'Reload Presets' button, replacing reload timer
Previously the presets handler in the GUI was on a timer.  Because of
this, error messages got suppressed after the first one (even if the
error message is different from the one originally suppressed).

Add a "reload presets" button which forces the preset to reload, and
always provides an error message if the reload failed.

Fixes: #26707
2025-02-25 08:20:59 -07:00
Alexandru Croitor
245f5ca8b3 Tests: Make CMakeGUI test build with both Qt5 and Qt6
Fixes: #26710
2025-02-21 14:41:12 -05:00
Brad King
e35d1ee4cd cmake-gui: Clarify variable name for selected Qt major version 2025-02-21 14:41:12 -05:00
Brad King
19a1c115e0 cmake-gui: Fix integer conversion warnings with Qt 6 2025-02-21 14:41:12 -05:00
Brad King
cbf0d3da52 cmake-gui: Port away from deprecated API in Qt >= 6.7 2025-02-21 12:39:19 -05:00
Kitware Robot
0b96ae1f6a Revise C++ coding style using clang-format with "east const"
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`, now with "east const" enforcement.
Use `clang-format` version 18.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.

Issue: #26123
2025-01-23 13:09:50 -05:00
Brad King
2cf04f3034 Source: Include BundleUtilities from running cmake at install time
Since commit 249a9bb44d (cmake-gui: use BundleUtilities in place of
custom script., 2010-10-14, v2.8.4~299^2) our install scripts include
the `BundleUtilities` module from our own source, rather than from the
`cmake` that's running at install time.  We've now long required a
`cmake` version high enough to have the `BundleUtilities` we need.
Avoid including a `BundleUtilities` that may be newer than the running
`cmake` understands.
2025-01-22 10:40:53 -05:00
Brad King
381c446ff7 VS: Remove support for appending a platform to the generator name
Compatibility with CMake versions prior to 3.1 is no longer supported.

Fixes: #26481
2025-01-21 08:08:22 -05:00
Matthew Woehlke
99ac59d31b style: Remove trailing blank lines from all CMake sources
Our development workflow tooling prevents trailing blank lines
from being added, but some such lines remain from before that
was enforced.  Remove them to make it easier to rename files
without triggering enforcement.
2024-11-21 15:48:02 -05:00
Brad King
5aed3ee49d cmSystemTools: Add GetLogicalWorkingDirectory
Track the current working directory with symbolic links preserved.
2024-11-03 08:26:36 -05:00
Brad King
967d3ea85c cmake-gui: Explicitly normalize input paths as they exist on disk 2024-10-22 13:26:19 -04:00
Daniel Pfeifer
58c5f77837 clang-tidy: fix readability-redundant-* warnings 2024-10-11 15:37:21 +02:00
Roc R. Currius
a872844908 cmake-gui: Handle relative paths in the build directory text input
Interpret a relative path with respect to the previously configured
directory.
2024-06-05 10:35:05 -04:00
Craig Scott
afa1d0d0e3 CMakeGUI: Sanitize source and build dirs the same as command line
This makes a difference when projects compare things like
CMAKE_SOURCE_DIR with CMAKE_CURRENT_SOURCE_DIR and the source
directory has a trailing slash in the GUI. The command line cmake invocation
cleans the paths at the beginning, so such comparisons return true. But the
GUI currently passes the paths unmodified, so such comparisons return false.
Change the logic to sanitize the paths used through the GUI in the same way
that the command line invocation does.

Fixes: #21421
2024-06-01 17:34:27 +10:00
Brad King
f26e8886b3 cmake-gui: Suppress MSVC deprecation warnings from Qt headers
MSVC 14.38+ toolsets deprecate `stdext::checked_array_iterator`.
Support building with versions of Qt that have not been updated
to avoid the deprecated API.

Qt-Issue: https://bugreports.qt.io/browse/QTBUG-118993
2024-05-30 14:23:47 -04:00
Brad King
27d958b34c Merge topic 'cmake-gui-unused-slot'
3f3c387a96 cmake-gui: Remove unused viewType slot

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9137
2024-01-09 09:54:30 -05:00
Christoph Grüninger
3f3c387a96 cmake-gui: Remove unused viewType slot
The slot for `setViewType(t)` and `viewType()` are never connected.
Found by Clazy (`const-signal-or-slot`).
2024-01-08 12:45:41 -05:00
Brad King
4a4d639334 Merge topic 'cmake-gui_better_text_with_preset'
9d13674337 cmake-gui: Hint that the preset compilers will be used

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !9125
2024-01-08 09:34:07 -05:00
Robert Maynard
9d13674337 cmake-gui: Hint that the preset compilers will be used
Instead of stating that the default is the native compilers,
say we will use the compilers from the preset. This makes it
more clear that the preset is working as expected.
2024-01-05 12:04:12 -05:00
Robert Maynard
370370364b cmake-gui: Add support for preset toolchain entry
Previously the toolchain field was ignored when passing a preset
to cmake-gui.

Fixes: #24034
2024-01-05 12:01:44 -05:00
Marc Chevrier
4fc322bab4 AddCacheEntry: Suppress raw pointer usage 2023-05-30 16:41:59 +02:00
Martin Duffy
19305afd8a presets: Improve JSON parser and error messages 2023-03-29 10:41:19 -04:00
Brad King
5cda8a3993 cmake-gui: Fix conversion warnings about Qt indexing types
Qt 5 uses `int` for indexing, and Qt 6 uses `qsizetype`.  Add helper
types and casts to the appropriate type to avoid conversion warnings.
2023-02-20 17:55:49 -05:00
Kyle Edwards
b5383bc767 cmake-gui: Add optional filename argument to --browse-manual 2023-02-09 11:33:06 -05:00
Kyle Edwards
cb00fe0892 cmake-gui: do not set search filter if regex is invalid
Fixes: #24248
2022-12-16 09:09:07 -05:00
Alex Turbov
69918b07e1 cmDocumentationEntry: Drop all user provided ctors for C++ >= 14
There is no need for them cuz:

- the last field has a default value
- all static instances use 2 arguments convertible to `std::string`
- "dynamic" instances used for _Generator_ doc entries access
  fields diectly using default constructed instance

Moreover, compiler may generate move ctor/assign when needed.
2022-11-17 16:37:12 +04:00
Alex Turbov
74b735dea8 cmDocumentation: char*[][2]cmDocumentationEntry[N]
Use fixed size arrays of `cmDocumentationEntry` items instead of
open arrays of two `char` pointers when describe program options
help screens.

Also, drop `const char*[][2]` overloads of methods of
`cmDocumentation` and `cmDocumentationSection` classes in the sake
of generic (template) appenders introduced earlier.
2022-11-17 16:37:11 +04:00
Alex Turbov
807aa8e353 CMakeSetup.cxx: Use anonymous namespace instead of static 2022-11-17 16:37:11 +04:00
Alex Turbov
8e2a03c078 ctest.cxx: Eliminate redundand trenary operator 2022-11-17 16:37:11 +04:00