Commit Graph

7840 Commits

Author SHA1 Message Date
Brad King
577e693d3e Help: Use standard policy advice in CMP0000
This was missed in commit ad3c2c0b03 (Help: Normalize and consolidate
standard policy advice paragraph, 2024-01-11, v3.29.0-rc1~124^2~2).
2024-11-20 10:55:34 -05:00
Brad King
68d15b17c3 Merge topic 'ExternalProject-install-jobserver'
1bdaad7573 ExternalProject: Optionally integrate 'make' job server with INSTALL_COMMAND

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !10015
2024-11-20 09:33:04 -05:00
Brad King
100f411e3d Merge topic 'doc-cli-color'
d94e3eac10 Help: Clarify CLICOLOR and CLICOLOR_FORCE environment variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10016
2024-11-20 09:27:11 -05:00
Brad King
242702803f Merge topic 'doc-if-path'
3530eef3fb Help: Clarify that if(PATH_EQUAL) does not access the filesystem

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Marc Chevrier <marc.chevrier@gmail.com>
Merge-request: !10001
2024-11-20 09:25:29 -05:00
scivision
3530eef3fb Help: Clarify that if(PATH_EQUAL) does not access the filesystem
Fixes: #26421
2024-11-19 12:01:03 -05:00
Brad King
d94e3eac10 Help: Clarify CLICOLOR and CLICOLOR_FORCE environment variables
Document variable precedence.

Link to third-party documentation of the convention these follow.
For now, link to an older view of the documentation since our
implementation has not been updated for `NO_COLOR`.

Issue: #26458
2024-11-19 11:35:16 -05:00
Brad King
1bdaad7573 ExternalProject: Optionally integrate 'make' job server with INSTALL_COMMAND
Add an `INSTALL_JOB_SERVER_AWARE` option to `ExternalProject_Add`.
When using an explicit `INSTALL_COMMAND`, the generated commands
won't use `$(MAKE)` thus failing to connect to the outer make's
job server.  Add an option enable explicit job server integration.

This is the install step's equivalent to the build step's
`BUILD_JOB_SERVER_AWARE` option added by commit bc43398e72
(ExternalProject: Enable Make Job Server with Explicit Build Command,
2023-08-09, v3.28.0-rc1~217^2).  It is useful when the external
project's installation is driven by its build system.  Note that with
Makefile generators, our default install command does use `$(MAKE)` to
connect to the outer make's job server.

Issue: #26398
2024-11-19 10:22:24 -05:00
Brad King
908b2ca27c Merge topic 'doc-find-root-dir'
b431306f22 Help: Clarify the Xxx_ROOT_DIR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !10006
2024-11-19 10:20:40 -05:00
Brad King
1224fbce3f Help: Document CLICOLOR and CLICOLOR_FORCE environment variables
Issue: #26451
2024-11-18 13:00:22 -05:00
Craig Scott
30f596f417 Merge topic 'cmp0175-restore-USES_TERMINAL-for-TARGET-form'
62586f236c CMP0175: Do not reject USES_TERMINAL for add_custom_command(TARGET)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10005
2024-11-16 16:16:48 -05:00
Peter Kokot
b431306f22 Help: Clarify the Xxx_ROOT_DIR
The Xxx_ROOT_DIR is optional result variable set by find module when
package is found. It is the base directory of the Xxx installation. The
`Xxx_ROOT` is a hint variable set by the user where to look for the
`Xxx` package.
2024-11-16 21:51:43 +01:00
Craig Scott
62586f236c CMP0175: Do not reject USES_TERMINAL for add_custom_command(TARGET)
Fixes: #26449
2024-11-16 10:02:01 +11:00
Brad King
2c55b9c430 Merge topic 'patch-developer-docs'
c2f4183399 Help: Change PATHS to HINTS for pkg-config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9999
2024-11-15 09:09:41 -05:00
Brad King
51b35881e5 Merge topic 'doc-vs-old-toolsets'
d44a201004 Help: Clarify instructions for using older VS toolsets with newer VS versions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9997
2024-11-15 09:08:22 -05:00
Peter Kokot
c2f4183399 Help: Change PATHS to HINTS for pkg-config
When pkg-config is available and package is found with it, HINTS are a
better place where to hint the PC_Foo_* variables than PATHS. HINTS are
looked before the system default paths and those listed in PATHS.
2024-11-14 20:28:36 +01:00
Brad King
d44a201004 Help: Clarify instructions for using older VS toolsets with newer VS versions
Clarify that the newer version of VS must also be installed to use its
corresponding CMake generator.

Issue: #26446
2024-11-14 10:03:32 -05:00
Brad King
1e0cd39460 Merge topic 'link-warning-as-error'
7907c83175 Link step: Add LINK_WARNING_AS_ERROR target property
656267c871 COMPILE_WARNING_AS_ERROR: rename methods to prepare link similar functionality

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9984
2024-11-13 09:24:36 -05:00
Brad King
b14df1b4bb Merge topic 'FindSQLite3-pkg-config'
2d228201fc Help: Guard calls to pkg_check_modules in cmake-developer(7) example
674a987898 FindSQLite3: Guard calls to pkg_check_modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9983
2024-11-12 10:16:48 -05:00
Brad King
4f0eb0a41e Merge topic 'FindSQLite3-pkg-config' into release-3.31
2d228201fc Help: Guard calls to pkg_check_modules in cmake-developer(7) example
674a987898 FindSQLite3: Guard calls to pkg_check_modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9983
2024-11-12 10:16:46 -05:00
Marc Chevrier
7907c83175 Link step: Add LINK_WARNING_AS_ERROR target property
Add a way to specify, in a portable way, to raise an error for any
warning during the link step. For that purpose, define:
* CMAKE_LINK_WARNING_AS_ERROR variable
* LINK_WARNING_AS_ERROR target property

Fixes: #25343
2024-11-12 15:11:53 +01:00
Brad King
37035746e2 Merge topic 'doc-CMP0132'
aae8d604d5 Help: Add missing one-line summary to policy CMP0132

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9986
2024-11-11 13:55:19 -05:00
Peter Kokot
2d228201fc Help: Guard calls to pkg_check_modules in cmake-developer(7) example
This was missed in commit 25b947589a (Modules: Guard calls to
pkg_check_modules, 2024-08-07, v3.31.0-rc1~236^2).
2024-11-11 10:53:22 -05:00
Brad King
aae8d604d5 Help: Add missing one-line summary to policy CMP0132
This was missed in commit 05e510bf0b (CMP0132: Don't set compiler
environment variables on first run, 2022-03-23, v3.24.0-rc1~380^2).
2024-11-11 09:38:51 -05:00
Brad King
b89610b5fa Merge topic 'apple-compiler-selection'
7b19531291 macOS: Do not pass any SDK/-isysroot to compilers by default
3b8b70fe72 macOS: Simplify logic converting CMAKE_OSX_SYSROOT to a path
c55c113076 macOS: Revert finding tools inside Xcode that are not in the PATH
77fcee9204 macOS: Revert "Resolve compiler in /usr/bin to that reported by Xcode xcrun"
9eb530842c Tests/RunCMake/CMakePresets: Do not forward empty CMAKE_MAKE_PROGRAM
7fb14e707d Tests/RunCMake/XcFramework: Use macosx SDK in all multi-arch macOS cases
70ff1f15fc Tests/CTestTest*: Detect compiler from environment
1faf60cffc Tests/FortranC: Handle empty CMAKE_OSX_SYSROOT
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Acked-by: FX Coudert <fxcoudert@gmail.com>
Merge-request: !9977
2024-11-08 11:50:31 -05:00
Brad King
8353e6ab8d Merge topic 'vs-custom-command-disable-parallel-build'
4ee8705b12 VS: add source property VS_CUSTOM_COMMAND_DISABLE_PARALLEL_BUILD

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9958
2024-11-07 10:07:03 -05:00
Brad King
7b19531291 macOS: Do not pass any SDK/-isysroot to compilers by default
On modern macOS, compiler wrappers like `/usr/bin/cc` automatically
choose a SDK to pass via `-isysroot` to an underlying compiler from
Xcode or the CommandLineTools.  Other toolchains like Homebrew's `gcc-*`
come with a default SDK too.  Therefore, when targeting macOS, we no
longer need to choose any SDK or pass an `-isysroot` flag by default.

Update initialization of `CMAKE_OSX_SYSROOT` to be empty by default when
targeting macOS.

Fixes: #19180
2024-11-07 09:46:10 -05:00
Brad King
77fcee9204 macOS: Revert "Resolve compiler in /usr/bin to that reported by Xcode xcrun"
Revert commit 1f085e11e4 (OS X: Resolve compiler in /usr/bin to that
reported by Xcode xcrun, 2015-01-03, v3.2.0-rc1~126^2~1).  The compilers
in Xcode cannot be used by build systems that do not add an `-isysroot`
flag.

Issue: #19180
2024-11-07 09:46:09 -05:00
Darragh Coy
4ee8705b12 VS: add source property VS_CUSTOM_COMMAND_DISABLE_PARALLEL_BUILD
This boolean setting allows parallel building to be disabled for
individual source files built via `add_custom_command`. Using this
option is equivalent to setting policy `CMP0147` to the `OLD` behavior.

Closes: #26413
2024-11-06 13:29:57 -05:00
Marc Chevrier
35350c419d Add support of "LINKER:" prefix for CMAKE_<TYPE>_LINKER_FLAGS variable
The following variables now support the LINKER: prefix:
* CMAKE_<TYPE>_LINKER_FLAGS
* CMAKE_<TYPE>_LINKER_FLAGS_<CONFIG>

Fixes: #26171
2024-11-04 17:07:58 +01:00
Dylan Snelgrove
0a4ee422c1 ctest: Restore Windows Error Reporting in interactive mode
This behavior was removed when we switched to libuv in CMake 3.11.
After backporting new changes from libuv v2, we can restore the
behavior.

Fixes: #20115
2024-11-01 09:56:54 -04:00
Brad King
9c38c5c1d4 Merge topic 'aix-archive-shared-libraries'
4207687a5f Help: Update AIX_SHARED_LIBRARY_ARCHIVE for versioned shared objects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9954
2024-10-29 10:16:11 -04:00
Brad King
baceeb2c18 Merge topic 'aix-archive-shared-libraries' into release-3.31
4207687a5f Help: Update AIX_SHARED_LIBRARY_ARCHIVE for versioned shared objects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9954
2024-10-29 10:16:07 -04:00
Aditya Vidyadhar Kamath
4207687a5f Help: Update AIX_SHARED_LIBRARY_ARCHIVE for versioned shared objects
This was missed in commit dc8e4f8f0c (AIX: Enable versioned shared
objects with CMAKE_AIX_SHARED_LIBRARY_ARCHIVE, 2024-10-10,
v3.31.0-rc2~8^2).
2024-10-29 09:45:36 -04:00
Brad King
c9f320fdc6 Merge topic 'doc-CMP0174'
6aa2e22300 Help: Add 3.31 release note for cmake_parse_arguments CMP0174

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9955
2024-10-29 09:39:25 -04:00
Brad King
f4712b8af7 Merge topic 'doc-CMP0174' into release-3.31
6aa2e22300 Help: Add 3.31 release note for cmake_parse_arguments CMP0174

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9955
2024-10-29 09:39:24 -04:00
Brad King
1029cd338b Merge topic 'CMP0174-OLD-regression-repeated-keyword'
c8567acc32 cmake_parse_arguments: Restore capture of value after repeated keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9953
2024-10-29 09:38:15 -04:00
Peter Kokot
6aa2e22300 Help: Add 3.31 release note for cmake_parse_arguments CMP0174
This was left out by commit ceeea4e511 (cmake_parse_arguments: Set
variable if empty string given after keyword, 2024-08-18,
v3.31.0-rc1~175^2).
2024-10-28 09:51:27 -04:00
Craig Scott
c8567acc32 cmake_parse_arguments: Restore capture of value after repeated keyword
When a single-value keyword is repeated, and the first instance is
missing a value, it prevents the value from the second instance from
being stored in a variable. This was a regression introduced by
commit ceeea4e511 (cmake_parse_arguments: Set variable if empty string
given after keyword, 2024-08-18). That change also didn't create a
variable if the keyword was given but without a value. The purpose
of the change was to always define a variable if a keyword was given.
Lastly, that change didn't protect the CMP0174 logic to make it only
apply to the PARSE_ARGV form.

The first two of the above problems are fixed here by tracking the
keywords given instead of checking which keywords were missing
values. The third problem is also fixed here, being tightly coupled
to the same logic as the first two problems.

Fixes: #26397
2024-10-28 09:47:21 -04:00
Brad King
4f0c36ba41 Merge topic 'link-strategy'
39fd396421 LINK_LIBRARIES_STRATEGY: Rename strategies to clarify expectations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !9949
2024-10-28 09:14:40 -04:00
Brad King
f42962bfbf Merge topic 'link-strategy' into release-3.31
39fd396421 LINK_LIBRARIES_STRATEGY: Rename strategies to clarify expectations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !9949
2024-10-28 09:14:39 -04:00
Brad King
8779b1ad28 Merge branch 'backport-ci-fedora-41' into ci-fedora-41 2024-10-26 06:02:18 -04:00
Brad King
39fd396421 LINK_LIBRARIES_STRATEGY: Rename strategies to clarify expectations
Since commit 7abd3137b7 (Linking: Optionally reorder direct dependencies
from LINK_LIBRARIES, 2024-09-19, v3.31.0-rc1~53^2) the strategy name
`PRESERVE_ORDER` has led users to expect that it strictly preserves
order.  While the part of the link line generation logic controlled by
`LINK_LIBRARIES_STRATEGY` does preserve order, it is not the last step.
Toolchain-specific de-duplication can cause the order to change on the
actual link line generated in the build system.

Rename the strategies:

* `PRESERVE_ORDER` => `REORDER_MINIMALLY`
* `REORDER`        => `REORDER_FREELY`

The new names make it clear that reordering is always possible, just to
varying degrees.  Update the `LINK_LIBRARIES_STRATEGY` documentation to
clarify that the strategies do not directly control the final link line.

Fixes: #26400
Issue: #26271
2024-10-25 10:23:37 -04:00
Brad King
7605228f5e codespell: Fix typos 2024-10-25 08:43:04 -04:00
Brad King
e83535f5a3 Merge topic 'improve-package-search'
6f3dc1161a find_package: Also sort Framework matches
e90f60f864 find_package: Don't glob certain macOS paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9942
2024-10-25 08:25:34 -04:00
Brad King
0ba8bdb5c2 Merge topic 'doc-BUILD_TESTING'
9510820d58 Help: Document CTest module BUILD_TESTING variable
6e6e688b80 CTest: Improve formatting of documentation cmake code blocks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9927
2024-10-25 08:23:25 -04:00
Brad King
4cf0de3c3a Merge topic 'Help-CMAKE_LINK_DEPENDS_USE_LINKER'
686698a7b4 Help: Update note relative the GNU binutils linkers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9938
2024-10-25 08:13:04 -04:00
Brad King
8e99e70297 Merge topic 'Help-CMAKE_LINK_DEPENDS_USE_LINKER' into release-3.31
686698a7b4 Help: Update note relative the GNU binutils linkers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9938
2024-10-25 08:13:02 -04:00
Matthew Woehlke
6f3dc1161a find_package: Also sort Framework matches
Add cmAnyDirectoryListGenerator, which matches any directory but also
sorts matches in the same manner as cmProjectDirectoryListGenerator.
Modify SearchFrameworkPrefix to use this, in combination with a literal
path (cmAppendPathSegmentGenerator), instead of cmFileListGeneratorGlob
(which is removed, as it is no longer used). This improves the
consistency of when sorting is available.

This uses cmDirectoryListGenerator's new ability to match anything, as
mentioned in the previous commit.
2024-10-24 13:42:42 -04:00
Robert Maynard
9510820d58 Help: Document CTest module BUILD_TESTING variable
The `BUILD_TESTING` variable is referenced in `add_test` and
`enable_testing`.  It should be documented as it controls the
behavior tests working when projects use `include(CTest)`.
2024-10-24 11:46:37 -04:00
Marc Chevrier
686698a7b4 Help: Update note relative the GNU binutils linkers 2024-10-24 17:02:15 +02:00