Commit Graph

295 Commits

Author SHA1 Message Date
Frank Winklmeier
fb7a904e90 cmcmd: report system errors on more filesystem operations
Print the system error message in case of failure when calling
`CopyFileAlways`, `CopyFileIfDifferent`, `CopyFileIfNewer`,
`CopyADirectory` and `MakeDirectory`.

Remove unnecessary `cmSystemTools` wrappers for `CopyFileIfNewer` and
`CopyADirectory`.

Fixes: #18276
2025-11-12 11:53:35 -05:00
AJIOB
5de7a09e77 Tests/RunCMake: Match dots more precisely, part 3 2025-10-20 14:45:24 -04:00
AJIOB
62b112ee25 Tests/RunCMake: Match CMakeLists.txt file name more precisely 2025-10-16 17:42:12 +03:00
AJIOB
06ccd15457 Tests/RunCMake: Match xxx.cmake file name more precisely 2025-10-16 17:42:12 +03:00
Hanna Rusakovich
638cf8f194 Tests/RunCMake: Match CMakeLists.txt file name more precisely 2025-10-15 09:39:01 -04:00
Brad King
77ea15b797 Tests: Add case covering cmake -E env with empty environment variable
Issue: #27285
2025-10-08 11:17:20 -04:00
Brad King
596383a4fe Merge topic 'sequential-bom'
54161c70d5 cmListFileLexer: Do not require files to be seekable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !11162
2025-09-21 18:49:18 -04:00
Sergiu Deitsch
54161c70d5 cmListFileLexer: Do not require files to be seekable
Read the BOM sequentially and store the read bytes for later use if
these do not correspond to a BOM. This allows FIFO to be used as input,
e.g., for piping input or Bash process substitution.
2025-09-19 18:02:06 +02:00
Brad King
cd46d8ec84 Merge branch 'backport-vs2026' into vs2026 2025-09-15 11:33:57 -04:00
Brad King
3392b371e2 VS: Add Visual Studio 18 2026 generator
Closes: #27213
2025-09-15 11:31:02 -04:00
Benjamin Buch
8797912e4d cmake -E: Add copy_if_newer and copy_directory_if_newer
Fixes: #24923
2025-07-31 10:55:59 +02:00
Craig Scott
4315076f2e fileapi: Add codemodelVersion fields to target and directory objects
This will allow JSON schemas for these two types of files to describe the
version-specific content without requiring any outside information.

Fixes: #27031
2025-07-13 14:59:03 +10:00
Brad King
b10daadd08 Deprecate Visual Studio 14 2015 generator
Update documentation to mark the generator deprecated.  Add a warning at
the end of generation plus an option to turn off the warning.
2025-06-26 09:27:24 -04:00
Brad King
be6c582ef6 Merge topic 'normalize-toolchain-file'
c393300e2b cmake: Restore acceptance of -DCMAKE_TOOLCHAIN_FILE=//... on non-Windows
cf0f46ed85 Tests/RunCMake/CommandLine: Simplify --toolchain cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10901
2025-06-24 10:42:36 -04:00
Brad King
9c3ce7852f Merge topic 'normalize-toolchain-file' into release-4.1
c393300e2b cmake: Restore acceptance of -DCMAKE_TOOLCHAIN_FILE=//... on non-Windows
cf0f46ed85 Tests/RunCMake/CommandLine: Simplify --toolchain cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10901
2025-06-24 10:42:34 -04:00
Brad King
c393300e2b cmake: Restore acceptance of -DCMAKE_TOOLCHAIN_FILE=//... on non-Windows
POSIX specifies that two leading slashes have implementation-defined
interpretation, so CMake 3.31 and below did not normalize away leading
double slashes.  However, most implementations simply treat a leading
`//` as just `/`, so CMake 4.0 now normalizes them away when they do not
correspond to a network path on Windows.

This change exposed that we were not normalizing `CMAKE_TOOLCHAIN_FILE`
before passing its value to `include()` the first time if it was not
passed with the `FILEPATH` or `PATH` cache entry type.  Fix that.

Fixes: #27010
2025-06-23 10:37:59 -04:00
Brad King
cf0f46ed85 Tests/RunCMake/CommandLine: Simplify --toolchain cases 2025-06-23 10:23:11 -04:00
Brad King
9d1a0fa256 Merge topic 'normalize-input-paths'
cd4e72ca08 Normalize PWD environment variable before using it

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10659
2025-04-16 09:37:09 -04:00
Brad King
cd4e72ca08 Normalize PWD environment variable before using it
In commit 5aed3ee49d (cmSystemTools: Add GetLogicalWorkingDirectory,
2024-10-28, v4.0.0-rc1~528^2~6) we incorrectly trusted `PWD` to be a
normalized path so long as its realpath matches the current working
directory.

Fixes: #26870
2025-04-15 09:37:08 -04:00
Felipe Torrezan
c7d2a17253 IAR: Add support for C-STAT static analysis
The IAR platform offers an integrated static analysis tool named
IAR C-STAT.

Closes: #26844
2025-04-09 12:01:02 -04:00
Brad King
07970d3c64 Merge topic 'restore-home-tidle'
01f92efeb0 Restore expansion of leading '~' as home directory in input paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10580
2025-04-03 14:04:57 -04:00
Brad King
01f92efeb0 Restore expansion of leading '~' as home directory in input paths
This was accidentally dropped by commit 622596c6b2 (cmSystemTools:
Re-implement ToNormalizedPathOnDisk without translation map, 2024-10-30,
v4.0.0-rc1~528^2~5).  Previously it was done by `CollapseFullPath`.
`cm::PathResolver` intentionally does not expand `~` because it makes
sense only for transforming input paths.  Teach `ToNormalizedPathOnDisk`
to handle it directly.

Fixes: #26827
2025-04-02 14:41:48 -04:00
Nikita Nemkin
ddf7ebe06e cmake: Friendlier message when trying to --build the wrong dir
Also for --open.

Fixes: #11166
2025-02-07 10:56:05 -05:00
Peter Kokot
9f2efc3270 Remove optional arguments from else() and end*() commands
This adds a brief explanation of the optional condition in the `else()`
and removes all legacy usages of `else()` and `end*()` commands.
2025-01-28 03:01:23 +01:00
Brad King
1150fae89a CMP0053: Remove support for OLD behavior 2025-01-20 09:46:55 -05:00
Brad King
a62313b1dd Tests: Fix testing with MinGW without VS installed 2025-01-15 08:21:31 -05:00
Garrett Campbell
0a9fb88121 fileapi: Report DEBUGGER_WORKING_DIRECTORY in codemodel-v2 target objects
Closes: #16478
2024-12-10 09:04:31 -05:00
Brad King
6042b5164a Tests/RunCMake/CommandLine: Match initial cache paths more precisely 2024-10-22 11:21:10 -04:00
Brad King
f4aa34daa7 Tests/RunCMake: Update cmake_minimum_required versions to 3.10
For policy-specific tests, use the version before the policy was
introduced.  Otherwise, use 3.10 where possible.
2024-10-03 11:52:22 -04:00
Brad King
241f923a6f Drop Visual Studio 12 2013 generator
This generator has been deprecated since CMake 3.28.  Remove it.
2024-08-28 14:13:05 -04:00
Brad King
810e33f67a Tests: Simplify tests for Visual Studio generators
Since commit 03c31b0395 (Drop Visual Studio 9 2008 generator,
2024-05-06, v3.30.0-rc1~134^2), some tests do not need to be
version-dependent.
2024-08-28 14:12:54 -04:00
Brad King
077691942a Merge topic 'cmake-list-cached-variables'
c55239e286 cmake: Add flag to list cache entries matching a regex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9644
2024-07-24 10:00:30 -04:00
Min Hsu
c55239e286 cmake: Add flag to list cache entries matching a regex
Add a `-LR[A][H] <regex>` flag with similar functionality to `-L[A][H]`,
but instead of listing all cached variables, it show only specific
variables that match the name regex.
2024-07-23 10:19:22 -04:00
Martin Duffy
5b3fbd5f64 cmSystemTools: Add CMake config directory 2024-07-03 09:34:41 -04:00
Brad King
7330121467 Fix crash in target-specific commands called from initial cache script
Fixes: #26018
2024-06-01 06:28:26 -04:00
Brad King
03c31b0395 Drop Visual Studio 9 2008 generator
This generator has been deprecated since CMake 3.27.  Remove it.
2024-05-08 10:37:34 -04:00
Arctic Lampyrid
6116bcb066 fileapi: Add CONFIGURE_DEPENDS glob info to cmakeFiles object
Fixes: #25668
Co-authored-by: Brad King <brad.king@kitware.com>
2024-03-19 14:55:25 -04:00
Silvio Traversaro
06af18b9db cmake: Allow CMAKE_INSTALL_PREFIX to be set by environment variable
Fixes: #25023
2024-01-30 11:44:45 -05:00
Cristian Le
fa00928bcd file: STRINGS + REGEX store match results
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2024-01-09 16:36:55 -05:00
Ralf Habacker
80a64c9ce5 fileapi: Add cross-compiling emulator to codemodel-v2
Fixes: #25408
2023-12-01 10:57:15 -05:00
Brad King
530deed998 Merge topic 'cmake-E-cat-stdin'
ab72846794 cmake -E cat: Add ability to print standard input

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8942
2023-11-06 10:35:45 -05:00
Kyle Edwards
ab72846794 cmake -E cat: Add ability to print standard input 2023-11-03 09:03:25 -04:00
Kyle Edwards
c4be9c914b cmSystemTools::RunSingleCommand(): Pass stdin to child process
Fixes: #25383
2023-11-02 10:04:00 -04:00
Brad King
b3205afcde Merge topic 'help-arbitrary'
4e50320978 Help: Allow help for arbitrary keywords

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8674
2023-09-29 09:36:24 -04:00
Martin Duffy
4e50320978 Help: Allow help for arbitrary keywords
Changes `cmake --help [arg]` to search `Help/*/` instead of `Help/command/`
Allows editors to easily display manual for `<cword>`
2023-09-27 18:01:12 -04:00
scivision
ca77b745e9 cmake: Clarify error if -P script does not exist 2023-09-18 11:51:31 -04:00
Brad King
75b573a628 Deprecate Visual Studio 12 2013 generator
Update documentation to mark the generator deprecated.  Add a warning at
the end of generation plus an option to turn off the warning.
2023-06-26 12:41:18 -04:00
Brad King
536c1de1d4 Drop Visual Studio 11 2012 generator
This generator has been deprecated since CMake 3.25.  Remove it.
2023-06-13 14:20:48 -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
Marc Chevrier
b3a6a11e95 fileapi: Extend codemodel targets/compileGroups with Apple frameworks
Fixes: #19897
2023-05-19 12:10:20 +02:00