Commit Graph

12506 Commits

Author SHA1 Message Date
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
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
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
MACHIZAUD Andréa
2f46b8d723 FindVulkan: Move mark_as_advanced right after find_* calls. 2022-05-13 23:12:29 +02:00
MACHIZAUD Andréa
08a420af4a FindVulkan: Factorize code for library/executable search 2022-05-13 23:09:05 +02:00
Peter Würth
3f0b9663a4 FindZLIB: fix ZLIB_USE_STATIC_LIBS on Windows
- on Windows, the ZLIB_USE_STATIC_LIBS options requires a reordering of
  the search names in order to prefer the static library, since in most
  cases both static and shared libraries are built
- add zlibwapi[d] library name for the contrib/vstudio builds
- add lib prefix and .dll.a suffix for the win32/Makefile.gcc build

Fixes #23140
2022-05-13 18:26:27 +02:00
Brad King
ef7c0cb885 Merge topic 'FindGLUT-system-include-dirs'
8041ca5df0 FindGLUT: Fix GLUT_INCLUDE_DIRS with pkg-config and /usr/include

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7252
2022-05-13 08:52:04 -04:00
Brad King
300c91fecd Merge topic 'externalproject-uses-terminal-flags'
b1c2cb0436 ExternalProject: Make SVN interactive with USES_TERMINAL_{DOWNLOAD,UPDATE}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7248
2022-05-13 08:51:09 -04:00
Brad King
9529863f2a Merge topic 'FindPkgConfig-LIBRARY_PATH'
11c8da94d4 FindPkgConfig: Fix preservation of ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7258
2022-05-13 08:42:49 -04:00
Brad King
165208c784 Merge topic 'FindPkgConfig-LIBRARY_PATH' into release-3.23
11c8da94d4 FindPkgConfig: Fix preservation of ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7258
2022-05-13 08:42:48 -04:00
Brad King
968b5200a5 Merge topic 'FindPython-3.12'
ca2877c039 FindPython: add support for Python 3.12

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7255
2022-05-13 08:41:56 -04:00
Craig Scott
10865c8e5f FetchContent: Hard-code a config for the sub-build
If the main project overrides CMAKE_CONFIGURATION_TYPES such
that there is no Debug configuration, some multi-config generators
can fail because they might assume Debug by default (Visual Studio
might do this). Always specify the configuration for multi-config
generators so that we don't rely on any such defaults.

Fixes: #23177
2022-05-13 15:56:17 +10:00
Brad King
11c8da94d4 FindPkgConfig: Fix preservation of ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS}
Fix the ENV save/restore added by commit 36979f5b43 (FindPkgConfig:
Tolerate PKG_CONFIG_SYSTEM_LIBRARY_PATH in environment, 2021-07-13,
v3.22.0-rc1~407^2) to unset the variable if it was originally not set.

While at it, clarify the value to which we temporarily set it. The
`pkg-config` and `pkgconf` tools only check that the variable is set,
and do not care about the value.  Set it to a more true-looking value.

Issue: #22148
2022-05-12 13:18:24 -04:00
Letu Ren
8041ca5df0 FindGLUT: Fix GLUT_INCLUDE_DIRS with pkg-config and /usr/include
Fixes: #23474
2022-05-12 12:58:09 -04:00
Alex Birch
5cfbc76371 FindPkgConfig: Fix parsing of backslash-escaped spaces in pkg-config output
Treat backslash-escaped spaces as "space within argument" rather than
"space delimiting arguments".

Update our `FindPkgConfig_LIBRARY_PATH` test case to escape spaces in
the path, and run it unconditionally.
2022-05-12 12:26:04 -04:00
Michael Hirsch
ca2877c039 FindPython: add support for Python 3.12 2022-05-12 10:55:11 -04:00
Michael Durso Jr
b1c2cb0436 ExternalProject: Make SVN interactive with USES_TERMINAL_{DOWNLOAD,UPDATE}
ExternalProject_Add() supports USES_TERMINAL_* flags to enable user
input for different steps.  The Subversion download options ignored
these flags when checking out or updated a Subversion repo.

Fixes: #23348
2022-05-12 10:40:35 -04:00
Brad King
c67f0cd592 Merge topic 'doc-package-compatibility-mode'
a82163839a CMakePackageConfigHelpers: Fix note about version files supporting ranges

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7254
2022-05-12 09:28:16 -04:00
friendlyanon
a82163839a CMakePackageConfigHelpers: Fix note about version files supporting ranges
In commit 55c3b6a77e (CMakePackageConfigHelpers: Relax restrictions on
version range, 2019-05-30, v3.20.0-rc1~295^2~1) the documentation for
write_basic_package_version_file documented the support of version
ranges by the generated version files, however the note wrongly
specifies a COMPATIBILITY_MODE argument, instead of COMPATIBILITY.
2022-05-11 14:00:38 -04:00
Dmitry Kushpet
587d1942b5 FindOpenCL: Add support for version 3.0 2022-05-11 21:00:24 +03:00
Brad King
66aa34e529 Merge topic 'FindOpenSSL-qnx7.0'
e6656381aa FindOpenSSL: Support version 1.1.1 under QNX 7.0

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7232
2022-05-10 10:37:58 -04:00
Brad King
79b64690d9 Merge topic 'werror-property'
76a08cd253 COMPILE_WARNING_AS_ERROR: Add options to treat warnings as errors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Merge-request: !7187
2022-05-10 10:30:42 -04:00