Commit Graph

10956 Commits

Author SHA1 Message Date
Brad King e524819483 Merge topic 'automoc-path-prefix-off' into release-3.18
5b5be34811 Help: Add 3.18.2 release note about AUTOMOC_PATH_PREFIX default change
db659e18bc Merge branch 'backport-3.17-automoc-path-prefix-off'
e503fbe38a Merge branch 'backport-3.16-automoc-path-prefix-off'
4c33b305a0 Autogen: Turn off moc path prefix generation by default
56510b7d85 Merge branch 'backport-test-FindPkgConfig-isolate-env' into release-3.17
effc9a1032 Merge branch 'backport-3.17-automoc_timestamp_deps' into release-3.17
507fecd7e2 Merge branch 'ninja-multi-rsp-remove-path' into release-3.17

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5105
2020-08-11 08:51:01 -04:00
Marc Chevrier 951640f1f9 FindPython: manage SOABI for all Python versions
Fixes: #21070
2020-08-11 10:16:40 +02:00
Thomas Bernard f24e34975a ExternalProject: retry download on recoverable errors
In order to shorten the download failure of ExternalProject download
steps, a download retry is only done when a recoverable network
error is encountered.
2020-08-11 07:25:58 +02:00
Seth R Johnson e038107ee7 FindHDF5: fix compiler detection when HL is disabled
A valid HDF5 installation with the "high level" extensions not
configured will *fail* to be correctly detected by CMake since
commit d9e39f3f89 (FindHDF5: check that compiler wrapper can
compile a minimal program, 2020-02-10, v3.18.0-rc1~744^2~1):

```
/.../hdf5/cmake_hdf5_test.c:2:10: fatal error: 'hdf5_hl.h' file not found
```

This does not stop the configuration but does prevent flags and
libraries from being recognized.
2020-08-10 11:53:58 -04:00
Brad King 0953c0051e Merge topic 'clang-cl-vfs'
20ebaed972 Clang: Add support for passing VFS arguments
d993ebd4ca clang-cl: Add '--' before source file
a94672b919 cmake: Change cmake_llvm_rc separator from -- to ++ to avoid conflict

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5087
2020-08-10 11:33:19 -04:00
Brad King 69d26f1502 Merge topic 'FPHSA-name-mismatches-chained-via-include'
98844ec9db FPHSA: detect inclusion between find modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Logan Barnes <barneslt63@gmail.com>
Merge-request: !5107
2020-08-10 11:25:10 -04:00
Brad King b8214a87bf Merge topic 'FPHSA-name-mismatches-chained-via-include' into release-3.18
98844ec9db FPHSA: detect inclusion between find modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Logan Barnes <barneslt63@gmail.com>
Merge-request: !5107
2020-08-10 11:25:09 -04:00
Brad King cb1f2cf093 Merge topic 'FindRuby-restore-include-path' into release-3.18
6959744131 FindRuby: Restore compatibility variable RUBY_INCLUDE_PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5109
2020-08-10 11:21:20 -04:00
Brad King d8e242a779 Merge topic 'FindRuby-restore-include-path'
6959744131 FindRuby: Restore compatibility variable RUBY_INCLUDE_PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5109
2020-08-10 11:21:20 -04:00
Brad King 97717d4f37 Merge topic 'FindPython-user-policies'
a92d384548 FindPython: ensure user's policies are respected

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Henry Schreiner <henryschreineriii@gmail.com>
Merge-request: !5098
2020-08-10 11:19:18 -04:00
Brad King b88fb7eec6 Merge topic 'FindPython-user-policies' into release-3.18
a92d384548 FindPython: ensure user's policies are respected

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Henry Schreiner <henryschreineriii@gmail.com>
Merge-request: !5098
2020-08-10 11:19:17 -04:00
Brad King db659e18bc Merge branch 'backport-3.17-automoc-path-prefix-off' 2020-08-10 10:49:18 -04:00
Brad King e503fbe38a Merge branch 'backport-3.16-automoc-path-prefix-off' 2020-08-10 10:41:06 -04:00
Joerg Bornemann 4c33b305a0 Autogen: Turn off moc path prefix generation by default
Change the default value of `CMAKE_AUTOMOC_PATH_PREFIX` to `OFF` to
restore compatibility with behavior of CMake 3.15 and below.

C++ source files that are generated by Qt's meta object compiler (moc)
include the header file that was passed as input argument to moc. This
is usually a path relative to the source directory, for example

    #include "../../source/dir/myobject.h"

That is problematic for reproducible builds as described in #18815.
To cope with that, the target property AUTOMOC_PATH_PREFIX was
introduced in CMake 3.16 by commit d018d27c10 (Autogen: Add moc path
prefix generation (AUTOMOC_PATH_PREFIX), 2019-09-13, v3.16.0-rc1~94^2~4).
The property is default-initialized from the variable
`CMAKE_AUTOMOC_PATH_PREFIX`, which defaults to `ON`.

If this property is ON, and myobject.h is located in an include
directory of the target, moc-generated C++ files include the file
without the "path prefix":

    #include "myobject.h"

This behavior, however, can break projects that have equally named
header files in different include directories.  As "not breaking
existing projects" trumps "have reproducible builds by default" we
change the default of `CMAKE_AUTOMOC_PATH_PREFIX` to `OFF`.

Also, it is now possible to pass `-DCMAKE_AUTOMOC_PATH_PREFIX=ON` on the
CMake command line.  Before, it was overridden in `CMakeGenericSystem`.

Fixes: #20598
Issue: #18815
2020-08-10 10:36:17 -04:00
Gregor Jasny 5852b8867f CMakeIOSInstallCombined: Enforce disjoint architecture sets
Starting with Xcode 12 the arm64 architecture is supported
as an iOS device as well as simulator architecture.

But the fat macho file format does not distinguish by SDK,
only by architecture. That makes lipo (rightfully) complain
that it cannot add both architectures to a single file.

To work around we make sure that both SDKs are built for a
disjoint set of architectures. If an architecture is present
for both SDKs we prefer the currently configured one.

The log output has been extended to reflect that:

```
[iOS combined] Architectures (iphoneos): arm64 arm64e armv7 armv7s
[iOS combined] Architectures (iphonesimulator): arm64 arm64e i386 x86_64
[iOS combined] Architectures (iphonesimulator) after pruning: i386 x86_64
```
2020-08-08 15:22:12 +02:00
Seth R Johnson c156704ff0 FindLAPACK: Use find_package_handle_standard_args
LAPACK previously used custom and verbose output messages.
2020-08-07 13:08:30 -04:00
Brad King 6959744131 FindRuby: Restore compatibility variable RUBY_INCLUDE_PATH
Since commit e672db628b (FindRuby: Rename variables to match case of
module name, 2020-03-11, v3.18.0-rc1~546^2), the result variables named
with the old `RUBY_` prefix are provided by compatibility code that maps
from the new `Ruby_` prefix variables.  There is no `Ruby_INCLUDE_PATH`
variable, so do not try to map it to `RUBY_INCLUDE_PATH`.  The latter is
provided by dedicated compatibility code left from before that
transition.

Fixes: #21064
2020-08-07 12:40:26 -04:00
Thomas Bernard d993ebd4ca clang-cl: Add '--' before source file
On Linux and macOS, absolute paths start with `/` which may be
interpreted by clang-cl as an option.  To avoid this, we separate the
source file path from preceding options with `--` to tell `clang-cl` it
is not an option.
2020-08-07 11:48:48 -04:00
Thomas Bernard a94672b919 cmake: Change cmake_llvm_rc separator from -- to ++ to avoid conflict 2020-08-07 11:47:15 -04:00
Brad King d8f7a05b37 Merge topic 'cygwin-patches'
ecc1961768 FindTclsh: Drop Cygwin-specific behavior and use POSIX code path
af666acdf4 FindOpenGL: Drop Cygwin-specific behavior and use POSIX code path
8edbc59e46 install: Use case-sensitive pattern matching on Cygwin
24482499ea FindPerlLibs: Add versioned perl library name for Cygwin

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5092
2020-08-07 11:05:39 -04:00
Brad King 304f159af4 Merge topic 'CUDAToolkit-no-nvcc'
7cc815a2a6 CUDAToolkit: Detect CUDA SDK that don't have nvcc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: Raul Tambre <raul@tambre.ee>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5061
2020-08-07 11:04:54 -04:00
Ben Boeckel 98844ec9db FPHSA: detect inclusion between find modules
Various find modules include each other to delegate finding some subset
or variant of the package. Ideally, these would use `find_dependency` or
some other actual `find_package` mechanism, but that is a larger change.
Instead, just detect inclusion and suppress FPHSA name mismatch
warnings.

Fixes: #21060
2020-08-07 09:41:38 -04:00
Marc Chevrier a92d384548 FindPython: ensure user's policies are respected
Do not set the policy version before recording our internal macros such
as `__Python_add_library`.  Otherwise callers get our policy version
instead of theirs.  Instead just set the specific policies we need.

Also fix one case in our test suite where we were accidentally
relying on the policy version to be set by `FindPython`.

Fixes: #21042
2020-08-07 09:24:18 -04:00
Lemures Lemniscati ecc1961768 FindTclsh: Drop Cygwin-specific behavior and use POSIX code path
Based on downstream patch from Cygwin package for CMake by Marco Atzeri:

* https://github.com/matzeri/cygwin-pkg/blob/64864eb8f0d635ea44226e4b9a41a7ca59a1c7dd/cmake/3.17.3-findtclsh.patch
2020-08-06 12:37:16 -04:00
Lemures Lemniscati af666acdf4 FindOpenGL: Drop Cygwin-specific behavior and use POSIX code path
Based on downstream patch from Cygwin package for CMake by Marco Atzeri:

* https://github.com/matzeri/cygwin-pkg/blob/64864eb8f0d635ea44226e4b9a41a7ca59a1c7dd/cmake/3.17.3-opengl.patch
2020-08-06 12:36:55 -04:00
Lemures Lemniscati 24482499ea FindPerlLibs: Add versioned perl library name for Cygwin
Based on downstream patch from Cygwin package for CMake by Marco Atzeri:

* https://github.com/matzeri/cygwin-pkg/blob/64864eb8f0d635ea44226e4b9a41a7ca59a1c7dd/cmake/perl-libs.patch
2020-08-06 12:35:56 -04:00
Brad King 4daf76e10a Merge topic 'compiler_flags'
f76c20da63 Toolchain: Test compiler initial settings
db486da265 Toolchain: Update documentation for initial compiler flags
deec2f587c Toolchain: Take CMAKE_<lang>_FLAGS_INIT into account during compiler detection
ca899af3e2 Toolchain: Handle repeated invocations of CMake with -DCMAKE_C_COMPILER
12ba89e142 Toolchain: Make `/path/comp;-argn' behave the same as 'comp;-argn'
6f1af899db Toolchain: Capture all arguments from CMAKE_<LANG>_COMPILER
ec1d3bc0b6 cmake: avoid exception when printing "changed variables" message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4136
2020-08-06 11:00:12 -04:00
Brad King fdcb7483d1 Merge topic 'UseSWIG-support-files-in-subdirectories'
50e53eaed9 UseSWIG: Take care of support files in sub-directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5097
2020-08-06 10:53:36 -04:00
Brad King ab2366609e Merge topic 'support_list_google_test_executor'
8829d2caba GoogleTest: Restore support for list arguments in TEST_EXECUTOR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5084
2020-08-06 10:37:03 -04:00
Marc Chevrier 50e53eaed9 UseSWIG: Take care of support files in sub-directories
Fixes: #20833
2020-08-04 16:19:10 +02:00
Laurits Riple 8829d2caba GoogleTest: Restore support for list arguments in TEST_EXECUTOR
Refactoring in commit 889a7146ff (GoogleTestAddTests: Refactor into
callable method, 2020-03-16, v3.18.0-rc1~450^2~3) accidentally
parsed `TEST_EXECUTOR` as a single-value argument instead of a list.
2020-08-03 12:10:58 -04:00
Robert Maynard 7cc815a2a6 CUDAToolkit: Detect CUDA SDK that don't have nvcc
When a CUDA sdk doesn't have nvcc, defer to the existence of
a version.txt file. When we do this fall back we also reconstruct
the CUDA version via version.txt

Fixes #20643
2020-07-30 15:56:52 -04:00
Robert Maynard 59ece01e6c ASM: Remove unneeded empty variables 2020-07-30 13:46:18 -04:00
Brad King 533a6256a3 Merge topic 'clang-msvc-cxx-std' into release-3.18
21e497fe63 Clang: Fix fallback compile features when simulating old MSVC versions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5082
2020-07-30 08:39:58 -04:00
Brad King 3d27b17347 Merge topic 'clang-msvc-cxx-std'
21e497fe63 Clang: Fix fallback compile features when simulating old MSVC versions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5082
2020-07-30 08:39:58 -04:00
Brad King 6152011cd0 Merge topic 'GoogleTest-fix-generated-include'
832858195e GoogleTest: Fix include path in the generated file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5063
2020-07-30 08:27:11 -04:00
Brad King 21e497fe63 Clang: Fix fallback compile features when simulating old MSVC versions
Refactoring in commit 25439c7d62 (Clang: Refactor CXX standard flags
into __compiler_clang_cxx_standards(), 2020-03-16, v3.18.0-rc1~362^2~4)
accidentally broke the `cxx_std_*` fallback feature names.

Issue: #21033
2020-07-29 13:02:21 -04:00
Fred Baksik deec2f587c Toolchain: Take CMAKE_<lang>_FLAGS_INIT into account during compiler detection
Fixes: #20040
2020-07-29 11:51:27 -04:00
Fred Baksik 12ba89e142 Toolchain: Make `/path/comp;-argn' behave the same as 'comp;-argn'
When using `cmake ... -DCMAKE_C_COMPILER=gcc;-pipe` first invocation of
CMake worked correctly.

When using `cmake ... -DCMAKE_C_COMPILER=/path/to/gcc;-pipe` first
invocation  of CMake detected a change to CMAKE_C_COMPILER, printed "You
have changed variables" message, and re-ran the initial compiler tests
after configuration was complete and before generation of the project
files.

The difference was due to the cache being forced updated with the new
value of CMAKE_C_COMPILER so that the comparison check passes.
2020-07-29 11:51:18 -04:00
Brad King 37e27aa552 Merge topic 'fixup_bundle_item-fix'
45ed314bff BundleUtilities: do not run install_name_tool on scripts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5071
2020-07-29 08:12:25 -04:00
Brad King b7522e48a4 Merge topic 'use_COMPILER_TARGET_to_set_architecture_for_clang_cl'
270e0d9c4d Detect the correct target architecture for clang compilers.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5058
2020-07-29 08:11:50 -04:00
Brad King 292a86bb8e Merge topic 'FindCURL-list-index-if'
0faedae335 FindCURL: Fix list index check after search

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5070
2020-07-29 08:05:47 -04:00
Adam Badura 832858195e GoogleTest: Fix include path in the generated file
The generated ..._include.cmake file contained an inclusion of
GoogleTestAddTests without any path. In general, this is a good
approach since it enables to correctly catch possibly
user-customized files.

However, in this case, it didn’t work this way since the
..._include.cmake file is evaluated by a separate CMake call under
a custom command. Because of this, the CMAKE_MODULE_PATH is not set
as expected by the user and the said inclusion catches CMake own
version of the module rather than the possibly user-customized one.

This change fixes this by making the inclusion with an absolute path
determined upon the ..._include.cmake file generation.
2020-07-28 23:49:20 +02:00
Thomas Bernard 270e0d9c4d Detect the correct target architecture for clang compilers.
During compiler identification, if CMAKE_{C,CXX}_COMPILER_TARGET is
defined, the corresponding clang target flag is used to guaranty proper
target architecture detection.
2020-07-28 19:48:47 +02:00
T.J. Corona 45ed314bff BundleUtilities: do not run install_name_tool on scripts
Use the same approach as commit 08be74bfd7 (GetPrerequisites: Fix
handling of executable scripts, 2018-12-16, v3.14.0-rc1~206^2).
2020-07-28 10:35:51 -04:00
Mike Gelfand 0faedae335 FindCURL: Fix list index check after search
Fix logic added by commit fc5afbe970 (FindCURL: support COMPONENTS to
check features, 2018-11-28, v3.14.0-rc1~287^2~2).

When searching for particular components and `curl-config` reports one of
the components being searched for first in the list, `find_package` fails.
This is due to the check that treats non-zero index in the list as success
and zero index as failure, while documentation on `list(FIND)` states that
failure to find an element results in return value of -1 (not 0). I'm
hitting this when building cURL with support for HTTP and HTTPS protocols
only, and then trying to `find_package(CURL COMPONENTS HTTP HTTPS)`.

I'm using `if(NOT x EQUAL -1)` check form as it appears to be the most used
throughout the modules.

While fixing this issue I've looked through all the uses of `list(FIND)` in
other modules but wasn't able to find improper use except here.
2020-07-28 09:09:43 -04:00
Brad King e0d8da383f Merge topic 'sysroot-prefix'
e67d9c6e31 Compilers: Ignore -print-sysroot prefix when it is '/'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5066
2020-07-28 08:22:35 -04:00
Brad King e67d9c6e31 Compilers: Ignore -print-sysroot prefix when it is '/'
Since commit 8cc384f629 (Compilers: Add paths from -print-sysroot to
system prefix path, 2020-03-25, v3.18.0-rc1~337^2) we prepend the
compiler's sysroot to `CMAKE_SYSTEM_PREFIX_PATH`.  This does not
make sense when the prefix is just `/`, such as on Ubuntu 16.04's
system compiler.

Fixes: #21019
2020-07-27 10:53:43 -04:00
Brad King 90c88302b5 Merge topic 'externalproject-download-git-2.20-fix' into release-3.18
8dbefc3ca6 ExternalProject: omit --no-checkout from git clone when using git 2.20.x.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5054
2020-07-27 10:46:35 -04:00
Brad King c186a43355 Merge topic 'externalproject-download-git-2.20-fix'
8dbefc3ca6 ExternalProject: omit --no-checkout from git clone when using git 2.20.x.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5054
2020-07-27 10:46:35 -04:00