Commit Graph

14213 Commits

Author SHA1 Message Date
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
Brad King
0d5953b373 FindBoost: Add support for Boost 1.85
Update the list of known versions.

Run the command

    cmake -DBOOST_DIR=/path/to/boost_1_85_0 \
      -P Utilities/Scripts/BoostScanDeps.cmake

to extract dependencies from the 1.85.0 source tree.
They are the same as 1.84's dependencies, so just update
the version check for warning about newer versions.

Fixes: #25905
2024-04-16 10:01:00 -04:00
Brad King
8f7049112d Merge topic 'nag-fortran-ninja'
4af20bb794 NAG-Fortran: Do not repeat preprocessing with Ninja on Apple platforms
91bb8dd872 NAG-Fortran: Fix MODULE library creation on Apple platforms
e056006116 NAG-Fortran: Tell the Ninja generator how to preprocess Fortran sources
765a611956 NAG-Fortran: Added initial default compilation flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9407
2024-04-16 08:53:56 -04:00
Brad King
f494bbaf8f Merge topic 'FindBacktrace-imported-library'
9433755e5d FindBacktrace: Add imported library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9406
2024-04-16 08:51:59 -04:00
Brad King
e9fcec6ac1 Merge topic 'findgtk2-fix'
7e49b98219 FindGTK2: Find arch-specific headers via pkg-config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9417
2024-04-16 08:50:45 -04:00
Brad King
1c9e514d28 Merge topic 'swift-module-libraries'
56e5cea600 Swift: Support module libraries with command-line build systems

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9379
2024-04-16 08:47:11 -04:00
Simon Maertens
4af20bb794 NAG-Fortran: Do not repeat preprocessing with Ninja on Apple platforms
The Ninja generator uses separate preprocessing and compilation steps.
Do not pass `-fpp` when compiling an already-preprocessed source.

Issue: #25900
2024-04-15 13:48:15 -04:00
Simon Maertens
91bb8dd872 NAG-Fortran: Fix MODULE library creation on Apple platforms
Previously we passed `-bundle` to the NAG Fortran front-end, which
does not support it.  Pass it through to the linker instead.
2024-04-15 13:35:08 -04:00
Simon Maertens
e056006116 NAG-Fortran: Tell the Ninja generator how to preprocess Fortran sources
Fixes: #21398
2024-04-15 13:33:30 -04:00
Simon Maertens
765a611956 NAG-Fortran: Added initial default compilation flags
The configuration of the NAG Fortran compiler was previously missing the
standard flags for debug, release and the other build types.
2024-04-15 13:32:06 -04:00
David Faure
9433755e5d FindBacktrace: Add imported library
This is to avoid (a future version of) Qt from having to wrap
FindBacktrace like [1].

[1] https://code.qt.io/cgit/qt/qtbase.git/tree/cmake/FindWrapBacktrace.cmake
2024-04-15 13:27:23 -04:00
Maxim Cournoyer
7e49b98219 FindGTK2: Find arch-specific headers via pkg-config
Fixes: #25884
2024-04-15 12:19:35 -04:00
Evan Wilde
56e5cea600 Swift: Support module libraries with command-line build systems
Wire up the flags needed to support module libraries built and used with
Swift. We need to pass `-bundle` to the linker when linking module
libraries on Darwin, and we need to pass `-export-dynamic` to the linker
when emitting an executable that exports symbols on Linux. This patch
wires up `CMAKE_SHARED_MODULE_CREATE_Swift_FLAGS` and
`CMAKE_SHARED_MODULE_LOADER_Swift_FLAG` on Darwin, and hooks up
`CMAKE_EXE_EXPORTS_Swift_FLAG` on Linux in order to support passing
things correctly.

We can't expose `CMAKE_EXE_LINKER_FLAGS` to Swift, as it contains flags
that the Swift compiler doesn't recognize, but the other
language-specific variables are safe to expose.
2024-04-15 08:23:39 -07:00
Brad King
ca449572ef Merge topic 'cxxmodules-import-std'
429902ebad Clang: support creating a target for imported modules
4617f272b4 MSVC: support `import std`
62a71047bb cmGraphVizWriter: ignore `__cmake_`-prefixed targets
442086c1dc fileapi: ignore `__cmake_`-prefixed targets
ffe74289b3 CMakeDetermineCompilerId: extract C++ standard library impl
15bbd1d9b8 Experimental: add an experimental feature gate for `import std`
f80c60df02 CMakeDetermineCompilerSupport: construct C++ modules targets
19341e2582 ci: enable `import_std23` C++ module tests on MSVC
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9337
2024-04-15 09:56:53 -04:00