Commit Graph

482 Commits

Author SHA1 Message Date
Roger Leigh
99c8abed55 kFreeBSD: Remove support for obsolete platform
kFreeBSD is no longer maintained or supported and was never an
officially-supported release architecture for Debian.

Closes: #26742
2025-03-05 11:57:49 -05:00
Brad King
00b6a4b592 bootstrap: Update copyright line extraction for reST markup in LICENSE.rst
Since commit 8d83487e60 (CONTRIBUTORS: Factor contributors list out of
license file, 2025-03-02) the copyright line has reStructuredText
markup.  Filter it out of the copyright line printed by `bootstrap`.
2025-03-05 06:48:39 -05:00
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
2d42a5444f LICENSE: Rename Copyright.txt to LICENSE.rst
The name `LICENSE` is now more conventional.
Format as reStructuredText to improve rendering.
2025-03-03 09:55:56 -05:00
Roger Leigh
4f0fb73816 libuv: Remove kvm dependency for all BSDs except NetBSD
This dependency is not expressed in upstream libuv.  It was added to
CMake by commit 6a497bb0a3 (libuv: Link with kvm on FreeBSD, 2016-09-08,
v3.7.0-rc1~143^2~1).  It is needed only on NetBSD.

Fixes: #26722
2025-02-24 14:31:28 -05:00
Brad King
292aaffb78 Source: Remove unused cmCommandArgument{Lexer,Parser}
These were used only for the CMP0053 OLD behavior, which has
now been removed.
2025-01-20 09:46:55 -05:00
Alex Turbov
bc8621d999
Fix: A lot of typos in code found by typos
Yet another great code spellchecker: https://github.com/crate-ci/typos/

(Will be added later as a `pre-commit` hook)
2025-01-12 18:49:34 +04:00
Alex Turbov
78e45c2db6
Style: Replace TABs with spaces for indentation in some files
Mark files that must use TABs to indent in the `.gitattributes`.
Use space instead of TABs in sources and some data/test files.
2025-01-12 18:49:25 +04:00
Matthew Woehlke
91c31ada23 find_package: Actually find .cps files
Add a helper class to read CPS files. Use this to teach find_package how
to consider and accept .cps files in its search. (Note that no version
testing is performed at this time.) Add a simple test that we can find a
package from a .cps file and correctly extract the version information.

Note that this doesn't actually import anything from CPS yet.
2024-12-13 08:58:24 -05:00
Daniel Pfeifer
1b8f9274b2 cmCommand: Remove
Finally. All commands are immutable.
2024-11-05 10:20:12 +01:00
Brad King
5ca6234d13 KWSys: Remove path translation map settings for build within CMake
They no longer exist in KWSys.
2024-11-04 10:00:10 -05:00
Brad King
73dddffe32 KWSys: Disable the path translation map for build within CMake
It is about to be removed from KWSys.
2024-11-03 08:32:46 -05:00
Brad King
1a6015e5fc PathResolver: Add helper to compute normalized paths
Create a `cm::PathResolver` helper to compute normalized paths.
Provide a common implementation with compile-time dispatch to
select details w.r.t. symbolic links, existence, and matching
the on-disk case of existing paths.  Later we can use this to
implement:

* `ToNormalizedPathOnDisk`: Normalizes paths while resolving symlinks
  only when followed by `..` components.  Does not require paths to
  exist, but reads on-disk case of paths that do exist (on Windows).

* `GetRealPath`: Normalizes paths while resolving all symlinks.
   Requires paths to exist, and reads their on-disk case (on Windows).

* `CollapseFullPath`: Normalizes paths in memory without disk access.
  Assumes components followed by `..` components are not symlinks.

Abstract filesystem access through runtime dispatch so that we can test
Windows symbolic link and network path behavior without relying on real
environments.  The overhead of runtime dispatch should be insignificant
during real filesystem access.

Issue: #16228
Issue: #17206
2024-11-01 08:44:17 -04:00
Ben Boeckel
4df5a6fbb4 cmBuildDatabase: add initial structures
This class represents a build database as introduced by P2977R0. It
includes support for reading, writing, and merging.

See: http://wg21.link/p2977r0
2024-08-27 12:36:46 -04:00
Brad King
262a89c92b Merge topic 'export-refactor-for-cps'
ff24058e46 export: Use std::all_of to collect exports
20fa4ce8d8 export: Factor out CMake-specific export generation (2/2)
6c66340a64 export: Fix const placement
1bceab3520 export: Factor out CMake-specific export generation (*/2)
a6cc595772 export: Factor out CMake-specific export generation (1/2)
0352376e44 export: Immediately report actual version required

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9646
2024-07-25 11:16:52 -04:00
Matthew Woehlke
20fa4ce8d8 export: Factor out CMake-specific export generation (2/2)
In order to support generation of Common Package Specifications, the
mechanisms CMake uses to export package information need to be made more
abstract. The prior commits began this refactoring; this continues by
(actually) restructuring the classes used to generate the actual export files.
To minimize churn, this introduces virtual base classes and
diamond inheritance in order to separate logic which is format-agnostic
but depends on the export mode (build-tree versus install-tree) from
logic which is format-specific but mode-agnostic.

This could probably be refactored further to use helper classes instead,
and a future commit may do that, however an initial attempt to do that
was proving even more invasive, such that this approach was deemed more
manageable.

While we're at it, add 'const' in more places where possible.
2024-07-23 12:13:39 -04:00
Brad King
6ed2c348f2 Merge topic 'bootstrap-no-pkg-config'
35eb28bc76 bootstrap: Restore support for system jsoncpp and uv without pkg-config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !9679
2024-07-23 09:52:09 -04:00
ojab ojab
35eb28bc76 bootstrap: Restore support for system jsoncpp and uv without pkg-config
In commit da5de7f9f3 (bootstrap: Allow --boostrap-system-* libraries
custom prefixes, 2024-03-03, v3.30.0-rc1~456^2) the non-pkg-config code
path for uv/jsoncpp/rhash all set `use_librhash_ldflags` instead of
their own variable.
2024-07-22 10:33:50 -04:00
Matthew Woehlke
a6cc595772 export: Factor out CMake-specific export generation (1/2)
In order to support generation of Common Package Specifications, the
mechanisms CMake uses to export package information need to be made more
abstract. As a first step toward this, refactor cmInstallExportGenerator
so that logic specific to config.cmake and Android .mk lives in separate
subclasses.

While we're at it, clean up the code style a bit and try to use moves a
bit more consistently.

This is step 1 of 2. The next step will refactor the individual file
generators along similar lines, which will also involve creating
additional classes for format-agnostic logic that is shared between
build-tree and install-tree variants.
2024-07-18 12:08:43 -04:00
Martin Duffy
5b3fbd5f64 cmSystemTools: Add CMake config directory 2024-07-03 09:34:41 -04:00
René Bertin
598bc70474 file: Add undocumented READ_MACHO subcommand on macOS
Provide a way to parse the architectures of a Mach-O binary.

Issue: #25952
2024-06-04 08:37:47 -04:00
Brad King
09c74c6d0c cmGeneratorTarget: Factor transitive property methods into own source 2024-05-20 19:29:15 -04:00
Brad King
feaca40931 cmGeneratorTarget: Factor link interface/impl methods into own source 2024-05-20 19:28:06 -04:00
Brad King
b4924c562a cmGeneratorTarget: Factor compatible interface properties into own source 2024-05-20 19:26:05 -04:00
Brad King
cdd7112a5d cmGeneratorTarget: Factor options-like usage requirements into own source 2024-05-20 19:24:48 -04:00
Brad King
881a46819e cmGeneratorTarget: Factor LINK_DIRECTORIES impl into own source 2024-05-20 19:23:13 -04:00
Brad King
0a3c97308d cmGeneratorTarget: Factor INCLUDE_DIRECTORIES impl into own source 2024-05-20 19:21:45 -04:00
Brad King
7ffb92022c cmGeneratorTarget: Factor SOURCES impl into own source 2024-05-20 19:20:21 -04:00
Brad King
d0fc932528 cmGeneratorTarget: Factor TargetPropertyEntry into own source 2024-05-20 19:16:57 -04:00
Brad King
ed983b1a5d cmTargetTraceDependencies: Factor out of cmGeneratorTarget 2024-05-20 19:12:19 -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
Alex Richardson
da5de7f9f3 bootstrap: Allow --boostrap-system-* libraries custom prefixes
If pkg-config is available, we can query it for the correct -l/-L flags.
This fixes the --boostrap-libuv build for me with libuv installed into
$HOME and PKG_CONFIG_PATH set appropriately
2024-03-03 23:08:35 -08:00
Brad King
6a5a9278fa librhash: Update build within CMake for rhash 1.4.4 2023-12-01 10:10:51 -05:00
Kyle Edwards
c6e6861e63 install(EXPORT): Export find_dependency() calls
Issue: #20511
Co-Authored-by: Brad King <brad.king@kitware.com>
Co-Authored-by: Robert Maynard <rmaynard@nvidia.com>
2023-11-13 11:07:52 -05:00
scivision
7662d50a1b bootstrap: update known compilers
como: Comeau-not updated since 2008, unlikely to work with CMake
icc: discontinued for icx
icc: not for C++, put in 20 years ago, probably never used / worked
2023-10-13 11:26:49 -04:00
Kyle Edwards
5420639a8d cmExecuteProcessCommand: Replace cmsysProcess with cmUVProcessChain 2023-08-29 10:51:30 -04:00
Brad King
0788accdfc Merge topic 'imported-cxxmodules'
48ee946fdc cmExperimental: recycle the C++ modules API UUID
1a1806a71b gitlab-ci: declare `bmionly` support for modules where possible
457a12f3f9 Tests/RunCMake/CXXModules: add tests which use modules from imported targets
9b9ec70b54 Ninja: generate scanning and build rules for C++20 module synthetic targets
80ef50a191 CXXModules: add a variable for BMI-only compilation
80d6544398 cxxmodules: generate synthetic targets as an initial pass
3dc6676ecc cmSyntheticTargetCache: add a struct for synthetic target caching
cb356b540c cmCxxModuleUsageEffects: add a class to capture module usage effects
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8535
2023-08-21 09:49:48 -04:00
Brad King
eee1dc10be libuv: Compile as C11 on all Solaris versions
Using `_XOPEN_SOURCE=600` on Solaris 5.10, as we do on Solaris 5.11+
already, allows the system headers to be included in C99 and C11 modes.
2023-08-18 16:13:21 -04:00
Ben Boeckel
cb356b540c cmCxxModuleUsageEffects: add a class to capture module usage effects
When importing a C++ module, there may be requirements imposed by the
importer so that the compiler can reliably read the BMI. For example,
the standard used in the importer may need to also apply to the imported
BMI.

Right now, there are no tracked requirements. As we learn more, this
class can start tracking more information.

See: https://wg21.link/p2581r2
2023-08-17 14:42:53 -04:00
Ben Boeckel
7b069510c5 cmImportedCxxModuleInfo: introduce code to parse exported BMI properties 2023-08-17 14:42:53 -04:00
Kyle Edwards
94241e243d cmJSONHelpers: Make error generators proper functions 2023-08-16 09:56:48 -04:00
Kyle Edwards
7050ac56a1 macOS: Add support for linking against .xcframework folders
Issue: #21752
2023-07-26 17:00:01 -04:00
Kyle Edwards
93ed53790c bootstrap: Unconditionally build libjsoncpp 2023-07-26 10:07:38 -04:00
Björn Esser
e4a9227360 bootstrap: Add --(no-)system-cppdap configuration switch
This was accidentally left out of commit 5ec69eb58c (cppdap: Build as
part of CMake or use external installation, 2023-05-19,
v3.27.0-rc1~45^2~1).
2023-06-08 14:56:07 -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
Cory Fields
db9af7e00c bootstrap: Add support for CXX containing flags
Rather than treating the user-provided CXX as a space-separated series of
compilers, treat it as a single command-line fragment which possibly
contains flags.
2023-05-08 17:25:59 -04:00
Cory Fields
2ead798f1d bootstrap: Add support for CC containing flags
Rather than treating the user-provided CC as a space-separated series of
compilers, treat it as a single command-line fragment which possibly
contains flags.
2023-05-08 17:25:55 -04:00
Cory Fields
9a72fed7af bootstrap: Do not over-quote compiler variables
They may contain flags.
2023-05-08 17:22:55 -04:00
Craig Scott
e245b4df75 Merge topic 'automoc-macro-names'
c5c3aff1f5 Autogen: Add INTERFACE_AUTOMOC_MACRO_NAMES target property
69cf9700e6 Autogen: Defer setup until Generate step
7cecb6353e cmGeneratorTarget: Factor out EvaluatedTargetProperty infrastructure
2daba01ddf cmGeneratorTarget: Avoid incidental include-what-you-use warning
850b4d990c IWYU: Add mapping for 'std::remove_reference<Defer &>::type'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8391
2023-04-10 18:06:06 -04:00
Orkun Tokdemir
7cecb6353e cmGeneratorTarget: Factor out EvaluatedTargetProperty infrastructure
Make it available outside the `cmGeneratorTarget` implementation.
In particular, we will later use it in `cmQtAutoGenInitializer`.
2023-04-05 16:12:15 -04:00