Commit Graph

486 Commits

Author SHA1 Message Date
Kitware Robot
de273b2e11 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 09:56:07 -05:00
Brad King
759cd843db CMake: De-duplicate references to license file 2025-03-03 08:59:09 -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
57a24181ed clang-tidy: Do not require config file if not running clang-tidy
Since commit 00cfea965b (gitattributes: Do not export lint config files
in source archives, 2025-01-24, v4.0.0-rc1~129^2) the `.clang-tidy`
config file is not available in source archives.  Require it only when
the `CMake_RUN_CLANG_TIDY` option is turned on, which we only do in
development and CI builds.

Fixes: #26712
2025-02-20 09:07:50 -05:00
Peter Kokot
4e6a13f211 Use lower case style for commands
Where possible this syncs the CS for command names:

- check_c_source_compiles()
- check_cxx_compiler_flag()
- check_cxx_source_compiles()
- check_cxx_symbol_exists()
- check_include_file_cxx()
- check_include_file()
- check_include_files()
- check_library_exists()
- check_source_compiles()
- check_struct_has_member()
- check_symbol_exists()
- check_type_size()
- cmake_dependent_option()
- cmake_parse_arguments()
- feature_summary()
- file()
- find_package_handle_standard_args()
- if(), endif...
- install(FILES)
- list()
- message()
- pkg_check_modules()
- select_library_configurations()
- set_package_info()
- test_big_endian()
2025-01-28 13:51:46 -05:00
Brad King
3a96346a3f Configure CMake itself with policies through CMake 3.30 2024-10-10 09:32:06 -04:00
Brad King
4a259d82ad Templates: Remove unused and undocumented CTestScript.cmake.in
The file was added by commit 3006560d86 (ENH: Add template of ctest
script, 2006-04-28, v2.6.0~3433), but we do not use it for anything.
Technically it was public-facing by being in the `Templates/` directory,
but was never documented.
2024-08-20 13:20:11 -04:00
Brad King
84f5f4278f Modules: Remove unnecessary .NoDartCoverage file in build tree
In-source builds were accidentally installing it as part of the source
tree's `Modules` directory.  The file was added by commit e131bfb462
(bug fix and some cleanup, 2002-12-03, v2.4.0~4793), but we have no
`Modules` in the build tree anyway.
2024-08-20 13:20:10 -04:00
Brad King
115425e68c Configure CMake itself with policies through CMake 3.29 2024-06-05 13:24:36 -04:00
Brad King
d3cbee99e3 macOS: Prefer building with system-provided curl
Our vendored curl only enables the Secure Transport backend by default
(`CURL_SSL_BACKEND=secure-transport`), but it is limited to TLS 1.2.

The macOS SDK provides the curl development components, and the
corresponding `libcurl.4.dylib` runtime library comes with macOS.
On macOS 12 and above, the default `CURL_SSL_BACKEND=openssl`
backend seems to be capable of selecting TLS 1.3 at runtime for
https connections.

Unfortunately the macOS version of curl, even on macOS 14.4, does
not accept `CURL_SSLVERSION_TLSv1_3` at runtime to enforce TLS 1.3.
However, while our vendored curl accepts the option and passes it
to Secure Transport, macOS does not actually enforce it anyway.

Fixes: #25870
Fixes: #23701
2024-05-09 14:58:06 -04:00
Brad King
d224c018fe nghttp2: Skip "Using system-installed" message if using system curl
We only use the system nghttp2 when `CMAKE_USE_SYSTEM_NGHTTP2` is ON and
`CMAKE_USE_SYSTEM_CURL` is OFF.
2024-05-09 08:55:22 -04:00
Brad King
ba6f3f25ee Configure CMake itself with policies through CMake 3.28 2024-02-06 17:07:16 -05:00
makise-homura
83af26d9ad LCC: Don't enable debugger on LCC that don't have <future> 2024-01-16 22:12:06 +03:00
Brad King
be045c7c16 Configure CMake itself with policies through CMake 3.27 2023-10-03 17:21:47 -04:00
Clemens Wasser
17b16696d4 CMake: Add CMake_BUILD_PCH option 2023-06-22 18:11:45 +02:00
Brad King
1b11f48741 Configure CMake itself with policies through CMake 3.26 2023-06-07 14:32:04 -04:00
Glen Chung
a9a592f96e cmake: Add debugger
- Depends on cppdap and jsoncpp.
- Add --debugger argument to enable the Debugger.
- Add --debugger-pipe argument for DAP traffics over named pipes.
- Support breakpoints by filenames and line numbers.
- Support exception breakpoints.
- Call stack shows filenames and line numbers.
- Show Cache Variables.
- Show the state of currently defined targets,
  tests and directories with their properties.
- Add cmakeVersion to DAP initialize response.
- Include unit tests.

Co-authored-by: Ben McMorran <bemcmorr@microsoft.com>
2023-05-30 09:46:12 -04:00
Brad King
5ec69eb58c cppdap: Build as part of CMake or use external installation
Add `cm3p/` headers to use the selected copy of the library.

Co-authored-by: Glen Chung <kuchung@microsoft.com>
2023-05-26 09:36:14 -04:00
Brad King
60c50d4e51 Merge topic 'test-no-dart'
2fc3b0f476 Tests: Drop use of legacy "Dart" module

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8257
2023-02-28 08:10:16 -05:00
Brad King
2fc3b0f476 Tests: Drop use of legacy "Dart" module
Use the CTest module directly.
2023-02-27 09:30:04 -05:00
Brad King
220fa1d92b Configure CMake itself with policies through CMake 3.25 2023-02-01 17:01:38 -05:00
Ben Boeckel
25f0b4f397 CMake: add an option to run IWYU in verbose mode
This helps to diagnose places where IWYU asks to include headers for
internal stdlib details.
2023-01-27 11:09:07 -05:00
Kyle Edwards
b2b1faa403 CMake: add option to export clang-tidy fixes to a directory 2022-12-08 09:42:27 -05:00
Michael Hirsch
8199020824
own CMakeLists: remove unreachable code 2022-11-06 19:06:31 -05:00
Kyle Edwards
153f39f4a5 Merge topic 'clang-tidy-plugin-stub'
d6f5e67f7b ci: add clang-tidy plugin to clang-tidy job
6c6912123e clang-tidy: Add option to load CMake's clang-tidy module
0ad3941f73 clang-tidy module: Add stub module

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7768
2022-10-14 11:01:58 -04:00
Kyle Edwards
6c6912123e clang-tidy: Add option to load CMake's clang-tidy module
Issue: #23912
2022-10-12 13:39:30 -04:00
Brad King
5f998bbcb3 Configure CMake itself with policies through CMake 3.24 2022-10-12 12:43:27 -04:00
Brad King
4b2e765025 Drop try_run macro from CMake's own build
Since commit 9199f7c627 (Disable arch-specific try_run in CMake itself,
2009-12-14, v2.8.2~567) we've abused an undocumented debugging feature
to override the builtin `try_run` command in CMake's own build with a
wrapper macro.  However, we've also long discouraged use of this feature
by other projects.  The purpose of the original change is outdated and
of limited use anyway, so just drop it.
2022-09-26 17:51:29 -04:00
Alex Turbov
14b94f9bf2 Build: Use string(APPEND…) in the root CMakeLists.txt 2022-09-22 09:24:49 -04:00
Alex Turbov
4c6a47c6b6 Build: Extract CMAKE_BUILD_UTILITIES macro into a separate include
The macro was one time used with the comment "Simply to improve readability...".
The result file doesn't have a macro anymore and just included into
the root `CMakeLists.txt`.
2022-09-22 09:24:49 -04:00
Alex Turbov
20b9808f90 Build: Use cmstd target instead of variable CMAKE_STD_LIBRARY 2022-09-22 09:24:49 -04:00
Alex Turbov
83491ddd43 Build: add_definitions()add_compile_definitions() 2022-09-22 09:24:48 -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
Brad King
d3c1b8a491 jsoncpp: Require version 1.6.0 when using system-provided library
We need the `ValueIterator::name()` method.
2022-08-18 15:49:08 -04:00
Kyle Edwards
bf7e3124cb Remove stale references to CMakeServerLib 2022-08-02 11:05:52 -04:00
Brad King
ac24f4d49b Configure CMake itself with policies through CMake 3.23 2022-06-14 15:05:09 -04:00
Brad King
14eb8a6ab9 libarchive: Simplify hard-coded options for build within CMake
Take advantage of policy CMP0077 NEW behavior to hard-code settings,
defined by `option()` calls in upstream libarchive, without adding
them to our cache.
2022-02-22 17:51:18 -05:00
Brad King
d6b811fb82 Require CMake 3.13+ to configure CMake itself
In particular, guarantee that policy `CMP0077` has `NEW` behavior.
This will be useful to hard-code options of third-party libraries
without polluting our own cache.
2022-02-22 17:50:06 -05:00
Brad King
be9ebc104a libarchive: Simplify code selecting CMake-specific build options
Reduce differences from upstream libarchive `CMakeLists.txt` code.
Remove modifications inside code we disable anyway.
2022-02-17 07:28:09 -05:00
Brad King
9a48012f93 Configure CMake itself with policies through CMake 3.22 2022-02-03 14:13:12 -05:00
Peter Würth
c050d6a01e string(TIMESTAMP): add %f specifier for microseconds
The %f specified extends the string(TIMESTAMP) and file(TIMESTAMP)
commands to output the timestamp with a microsecond resolution.
This convention is offered by python's datetime module.
Before, the precision was limited to seconds.

The implementation is done by extending existing cmTimestamp methods
with a `microseconds` parameter. This parameter is optional in order to
be backwards compatible. The timestamps are now received in a
cross-platform manner using libuv, since the standard C functions like
time() don't allow for sub-second precision.

This requires libuv 1.28 or higher.  We already require higher than
that on Windows, so update the required version for other platforms.

Implements: #19335
2022-01-28 06:23:57 -05:00
Duncan Ogilvie
9278c6e01a ccmake: Add Windows support using PDCurses 2022-01-18 16:35:39 -05:00
Brad King
bf11dab49d ccmake: Refactor BUILD_CursesDialog option logic
Move all the current logic behind `if(UNIX)` conditions to make room
for other platforms to be added.
2022-01-18 16:34:43 -05:00
makise-homura
3958ed878f LCC: Add policy CMP0129 regarding interpreting LCC as GNU
Due to MCST LCC compiler identification is now changed to LCC,
there should be a way for old projects to still identify it as GNU,
as it was before.
This commits adds the policy:
CMP0129: Compiler id for MCST LCC compilers is now LCC, not GNU.
This policy controls such a behavior.
OLD behaivior is to treat LCC as GNU, NEW is to treat is as LCC.
2021-10-21 17:24:22 +03:00
Brad King
d723bac01c Merge topic 'lcc-compiler'
02b2607a5c Help: Add release note for MCST LCC compiler support
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
2b9ef77944 CPack/DEB: deal with broken dpkg-shlibdeps on E2K architecture
0995c75301 Tests/RPM: skip tests tat rely on debugedit if it's not found
ea55ac9a51 Tests/RunCMake/CommandLine: Deal with locales that are different from English

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6608
2021-10-19 09:22:22 -04:00
makise-homura
e5d9fce03f LCC: Add dedicated support for MCST LCC compiler
Divert LCC compiler as a new one, instead of treating it as GNU.

Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been
passing checks for GNU compilers, so it has been identified as GNU.
Now, with intent of seriously upstreaming its support, it has been
added as a separate LCC compiler, and its version displays not a
supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead
of GNU 7.3.0).

This commit adds its support for detection, and also converts basically
every check like 'is this compiler GNU?' to 'is this compiler GNU or
LCC?'. The only places where this check is untouched, is where it
regards other platforms where LCC is unavailable (primarily non-Linux),
and where it REALLY differs from GNU compiler.

Note: this transition may break software that are already ported to
Elbrus, but hardly relies that LCC will be detected as GNU; still such
software is not known.
2021-10-15 05:05:19 +03:00
Brad King
40ade51cc8 Configure CMake itself with policies through CMake 3.21 2021-10-08 12:17:04 -04:00
Brad King
00199e96ef Merge topic 'disable-exec-info'
aa4c30182b Add option to explicitly avoid using execinfo for backtraces

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6386
2021-07-27 09:10:31 -04:00