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

106 Commits

Author SHA1 Message Date
Kyle Edwards
b5383bc767 cmake-gui: Add optional filename argument to --browse-manual 2023-02-09 11:33:06 -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
Juan Ramos
3c3bce133d cmake: Honor CMAKE_GENERATOR env var in --help output 2022-10-20 19:53:14 -06: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
Craig Scott
6c657173d8 cmake-gui: Address deprecation warnings with Qt6 2021-05-08 16:19:21 +10: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
Loren Burkholder
47649baf60 cmake-gui: Use icon from system theme if available 2020-12-15 07:48:51 -05:00
Brad King
5ca2910f5f Merge topic 'cmake-presets-help-flag'
c619be2784 ccmake: Don't list --preset in --help

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5428
2020-10-28 07:47:38 -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
a4382f72d7 CMake GUI: Add presets functionality 2020-10-05 09:49:59 -04:00
Kyle Edwards
41e223deb3 CMake GUI: Split up into libraries, add test shim 2020-09-23 14:10:40 -04:00
Ben Boeckel
ce9dbceb42 QtDialog: remove Qt4-only code
The `reset()` method was actually deprecated for 5.0 which means it can
now be removed here.
2020-06-09 10:30:46 -04:00
Brad King
12b39aef75 Remove redundant calls to CollapseFullPath
Remove calls where it is known the input is already a collapsed
full path.
2020-03-24 10:10:06 -04:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Regina Pfeifer
f30523d090 clang-tidy: modernize-deprecated-headers 2019-09-16 10:11:13 -04:00
Sebastian Holtermann
f71f7ce3f0 cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.h
This adds the `cmStringAlgorithms.h` header and moves all string functions
from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
2019-07-29 21:13:56 +02:00
Brad King
c85524a94a Ensure stdin, stdout, and stderr pipes are always open
On non-Windows platforms libuv assumes that file descriptors 0-2 are
always used for standard pipes and never for anything else.  Otherwise,
libuv may re-use one of these descriptors and then fail an assertion
when closing it.  Similarly, On Windows platforms our ConsoleBuf
implementation assumes that the standard handles are always open.

If CMake is run with any standard pipes closed, open them with
`/dev/null` or `NUL` to satisfy these assumptions.

Fixes: #19219
2019-05-02 14:34:58 -04:00
mistersandman
fce03306ee cmake-gui: Fix theme on Windows with Qt >= 5.10
In Qt 5.10 the theme support moved to a separate QWindowsVistaStyle
plugin.

Issue: #19147
2019-04-08 13:30:05 -04:00
Kyle Edwards
ad0853b3d4 QtDialog: Clean up and document -S and -B options 2019-01-25 16:23:56 -05:00
Artur Ryt
7408cd3929 cmake: Return generator docs directly
The GetGeneratorDocumentation() function was not accurately
named and required the vector to populate to be passed as a
function argument. This commit makes the slightly renamed
function return by value, making it a true getter as implied
by its name. Some minor refactoring of the implementation
also makes the steps of populating the vector clearer.
2019-01-18 12:57:32 -05:00
Kyle Edwards
4568d046c4 Properties: Add CMAKE_ROLE global property
This property allows scripts to determine whether they're in project
mode, script mode, find-package mode, CTest, or CPack.
2019-01-17 09:44:29 -05:00
Brad King
772edffbf0 Merge topic 'readability-static-accessed-through-instance'
3e60580784 clang-tidy: Fix readability-static-accessed-through-instance

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2647
2018-11-28 09:07:45 -05:00
Brad King
cb6229b8b8 clang-tidy: fix warnings in macOS-only code 2018-11-27 13:20:34 -05:00
Regina Pfeifer
3e60580784 clang-tidy: Fix readability-static-accessed-through-instance
Enable the check in .clang-tidy and fix all warnings.
2018-11-22 00:11:37 +01:00
Robert Maynard
de962cc00d CMake: Internally uses -S instead of -H to specify source directory 2018-09-15 11:25:47 -04:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* 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.
2018-06-01 09:53:42 -04:00
Brad King
98628de812 Extend libuv file translate mode workaround to all executables
Since libuv commit v1.14.1~7 (win: add uv__once_init() calls,
2017-08-30) the libuv initialization of the file translate mode may take
place even if we do not use a uv loop.  This change was included in our
libuv update commit f4a26c748b (libuv 2018-01-19).  Therefore use of
libuv even through `cmSystemTools::GetRealPath` in any executable may
trigger its file translate mode setting.

Factor out the logic added to `cmake.exe` by commit v3.9.0-rc4~10^2
(cmake: Fix default file translate mode when using libuv, 2017-06-13)
and re-use to initialize all executables.

Issue: #16962
2018-01-23 09:29:07 -05:00
Brad King
27a73f1613 cmake-gui: Add build option to use Qt5 windows plugin statically
This will enable builds against a static Qt5 on Windows.
2017-11-13 09:54:49 -05:00
Luis Caro
6fb36572dc cmake-gui: Enable High DPI scaling
This Qt flag enables UI scaling based on scale factor provided by the
operating system.  Only supported on versions of Qt >= 5.6.

The flag has no effect on macOS, where high DPI support is already
enabled as a setting in the bundle's info.plist.

Fixes: #17026
2017-09-15 10:54:36 -04:00
Daniel Pfeifer
5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Daniel Pfeifer
c36d63cd48 cmake: initialize with Role that controls which commands to register 2017-05-08 22:29:44 +02:00
Daniel Pfeifer
1d829c862c Use quotes for non-system includes
Automate with:

git grep -l '#include <cm_' -- Source \
  | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g'

git grep -l '#include <cmsys/' -- Source \
  | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g'

git grep -l '#include <cm[A-Z]' -- Source \
  | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
2017-04-11 22:35:21 +02:00
Daniel Pfeifer
e9fc7ff505 Add self-sufficient wrapper for <sys/stat.h> 2017-03-24 22:58:25 +01:00
Daniel Pfeifer
2e620f0b38 Fix several include-what-you-use findings 2016-11-08 09:42:04 -05:00
Clinton Stimpson
baead1e2a8 Encoding: Remove option to use ANSI code page internally
The switch to use UTF-8 encoding has been defaulted to on for quite some
time since commit v3.2.0-rc1~116^2 (Encoding: Switch to use UTF-8
internally by default on Windows, 2014-12-26).
2016-11-02 08:48:34 -06:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Brad King
785f875426 Merge topic 'qtdialog-lib-paths'
48624b3c cmake-gui: Do not remove library paths for Qt5 plugins.
2016-09-23 08:39:56 -04:00
Clinton Stimpson
48624b3cb8 cmake-gui: Do not remove library paths for Qt5 plugins.
Not removing library paths is necessary for QFileDialog to function correctly
on Linux when using Qt5.
2016-09-22 13:19:04 -06:00
Daniel Pfeifer
62c5f9afc3 QtDialog: fix clang-tidy warnings 2016-09-06 08:42:54 -04:00
Daniel Pfeifer
efed6468ed fix a load of include-what-you-use violations 2016-09-03 08:04:56 -04:00
Brad King
5de1d406f1 Source/QtDialog: Run clang-format 2016-07-05 15:15:57 -04:00
Brad King
73a3c0cd98 cmake-gui: Add build option to use Qt5 xcb plugin statically
This will enable builds against a static Qt5.
2016-06-30 11:26:53 -04:00
Robert Maynard
f28401554a cmake-gui: Teach Qt5 where plugins are when launched through a symlink
When we are on OSX and we are launching cmake-gui from a symlink, the
application will fail to launch as it can't find the qt.conf file which
tells it what the name of the plugin folder is. We need to add this path
BEFORE the application is constructed as that is what triggers the
searching for the platform plugins
2016-06-09 13:21:27 -04:00