Commit Graph

12525 Commits

Author SHA1 Message Date
Brad King
3715c154c8 Merge topic 'FindOpenSSL3_applink'
4a6caef9d5 FindOpenSSL: Set version variables for version >= 3.0.0

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7305
2022-06-03 09:43:53 -04:00
Brad King
16ad65c5a2 Merge topic 'envmod'
fcddb1cd5f FindEnvModules: BUGFIX: env_module_swap OUTPUT_VARIBLE

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7315
2022-06-03 09:43:05 -04:00
Brad King
ac2952792a Merge topic 'GNUInstallDirs-opt-homebrew'
8de3983b4c GNUInstallDirs: Do not treat /opt/homebrew as under /opt

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7318
2022-06-03 09:41:37 -04:00
James Calo
4a6caef9d5 FindOpenSSL: Set version variables for version >= 3.0.0
The variables `OPENSSL_VERSION_MAJOR`, `OPENSSL_VERSION_MINOR` and
`OPENSSL_VERSION_FIX` are now set to the correct values when using
OpenSSL version >= 3.0.0, which uses a new format.
2022-06-02 11:14:45 -04:00
Brad King
8de3983b4c GNUInstallDirs: Do not treat /opt/homebrew as under /opt
Fixes: #23579
2022-06-02 10:04:35 -04:00
Craig Scott
c2044fdf3f FetchContent: Respect the CMP0135 policy setting
Fixes: #23560
2022-06-02 11:10:27 +10:00
Michael Hirsch
fcddb1cd5f FindEnvModules: BUGFIX: env_module_swap OUTPUT_VARIBLE
Since originally added to CMake, env_module_swap(OUTPUT_VARIABLE)
did not give output since the incorrect variable name was used.
2022-06-01 16:50:44 -04:00
Marc Chevrier
e8ce8f0858 Merge topic 'findjava'
3acbe073ba FindJava: improve failure/verbosity when 'java -version' fails

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7299
2022-06-01 08:11:37 -04:00
Seth R Johnson
3acbe073ba FindJava: improve failure/verbosity when 'java -version' fails
On macOS monterey, `java -version` returns
```
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

```
which does not match the existing regex. Instead of hitting a fatal error if required,
reset the variable and let FindPackage handle the result.

If `QUIET` is requested, don't print anything if the version query fails. Otherwise, print the message.

Additionally, clean up temporary variables set by the execute_process commands.
2022-05-31 07:34:49 -04:00
Brad King
49e31d9c55 Merge topic 'msvc-compilers-default-to-ZI'
5fcadc481e MSVC: Default to -ZI instead of /Zi for x86 and x64

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7295
2022-05-27 09:10:43 -04:00
Brad King
9019537670 MSYS/MinGW Makfiles: Select the compiler occurring first in PATH
Extend the change from commit e01990999a (Ninja: On Windows, select the
compiler occurring first in PATH, 2020-04-17, v3.18.0-rc1~291^2) to
apply to the MSYS/MinGW Makefiles generators too.  Drop the implied
`gcc` and `g++` default compilers.  This allows MinGW/Clang environments
to work out of the box.

Inspired-by: Mehdi Chinoune <mehdi.chinoune@hotmail.com>
Fixes: #23542
2022-05-26 13:22:58 -04:00
Glen Chung
5fcadc481e MSVC: Default to -ZI instead of /Zi for x86 and x64
Add a policy for compatibility.

For more information, see [1].

[1] https://docs.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format?view=msvc-170

Fixes: #10189
2022-05-26 09:06:01 -04:00
Brad King
711496b672 Merge topic 'LLVMFlang-compiler'
85749766df LLVMFlang: Add support for LLVM Flang

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7246
2022-05-26 08:52:02 -04:00
Brad King
5dcf505f63 Merge topic 'dependency-providers'
2aa83fa15b Dependency providers: Add find_package and FetchContent support
8a28368feb FetchContent: Don't discard non-empty SOURCE_DIR and BINARY_DIR
8ce9bb8a0c FetchContent: Don't leak internal variables
74a6ddc339 cmFindPackageCommand: Handle Makefile variable definitions more robustly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Gerhard Olsson <gerhard.nospam@gmail.com>
Merge-request: !7276
2022-05-25 07:24:48 -04:00
Brad King
7120221e24 Merge topic 'cpack-component-special-chars'
11ac6751a8 CPack: Support component names with special characters, too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7290
2022-05-25 07:20:58 -04:00
Craig Scott
2aa83fa15b Dependency providers: Add find_package and FetchContent support
Fixes: #22619
2022-05-25 08:46:18 +10:00
Deniz Bahadir
11ac6751a8 CPack: Support component names with special characters, too
The macros `cpack_append_variable_set_command` and
`cpack_append_string_variable_set_command` became functions, in order to
support arguments with special characters (e.g. `:`).
2022-05-24 19:07:36 +02:00
Tin Huynh
85749766df LLVMFlang: Add support for LLVM Flang
LLVM Flang (https://github.com/llvm/llvm-project/tree/main/flang) is an LLVM
Fortran compiler that shares the same name as Flang (also known as Classic
Flang). Classic Flang is in active development and is already identified by
CMake as Flang. As such, LLVM Flang will be identified as `LLVMFlang`.

Fixes: #22387
2022-05-24 10:37:33 -04:00
Brad King
f791cd23d4 Merge topic 'findvulkan-moltenvk'
d9b4264cb8 FindVulkan: Add component for `MoltenVK`
10a6bb16bb FindVulkan: Mark test target with `cxx_std_11` to avoid AppleClang warnings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7286
2022-05-24 10:10:46 -04:00
Brad King
846e2a2b5b Merge topic 'externalproject-cleanup'
3351b7b82c ExternalProject: Reformatting only
691f0c7612 ExternalProject: Minor cleanup to use more convenient commands
b4db306aff ExternalProject: Remove unused property docs
5c021c8355 ExternalProject: Replace SEND_ERROR with FATAL_ERROR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7285
2022-05-23 09:02:18 -04:00
Brad King
1b30958719 Merge topic 'pkgconfig-static-libs'
020976d637 FindPkgConfig: Populate _STATIC_LINK_LIBRARIES. Add STATIC_TARGET.
3c5cc79adb Tests: De-duplicate some code in RunCMake.FindPkgConfig
5cfbc76371 FindPkgConfig: Fix parsing of backslash-escaped spaces in pkg-config output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7070
2022-05-23 09:01:00 -04:00
MACHIZAUD Andréa
d9b4264cb8 FindVulkan: Add component for MoltenVK 2022-05-23 00:16:32 +02:00
Craig Scott
3351b7b82c ExternalProject: Reformatting only
- Rewrap docs and commands to 80 character width, as per
  code guidelines.
- Reformat argument lists across multiple lines to improve
  readability.
- Use consistent closing parentheses on multi-line calls.
- Clean up indenting.
2022-05-23 07:36:41 +10:00
Craig Scott
691f0c7612 ExternalProject: Minor cleanup to use more convenient commands
There is no effective functional change with this commit. It is mostly
just to simplify readability.
2022-05-23 07:36:23 +10:00
Craig Scott
b4db306aff ExternalProject: Remove unused property docs
BRIEF_DOCS and FULL_DOCS became optional as of edb5059216
(define_property(): Make BRIEF_DOCS and FULL_DOCS optional,
2022-01-18). Remove these options from the define_property()
calls, since they served no useful purpose. The canonical
documentation of those properties is in the RST docs at the top of
the file.
2022-05-23 07:36:15 +10:00
Craig Scott
5c021c8355 ExternalProject: Replace SEND_ERROR with FATAL_ERROR
The one remaining SEND_ERROR is still needed because further messages
must be written before a final FATAL_ERROR on that code path.
2022-05-23 07:36:04 +10:00
Alex Birch
020976d637 FindPkgConfig: Populate _STATIC_LINK_LIBRARIES. Add STATIC_TARGET.
Add LINK_LIBRARIES test to demonstrate static linking of transitive
dependencies.

Add STATIC_TARGET argument to pkg_check_modules() and pkg_search_module().
Influences the properties of target produced by IMPORTED_TARGET.
When enabled: target's properties will be populated from <XXX>_STATIC_*
variables instead of from <XXX>_* variables.

Update existing tests concerning properties of targets produced via
IMPORTED_TARGET, to test STATIC_TARGET variant too.
Update existing tests concerning <XXX>_* variables to test <XXX>_STATIC_*
variables too.

Breaking changes to pkg_check_modules() and pkg_search_module():
- Variables CMAKE_FIND_LIBRARY_PREFIXES and CMAKE_FIND_LIBRARY_SUFFIXES can no
longer be used to influence library lookup (i.e. the internal call to
find_library()), because FindPkgConfig now internally relies on these
variables to differentiate between shared and static library lookup.
Prefer CMAKE_SHARED_LIBRARY_PREFIX + CMAKE_SHARED_LIBRARY_SUFFIX, or
CMAKE_STATIC_LIBRARY_PREFIX + CMAKE_STATIC_LIBRARY_SUFFIX, depending on
whether you wish to impact static or shared lookup.
- <XXX>_LINK_LIBRARIES will now be populated only with libraries
located via CMAKE_SHARED_LIBRARY_PREFIX + CMAKE_SHARED_LIBRARY_SUFFIX match
- <XXX>_STATIC_LIBRARIES now processes -framework options
- <XXX>_STATIC_LDFLAGS_OTHER now processes -framework options
- <XXX>_STATIC_CFLAGS_OTHER now processes -isystem options
- <XXX>_STATIC_INCLUDE_DIRS now processes -isystem options

Fixes: #21714
2022-05-20 09:45:12 -04:00
Brad King
92c7c2c39a Merge topic 'findvulkan-improvements'
7974fcd1a7 FindVulkan: remove noop on CMAKE_MODULE_PATH in tests
acdb5fe0e8 FindVulkan: Add component for `glslc` and `glslangValidator`
998ee49779 FindVulkan: ensure policy CMP0057 is NEW to use `IN_LIST` with `if()`
9f8720e74c FindVulkan: Add component for `glslang`
8d133f49e3 FindVulkan: Add component for `SPIRV-Tools`
6e4d20921d FindVulkan: Add component for `shaderc_combined`
2f46b8d723 FindVulkan: Move `mark_as_advanced` right after `find_*` calls.
08a420af4a FindVulkan: Factorize code for library/executable search

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7225
2022-05-20 09:08:44 -04:00
Brad King
48a303e6f4 Merge topic 'cpack-nuget-components-on-windows'
066ff258db CPack/NuGet: Restore component packaging on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7280
2022-05-19 09:39:59 -04:00
MACHIZAUD Andréa
acdb5fe0e8 FindVulkan: Add component for glslc and glslangValidator
For backward compatibility with previous CMake versions they are implicitly added to the list of components
2022-05-18 23:16:11 +02:00
MACHIZAUD Andréa
998ee49779 FindVulkan: ensure policy CMP0057 is NEW to use IN_LIST with if() 2022-05-18 23:16:11 +02:00
MACHIZAUD Andréa
9f8720e74c FindVulkan: Add component for glslang 2022-05-18 23:16:09 +02:00
MACHIZAUD Andréa
8d133f49e3 FindVulkan: Add component for SPIRV-Tools 2022-05-18 23:15:50 +02:00
MACHIZAUD Andréa
6e4d20921d FindVulkan: Add component for shaderc_combined 2022-05-18 23:15:48 +02:00
Alex Turbov
066ff258db CPack/NuGet: Restore component packaging on Windows
The change from `\` to `/` in commit dade75509f (CPack/NuGet: Fix nuspec
file generation for UNIX-style OS, 2020-12-21, v3.20.0-rc1~243^2) does
not work on Windows.  Use `cmake_path` to form a path to an image
directory with preinstalled files.

Fixes: #22489
2022-05-18 11:12:02 -04:00
Craig Scott
8a28368feb FetchContent: Don't discard non-empty SOURCE_DIR and BINARY_DIR 2022-05-18 23:28:10 +10:00
Craig Scott
8ce9bb8a0c FetchContent: Don't leak internal variables 2022-05-18 23:25:42 +10:00
Brad King
59b3e97720 Merge topic 'clang-imsvc'
faed1562fb Merge branch 'backport-3.23-clang-imsvc' into clang-imsvc
23a52561c7 Clang: Use -imsvc flag without space to support Clang tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Acked-by: hihig2001 <hihig@bluehole.net>
Merge-request: !7274
2022-05-18 08:02:10 -04:00
Brad King
6daf38dec6 Merge topic 'FindGLUT-remove-undocumented-vars'
6c053e68df FindGLUT: Remove undocumented variables GLUT_INCLUDE_PATH and GLUT_LIBRARY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7273
2022-05-18 08:00:48 -04:00
Brad King
334f7ac87f Merge topic 'fetchcontent-subbuild-config-type-fix'
82f3ceb26b FetchContent: Use Debug rather than Release for sub-build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7272
2022-05-18 07:58:50 -04:00
Brad King
faed1562fb Merge branch 'backport-3.23-clang-imsvc' into clang-imsvc 2022-05-17 11:20:15 -04:00
Brad King
23a52561c7 Clang: Use -imsvc flag without space to support Clang tools
Since commit bb61c2d024 (Clang: use -imsvc for system include dirs when
running on Windows, 2020-09-16, v3.19.0-rc1~162^2) we use the `-imsvc`
flag followed by the include directory as a separate argument.  Some
versions of `clang-tidy` do not support the flag unless the include
directory is attached to it, so use that form instead.

A similar fix was made by commit 3a8b6653dc (MSVC: Use -external:I flag
without space to support Clang tools, 2022-01-11, v3.22.2~8^2).

Fixes: #23517
2022-05-17 11:09:15 -04:00
Letu Ren
6c053e68df FindGLUT: Remove undocumented variables GLUT_INCLUDE_PATH and GLUT_LIBRARY
Fixes: #23370
2022-05-17 09:08:12 -04:00
Brad King
e561e29e04 Merge topic 'findzlib-static'
3f0b9663a4 FindZLIB: fix ZLIB_USE_STATIC_LIBS on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7262
2022-05-17 08:52:09 -04:00
Brad King
2ef9865f09 Merge topic 'FortranCInterface-gcc12'
cb616d43d6 FortranCInterface: Fix failure with gfortran 12 and Clang

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7266
2022-05-17 08:47:31 -04:00
Brad King
e05a476700 Merge topic 'FortranCInterface-gcc12' into release-3.23
cb616d43d6 FortranCInterface: Fix failure with gfortran 12 and Clang

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7266
2022-05-17 08:47:30 -04:00
Craig Scott
82f3ceb26b FetchContent: Use Debug rather than Release for sub-build
The config used can be part of the path to the sub-build. On some
platforms, there are restrictions on the length of paths or file names.
Use Debug rather than Release because the former is shorter.
When CMAKE_CONFIGURATION_TYPES is left at its default, this also
makes the path the same as the previous default before 10865c8e5f
(FetchContent: Hard-code a config for the sub-build, 2022-05-01) .
2022-05-17 14:42:31 +10:00
Brad King
cb616d43d6 FortranCInterface: Fix failure with gfortran 12 and Clang
The C flags added by commit 6a0ce19ce1 (FortranCInterface: Fix
compatibility with GCC gfortran 12 LTO, 2022-01-19, v3.22.2~5^2)
should only be added for the GNU C compiler.

Fixes: #23500
Issue: #23123
2022-05-16 11:18:00 -04:00
Brad King
c4ed5341c4 Merge topic 'CMAKE_PROJECT_TOP_LEVEL_INCLUDES'
a6c34b0353 project(): Add new CMAKE_PROJECT_TOP_LEVEL_INCLUDES file injection point
8aa29a1793 CMakeDetermineSystem: Remove unreachable code

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7250
2022-05-16 09:26:59 -04:00
Craig Scott
7a390edefb Merge topic 'fetchcontent-subbuild-config-type'
10865c8e5f FetchContent: Hard-code a config for the sub-build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7228
2022-05-16 07:33:35 -04:00