Commit Graph

14126 Commits

Author SHA1 Message Date
Marc Chevrier
c164404b2e FindPython: On Windows, Enhance python debug version support
Add the following variables:
* Python_EXECUTABLE_DEBUG
* Python_INTERPRETER
* Python_DEBUG_POSTFIX

and target Python::InterpreterDebug.

python_add_library() command Manage DEBUG_POSTFIX target property based
on the value of Python_DEBUG_POSTFIX variable.

Fixes: #25874
2024-05-09 19:08:47 +02:00
Brad King
617884e78a Merge topic 'cxx-inspect-without-scanning'
6df925b595 cxxmodules: Do not scan sources while testing the compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !9494
2024-05-07 08:34:05 -04:00
Brad King
6df925b595 cxxmodules: Do not scan sources while testing the compiler
The C++ sources we use to test the compiler do not use modules.
Avoid requiring a compiler that can scan just to enable the language,
even when CMP0155 is NEW.  The project may explicitly turn off
`CMAKE_CXX_SCAN_FOR_MODULES` before adding any targets.

Fixes: #25956
2024-05-06 13:59:27 -04:00
Brad King
557908ecfa Merge topic 'FindBoost-remove'
e0355c4ea9 FindBoost: Add policy to remove this module

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Christoph Grüninger <foss@grueninger.de>
Merge-request: !9488
2024-05-06 09:25:49 -04:00
Brad King
de8df1da17 Merge topic 'cpack-support-all-component-names'
d7e2fede03 CPack: Add tests for component containing problematic characters
a1af593291 CPack: Support arbitrary component name when packaging
9e67ad47a9 cmLocalGenerator: Support arbitrary component name when installing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9436
2024-05-06 09:22:45 -04:00
Brad King
e0355c4ea9 FindBoost: Add policy to remove this module
Upstream Boost 1.70 and above provide a proper `BoostConfig.cmake`
package configuration file.  Packages for all major distros now
provide it in at least one LTS release.  Add a policy to pretend
that the `FindBoost` module does not exist so that projects calling
`find_package(Boost)` use the upstream package directly.

Closes: #19402
2024-05-03 10:30:23 -04:00
Brad King
1027c0e213 Merge topic 'cxxmodules-no-import-std-reason'
e89e819398 Tests/CXXModules: add tests for C++26 `import std` support
6dad18f060 cxxmodules: give a reason for unavailability of `import std`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9486
2024-05-03 09:26:39 -04:00
Ben Boeckel
6dad18f060 cxxmodules: give a reason for unavailability of import std
If the `CMAKE_CXX<STANDARD>_COMPILER_IMPORT_STD_NOT_FOUND_MESSAGE`
variable is set, include its value in the error message.
2024-05-02 14:46:51 -04:00
Brad King
65196e2e3a Merge topic 'FindICU-cleanup'
9221448327 FindICU: remove noise, cleanup components handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9481
2024-05-02 09:37:00 -04:00
Brad King
fc188e35d1 Merge topic 'fphsa-before-project'
68a8c89430 FPHSA: Add hint for failure when called before project()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9480
2024-05-02 09:35:51 -04:00
Brad King
1d8848c4ce Merge topic 'FindOpenMP-runtime-msvc'
b07c637e42 FindOpenMP: Add option to control OpenMP runtime with MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9475
2024-05-02 09:34:29 -04:00
Deniz Bahadir
a1af593291 CPack: Support arbitrary component name when packaging
CPack no longer blindly tries to create temporary packaging
(sub)directories that contain the verbatim name of a component, which
might contain characters that are not supported on the platform /
filesystem.
Instead, if the component's name contains a (possibly) problematic
character its MD5 hash will be used for that temporary packaging
(sub)directory.

Likewise, if the component's name resembles a reserved device name (e.g.
"COM1" on Windows) then the temporary packaging (sub)directory will get
this name prefixed with an underscore.
Similar, if it ends in a dot (on Windows) then the temporary packaging
(sub)directory will get this name suffixed with an underscore.

Fixes: #23612
2024-05-01 19:20:32 +02:00
Brad King
68a8c89430 FPHSA: Add hint for failure when called before project()
Help project authors recognize an ordering mistake.

Inspired-by: Jeremy Rifkin @jeremy-rifkin
Closes: #25941
2024-05-01 11:25:28 -04:00
Osyotr
9221448327 FindICU: remove noise, cleanup components handling
Fixes: #25892
2024-05-01 10:27:25 -04:00
Brad King
e6d04030d1 Merge topic 'simplify-and-clean-up-some-cpack-functions'
208b3f63ac CPackDeb.cmake: Fix debug message
48fc711064 cmLocalGenerator: Fix comments in generated cmake_install.cmake file
af1d166387 cmCPackGenerator: Fix debug message in function `PrepareGroupingKind`
a522abe5c0 cmCPackGenerator: Fix comment in function `InstallCMakeProject`
87cfe9dd91 cmCPackGenerator: Slightly simplify function `InstallProject`
1350ed96ff cmCPackGenerator: Clean up and simplify function `DoPackage`
d26eed4c75 cmCPackGenerator: Clean up and simplify function `PrepareNames`
12123b5b6b cmCPackGenerator: Refactor copying of package files into own function
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9457
2024-05-01 09:26:33 -04:00
Brad King
cab2a6634d Merge topic 'lang-standard-latest'
7c38e6bb52 Add CMAKE_<LANG>_STANDARD_LATEST variables
fddb165c6c AppleClang: Fix Objective C 23 support detection
1dff17108d Modules: Fix ARMClang and TIClang language standard compile options

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9314
2024-05-01 09:20:47 -04:00
Brad King
80d285c080 Merge topic 'FindHDF5-version-4-components'
928943f91b FindHDF5: Fix detection of versions with more than three components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9476
2024-05-01 09:16:20 -04:00
Axel Huebl
b07c637e42 FindOpenMP: Add option to control OpenMP runtime with MSVC
The MSVC compiler's `-openmp` flag accepts `:{experimental,llvm}`
values.  Add an option to specify one.

Closes: #25570
2024-05-01 08:25:14 -04:00
Deniz Bahadir
208b3f63ac CPackDeb.cmake: Fix debug message 2024-04-30 18:36:26 +02:00
مهدي شينون (Mehdi Chinoune)
928943f91b FindHDF5: Fix detection of versions with more than three components
Fix detecting the version of HDF5 1.14.4.2.

Fixes: #25945
2024-04-30 11:22:41 -04:00
Tyler
7c38e6bb52 Add CMAKE_<LANG>_STANDARD_LATEST variables
Add a variable to indicate the latest standard known to be supported for
each language:

* `CMAKE_C_STANDARD_LATEST`
* `CMAKE_CXX_STANDARD_LATEST`
* `CMAKE_CUDA_STANDARD_LATEST`
* `CMAKE_HIP_STANDARD_LATEST`
* `CMAKE_OBJC_STANDARD_LATEST`
* `CMAKE_OBJCXX_STANDARD_LATEST`

These variables, more generally referred to as
`CMAKE_<LANG>_STANDARD_LATEST`, are assigned an integer value which
represents the minimum between the latest version of the associated
language standard supported by the current compiler and the latest
version supported by CMake.

Add documentation for these variables in a new page called
`CMAKE_<LANG>_STANDARD_LATEST` was added under the "Variables for
Languages" section of the `cmake-variables(7)` page.

Update each compiler-specific CMake script under
`${CMAKE_ROOT}\Modules\Compiler` to manually define the relevant
`CMAKE_<LANG>_STANDARD_LATEST` variable as necessary. This will
require updating and maintaining as newer compiler versions become
recognized by CMake.

Closes: #25717
2024-04-30 11:05:03 -04:00
Tyler Nichols
fddb165c6c AppleClang: Fix Objective C 23 support detection
Set the requirement for Objective C 23 support for AppleClang to
`11.0.3` in `${CMAKE_ROOT}\Modules\Compiler\AppleClang-OBJC.cmake`.
This is consistent with the requirement for C 23 support as
indicated in `${CMAKE_ROOT}\Modules\Compiler\AppleClang-C.cmake`.
2024-04-30 11:05:03 -04:00
Tyler Nichols
1dff17108d Modules: Fix ARMClang and TIClang language standard compile options
Unset irrelevant compile option variables in the following scripts:
  * `${CMAKE_ROOT}\Modules\Compiler\ARMClang-C.cmake`
  * `${CMAKE_ROOT}\Modules\Compiler\TIClang-C.cmake`
  * `${CMAKE_ROOT}\Modules\Compiler\TIClang-CXX.cmake`

These scripts all include either
`${CMAKE_ROOT}\Modules\Compiler\Clang-C.cmake` or
`${CMAKE_ROOT}\Modules\Compiler\Clang-CXX.cmake`, and those scripts
will set various compile option variables based on what the
standard version of Clang supports. However, these do not
necessarily apply to ARMClang and TIClang. This commit thus
explicitly unsets all of the compile option variables which are not
manually defined for these compilers.
2024-04-30 11:05:03 -04:00
xavisolesoft
6f77077feb ExternalProject: Retry download for error code 35
This error code indicates a TLS handshake failure, which we've
observed intermittently when downloading artifacts from GitHub.
2024-04-25 13:08:24 -04:00
René Bertin
f65a6d2cb1 GNU: Do not use "fat-lto-objects" flags for IPO on Apple platforms
Fat LTO objects contain both traditional object code and the LTO bitcode
IR, but the GNU compiler does not support them on Apple platforms.
A compile error is raised when `-f[no-]fat-lto-objects` flags are used,
so avoid them.

This also implies that static Fortran libraries cannot be built with IPO.

Fixes: #25931
2024-04-24 16:57:36 -04:00
Brad King
5ec306fb13 FindCUDAToolkit: Replace a documentation link with its permanent redirect 2024-04-23 08:02:54 -04:00
Brad King
805af4f3ad Merge topic 'msvc-wine-import-std'
abb33568e6 cxxmodules: Support `import std` for msvc-wine

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !9450
2024-04-23 07:57:30 -04:00
Brad King
9eb4ae4f64 Merge topic 'check-pthreads-static'
b4f17e5b44 FindThreads: Fix pthreads detection with -Wmissing-prototypes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9449
2024-04-23 07:56:45 -04:00
Brad King
3d8d13f4bc Merge topic 'pkg_get_variable-list'
9ddef32ba0 FindPkgConfig: Fix parsing of quoted lists with pkgconf <1.5.1

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9447
2024-04-23 07:55:17 -04:00
David Benjamin
b4f17e5b44 FindThreads: Fix pthreads detection with -Wmissing-prototypes
If the project builds with `-Wmissing-prototypes` to catch unnecessarily
exported symbols, `CheckForPthreads.c` will fail to build.  Fix this by
marking `start_routine` as static.

Fixes: #25886
2024-04-22 09:51:41 -04:00
Brad King
8b3d48ab94 Merge topic 'save-restore-PACKAGE_PREFIX_DIR'
41f4e1c457 CMakePackageConfigHelpers: Document PACKAGE_PREFIX_DIR for public use
c5231ba29e find_package: Save/restore PACKAGE_PREFIX_DIR
8ac7958e3a generate_apple_*_selection_file: Save/restore PACKAGE_PREFIX_DIR
bf88879f1f generate_apple_architecture_selection_file: Avoid early returns
a4ac2c92f4 Help: Add missing section heading for apple architecture selection
b7fcc44be9 Help: Fix CMakePackageConfigHelpers typos, grammar and formatting
f1cacaa830 Tests/RunCMake/CMakePackage: Define variable closer to where it is used

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9430
2024-04-22 08:42:13 -04:00
Brad King
8f44e1a07b Merge topic 'save-restore-PACKAGE_PREFIX_DIR' into release-3.29
8ac7958e3a generate_apple_*_selection_file: Save/restore PACKAGE_PREFIX_DIR
bf88879f1f generate_apple_architecture_selection_file: Avoid early returns
a4ac2c92f4 Help: Add missing section heading for apple architecture selection
b7fcc44be9 Help: Fix CMakePackageConfigHelpers typos, grammar and formatting
f1cacaa830 Tests/RunCMake/CMakePackage: Define variable closer to where it is used

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9430
2024-04-22 08:42:12 -04:00
Brad King
cba96f59d5 Merge topic 'cuda-std'
fb0990ef04 Tests/CompileFeatures: Cover cuda_std_## meta-features
011f3d1dd3 Tests/CompileFeatures: Fix c_std_23 case with Clang < 14
1f40604421 Tests/CompileFeatures: Cover CUDA default standard level
138436609f CUDA: Fix detection of default C++ standard level with MSVC host compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9444
2024-04-22 08:25:26 -04:00
huangqinjin
abb33568e6 cxxmodules: Support import std for msvc-wine 2024-04-21 20:40:52 +08:00
Kerem Aksu
9ddef32ba0 FindPkgConfig: Fix parsing of quoted lists with pkgconf <1.5.1
Unquote pkg-config output if they are printed within quotes. pkgconf
<1.5.1 and classic pkg-config <0.29.1 prints quoted variables without
unquoting them, this breaks returning variables with multiple values
as a list behavior of CMake.

Add a new test case for pkg_get_variable with multiple values to test
list behavior and backslash escaped spaces within variable values.

Fixes: #25904
2024-04-20 21:03:56 +03:00
Craig Scott
41f4e1c457 CMakePackageConfigHelpers: Document PACKAGE_PREFIX_DIR for public use
This variable has long been provided by `configure_package_config_file`
in the `@PACKAGE_INIT@` part of the package configuration file it
generates.  Although not publicly documented, projects have come to
use it.  Now that we preserve the value across nested `find_package`
calls, it has a stable meaning.

Issue: #25827
2024-04-20 10:05:40 +10:00
Craig Scott
8ac7958e3a generate_apple_*_selection_file: Save/restore PACKAGE_PREFIX_DIR
Issue: #25827
2024-04-19 11:41:12 -04:00
Craig Scott
bf88879f1f generate_apple_architecture_selection_file: Avoid early returns
This refactoring makes the generated file follow the same structure as
generate_apple_platform_selection_file(). It uses a single if-elseif-else-endif
block rather than a sequence of if-endif blocks. This avoids any early
return() calls, allowing cleanup code to be added at the end later.
2024-04-19 18:17:19 +10:00
Craig Scott
a4ac2c92f4 Help: Add missing section heading for apple architecture selection 2024-04-19 18:17:19 +10:00
Craig Scott
b7fcc44be9 Help: Fix CMakePackageConfigHelpers typos, grammar and formatting 2024-04-19 18:17:19 +10:00
Ben Boeckel
678717f3e4 cxxmodules: provide a detection variable for import std 2024-04-18 09:53:21 -04:00
Brad King
138436609f CUDA: Fix detection of default C++ standard level with MSVC host compiler 2024-04-18 08:30:38 -04:00
Brad King
9bf79a7964 Merge topic 'lang-std-c++26'
1ba4a06338 GNU: Add flags for C++26 modes
2038f2c2b1 C++26: Support detection as the default standard

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9434
2024-04-17 09:15:34 -04:00
Brad King
56f333ef2f Merge topic 'lang-std'
dcbc2ef00d CompilerId: Clarify CUDA, HIP, ObjC, ObjC++ standard level detection
cf457fbf9c CompilerId: Drop MSVC conditions from ObjC and ObjC++
f606a27e8d ObjCXX: Fix detection of C++20 default compiler mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !9438
2024-04-17 08:44:58 -04:00
Brad King
9bb04d65a8 Merge topic 'FindBoost-1.85'
0d5953b373 FindBoost: Add support for Boost 1.85

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9435
2024-04-17 08:41:10 -04:00
Raul Tambre
1ba4a06338 GNU: Add flags for C++26 modes
Flags added in GCC commit `5388a43f6a3` (c++: Add support for
-std={c,gnu}++2{c,6}, 2023-06-22).
2024-04-16 15:34:57 -04:00
Raul Tambre
2038f2c2b1 C++26: Support detection as the default standard
This was missed in commit f808d8afb9 (CMake: Support upcoming C++26
language level, 2022-08-19, v3.25.0-rc1~218^2).
2024-04-16 15:34:57 -04:00
Brad King
dcbc2ef00d CompilerId: Clarify CUDA, HIP, ObjC, ObjC++ standard level detection
Use named constants.  Regularize comparison patterns.  Follow the
approach from commit b9d4db7098 (CompilerId: Clarify C and C++ standard
level detection, 2024-04-02).
2024-04-16 15:31:36 -04:00
Brad King
cf457fbf9c CompilerId: Drop MSVC conditions from ObjC and ObjC++
MSVC does not compile these languages.
2024-04-16 15:21:35 -04:00
Raul Tambre
f606a27e8d ObjCXX: Fix detection of C++20 default compiler mode
Fix a typo from commit 9f3c70a333 (CUDA, CXX, OBJCXX: C++23 support with
Clang 12, 2020-12-04, v3.20.0-rc1~321^2).
2024-04-16 15:21:34 -04:00