1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-09 15:38:15 +08:00

507 Commits

Author SHA1 Message Date
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
Brad King
0cb4fffae1 Merge topic 'cmake-gui-restore-version-info'
ec76a9c22f cmake-gui: Restore embedded version information in Windows binary

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7895
2022-11-10 09:59:42 -05:00
Brad King
ec76a9c22f cmake-gui: Restore embedded version information in Windows binary
Refactoring in commit 89a1e1c1be (Build: Link w/ `OBJECT` library is OK
since 3.12, 2022-08-21, v3.25.0-rc1~97^2~19) dropped the `.res` object
containing this information from the `cmake-gui` link line.  Restore it.
2022-11-09 16:54:46 -05:00
Juan Ramos
3c3bce133d cmake: Honor CMAKE_GENERATOR env var in --help output 2022-10-20 19:53:14 -06:00
Brad King
440822fa5c Source: Fix regression causing CMakeLib sources to be compiled repeatedly
In commit 4ff8604604 (Build: Do not use variables for sources lists,
2022-08-21) the sources of `CMakeLib` were accidentally made PUBLIC.
This causes them to be compiled again in all consuming targets.
Make the sources PRIVATE instead.
2022-10-05 12:51:44 -04:00
Alex Turbov
f31c784a2d Build: Eliminate one time used variable 2022-09-22 09:24:48 -04:00
Alex Turbov
89a1e1c1be Build: Link w/ OBJECT library is OK since 3.12 2022-09-22 09:24:48 -04:00
Alex Turbov
3b32a1a820 Build: Introduce ManifestLib interface library
… instead of `MANIFEST_FILE` variable.
2022-09-22 09:24:48 -04:00
Alex Turbov
83491ddd43 Build: add_definitions()add_compile_definitions() 2022-09-22 09:24:48 -04:00
Alex Turbov
4ff8604604 Build: Do not use variables for sources lists
Instead use `add_library()` with unconditionally compiled sources and
conditional `target_sources()` with extra sources to compile.
2022-09-22 09:24:47 -04:00
Alex Turbov
0aed435b35 Build: Simplify configure_file() calls 2022-09-22 09:24:47 -04:00
Alex Turbov
dd28d76203 CMakeLists: Remove redundant spaces around CMake command calls 2022-09-22 09:24:46 -04:00
Alex Turbov
a509602699 Build: Modernize some foreach calls to use IN LISTS/IN ITEMS 2022-09-22 09:24:46 -04:00
dou fu
5671c5270b cmake-gui: Fix selected item mismatched CMAKE_GENERATOR_PLATFORM env
The first empty item in the combobox causes a misalignment with the
actual setting by `CMAKE_GENERATOR_PLATFORM` environment variable.
2022-09-01 10:12:06 -04:00
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