Commit Graph

10627 Commits

Author SHA1 Message Date
Brad King d089964fc9 Merge topic 'gtest-xml-output' into release-3.18
906d5264f5 GoogleTest: Fix name generation for XML_OUTPUT_DIR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4942
2020-06-29 08:21:07 -04:00
Brad King c2a48bbf79 Merge topic 'intel-c++20' into release-3.18
fd6f1a6e96 Intel: Add flags for C++20

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4946
2020-06-29 08:16:16 -04:00
Stefan Floeren 906d5264f5 GoogleTest: Fix name generation for XML_OUTPUT_DIR
The Google test framework allows to write the results into an XML file
since commit 315edd2c14 (GoogleTest: Add XML_OUTPUT_DIR parameter,
2020-03-06, v3.18.0-rc1~538^2~2).  This file is passed on the command
line: `--gtest_output=xml:FILE_NAME`.

The module allows to specify a directory to save those files with
**TEST_XML_OUTPUT_PARAM**.

If the option is set, the filename will be set to
`${prefix}${pretty_suite}.${pretty_test}${suffix}.xml`.

The pretty names contain parameters for the tests, if
value-parameterized tests are used. These parameters may not be safe to
use in file names.

There are two possible options:

1. sanitize the file name
2. omit the values and use the internal numbering of gtest

This commit chose option 2. The testname needs to be a valid C++
identifier and should therefore be reasonable for a filename.

Note that the generated names contain slashes. This will lead to
subdirectories, but works on both Linux and Windows.

Fixes: #20877
2020-06-26 09:39:51 -04:00
Brad King fd6f1a6e96 Intel: Add flags for C++20
Patch-by: Matheus Izvekov
Fixes: #20880
2020-06-26 08:21:21 -04:00
Craig Scott 4dc7901501 GoogleTest: Replace SEND_ERROR with FATAL_ERROR
We want to fail and halt immediately upon any error, not continue
past a fatal problem.
2020-06-24 21:57:19 +10:00
Brad King d85e24fbcf Merge topic 'VxWorks-platform-id' into release-3.18
d5a8edb435 VxWorks: Add Platform ID for Modules/CMakePlatformId.h.in

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4922
2020-06-23 08:00:31 -04:00
Lihua Zhao d5a8edb435 VxWorks: Add Platform ID for Modules/CMakePlatformId.h.in 2020-06-23 07:59:32 -04:00
Brad King 9968a3a093 Merge topic 'fix-win-flex-bison' into release-3.18
e45e963097 Find{FLEX,BISON}: Add 'win-' executable names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4931
2020-06-23 07:56:39 -04:00
Brad King 4b3a77bc10 Merge topic 'FindCUDA-11' into release-3.18
c7d90770b2 FindCUDA: Do not search for the deprecated nppicom when CUDA >= 11

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4929
2020-06-23 07:55:40 -04:00
Yan e45e963097 Find{FLEX,BISON}: Add 'win-' executable names
Distributions of these tools on Windows now use a `win-` prefix
instead of the previously-seen `win_` prefix.  Search for both.
2020-06-22 15:50:22 -04:00
Robert Maynard c7d90770b2 FindCUDA: Do not search for the deprecated nppicom when CUDA >= 11
The nppicom library has been removed in preference of nvjpeg starting
in CUDA 11.

Fixes: #20845
2020-06-22 11:56:51 -04:00
Brad King cc2c57005e Merge topic 'CUDAToolkit-cuda-11' into release-3.18
27a1a11e52 CudaToolkit: Update for new/removed libraries in CUDA 11

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4917
2020-06-19 08:13:08 -04:00
Brad King d98f30952c CUDA: Fix CMAKE_CUDA_COMPILER_TOOLKIT_ROOT detection in Visual Studio
When using a Visual Studio generator, we do not know the path to
`CMAKE_CUDA_COMPILER` until after the compiler id detection project
extracts it.  However, based on the VS toolchain configuration we know
that the compiler id will be NVIDIA, so use that to drive the CUDA
architecture flag logic.  After the main compiler id step we know
`CMAKE_CUDA_COMPILER`, so `CMAKE_CUDA_COMPILER_TOOLKIT_ROOT` can then be
computed.
2020-06-18 15:58:38 -04:00
Brad King d90be2aaaf CUDA: Re-order some logic for determining the compiler 2020-06-18 15:53:45 -04:00
Brad King 7d22968c34 CUDA: Remove unused variables while determining compiler 2020-06-18 15:50:10 -04:00
Brad King ae9b5203d8 CUDA: Simplify CMAKE_CUDA_COMPILER_TOOLKIT_ROOT computation 2020-06-18 15:49:25 -04:00
Brad King ecb93586b6 CUDA: Skip the entire search for nvcc when it is CMAKE_CUDA_COMPILER 2020-06-18 15:48:40 -04:00
Raul Tambre ab5181e631 CUDA: Fix NVCC executable search during compiler detection
The result variable was `CUDAToolkit_NVCC_EXECUTABLE` instead of
`_CUDA_NVCC_EXECUTABLE`, which the rest of the code used.  Also, we can
simply `set()` the `_CUDA_NVCC_EXECUTABLE` value without searching.

Fixes: #20847
2020-06-18 15:07:31 -04:00
Brad King 9922b1b7af Merge topic 'doc-3.18-fixups' into release-3.18
14ac7e82bd Help: Explicitly say transaction, don't abbreviate to trans
cf1010f71b Help: Correct and condense examples for VS_SOLUTION_DEPLOY
8c3b02c3f3 Help: Add missing cross-referencing for generator expressions
6ba04f157a Help: Formatting, crossref for FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>
83df16dee7 Help: Add missing PCH_WARN_INVALID docs and related cleanups
3a04b0fb8d Help: Fix formatting error and consistency for gtest_discover_tests()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4915
2020-06-18 12:44:14 -04:00
Robert Maynard 27a1a11e52 CudaToolkit: Update for new/removed libraries in CUDA 11 2020-06-18 08:52:58 -04:00
Osama Moharam 432fbd2d18 ARMClang: Fix typo in -Xlinker flag
Fix a typo from commit e02a072c76 (ARMClang: allow fallback to -march
and correct setting of --cpu flags, 2020-06-03, v3.18.0-rc1~18^2).
2020-06-18 07:43:22 -04:00
Craig Scott 3a04b0fb8d Help: Fix formatting error and consistency for gtest_discover_tests() 2020-06-18 20:23:57 +10:00
Raul Tambre 5b36747c03 CUDA: Throw error for Clang on Windows
Supporting compiling on Windows is more complicated than initially expected, so
it won't make it into CMake 3.18.
Add a helpful error for users.
2020-06-16 14:06:43 -04:00
Brad King ad6f2db200 Merge topic 'cuda_clang_toolkit_path' into release-3.18
6ad5c355c2 CUDA: Determine CUDA toolkit location for NVCC
4c5ad32dfa CUDA: Pass toolkit path to Clang
4d1a891fc6 FindCUDAToolkit: Avoid unnecessary temporary variable computing binary dir
6c7ed80393 FindCUDAToolkit: Remove unnecessary checks around searches
3260eb15d3 FindCUDAToolkit: Use list(SORT) to sort in natural order
6aed80d514 FindCUDAToolkit: Compute CUDAToolkit_INCLUDE_DIR instead of searching
a0f0906e26 FindCUDAToolkit: Add CUDAToolkit_LIBRARY_ROOT
8442620c33 FindCUDAToolkit: Re-unify with Internal/CUDAToolkit

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4828
2020-06-15 09:25:29 -04:00
Brad King b260600805 Merge topic 'cuda_architectures_disable' into release-3.18
55ab4c97e7 CUDA: Add support for disabling CUDA_ARCHITECTURES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4886
2020-06-15 09:24:37 -04:00
Raul Tambre 55ab4c97e7 CUDA: Add support for disabling CUDA_ARCHITECTURES
The ability to disable adding architectures completely for packaging purposes
and cases requiring passing the architectures flags explicitly has been
requested.
Support a false value for CUDA_ARCHITECTURES and CMAKE_CUDA_ARCHITECTURES
for this purpose.

Implements #20821.
2020-06-15 09:13:32 -04:00
Raul Tambre d152155d65 Clang: Record Clang 6.0+ as fully supporting C++17 2020-06-13 11:29:55 +03:00
Raul Tambre 5af6ccc449 Clang: Add final C++20 flag for Clang 11.0+
-std=c++20 superseded -std=c++2a in upstream Clang commit
24ad121582454e625bdad125c90d9ac0dae948c8.
2020-06-13 11:29:51 +03:00
Raul Tambre 6ad5c355c2 CUDA: Determine CUDA toolkit location for NVCC
Similar to how we already do for Clang. Avoids a lot of redundant work in
FindCUDAToolkit.
2020-06-12 23:13:57 +03:00
Raul Tambre 4c5ad32dfa CUDA: Pass toolkit path to Clang
Clang isn't very good at finding the installed CUDA toolkit.
The upstream recommendation is that we should pass the toolkit explicitly.

Additionally:
* Avoids Clang having to search for the toolkit on every invocation.
* Allows the user to use a toolkit from a non-standard location by simply
  setting CUDAToolkit_ROOT. The same way as with FindCUDAToolkit.

Clang wants the directory containing the device library and version.txt as the
toolkit path.
We thus pass the newly introduced CUDAToolkit_LIBRARY_ROOT as the toolkit path.

We save CUDAToolkit_ROOT_DIR and CUDAToolkit_LIBRARY_ROOT on Clang to have them
available in try_compile() and avoid unnecessary re-searching or a possibly
different installation being found in FindCUDAToolkit.
This however means that the selected toolkit can't be changed after the initial
language enablement.

We now determine CUDA compiler ID before doing actual detection, as we don't
want to spend time finding the CUDA toolkit for NVIDIA.

Implements #20754.
2020-06-12 21:50:05 +03:00
Raul Tambre 4d1a891fc6 FindCUDAToolkit: Avoid unnecessary temporary variable computing binary dir 2020-06-12 21:49:15 +03:00
Raul Tambre 6c7ed80393 FindCUDAToolkit: Remove unnecessary checks around searches
find_*() don't search if the result variable is already set.
Remove the if()s around such cases.
2020-06-12 21:49:15 +03:00
Raul Tambre 3260eb15d3 FindCUDAToolkit: Use list(SORT) to sort in natural order
We had a custom loop to sort in the natural order. Since CMake 3.18 this is
supported natively by CMake and simplifies the code significantly.
2020-06-12 21:49:15 +03:00
Raul Tambre 6aed80d514 FindCUDAToolkit: Compute CUDAToolkit_INCLUDE_DIR instead of searching
We can avoid searching for this since CUDAToolkit_TARGET_DIR always contains
the include/ directory. But add a warning just in case.

Also apply this in CMakeDetermineCUDACompiler for Clang code.
2020-06-12 21:49:15 +03:00
Raul Tambre a0f0906e26 FindCUDAToolkit: Add CUDAToolkit_LIBRARY_ROOT
On scattered installations version.txt and nvvm are located at this location.
This may be useful to users and will allow us in the future to parse
version.txt instead of invoking nvcc to figure out the CUDA toolkit version.

We also add it to CMakeDetermineCUDACompiler in preparation for future use by
Clang code.
2020-06-12 21:49:15 +03:00
Raul Tambre 8442620c33 FindCUDAToolkit: Re-unify with Internal/CUDAToolkit
A portion of FindCUDAToolkit was previously split in commit 76ef19fd
(FindCUDAToolkit: Factor out discovery code into a separate file, 2020-04-22)
out into Internal/CUDAToolkit to allow re-use of the code in
CMakeDetermineCUDACompiler for Clang support.

This has turned out to be a bad solution due to Clang requiring quite a bit of
special handling and special handling for NVCC leaking out from
Internal/CUDAToolkit into the Clang code using it.

Thus it seems better to re-unify this code and duplicate the parts of the code
necessary for Clang where it's required. This will help us get logic correct
for both NVCC and CUDA handling. We can still unify the common parts in the
future once the code has matured.
2020-06-12 21:49:15 +03:00
Brad King a413ca175e Merge topic 'nvcc_supports_cuda17' into release-3.18
5112790604 CUDA: Teach CMake that NVCC 11 supports cuda_std_17

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4872
2020-06-11 07:45:29 -04:00
Ron Klein 20719ac912 FindProtobuf: Fix typo in documentation
typo: "filess" ==> "files"
2020-06-10 15:01:37 -04:00
Robert Maynard 5112790604 CUDA: Teach CMake that NVCC 11 supports cuda_std_17 2020-06-10 13:27:51 -04:00
Brad King 80e9c51369 Merge topic 'cpack-ifw-3.2' into release-3.18
ed3cffba95 CPack/IFW: Add Qt installer framework version 3.2

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4859
2020-06-09 09:23:08 -04:00
Brad King eda57067a4 Merge topic 'FindOpenSSL-3.0' into release-3.18
45e625824d FindOpenSSL: Fix OpenSSL 3.0.0 version extraction

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4860
2020-06-09 08:53:05 -04:00
Billy Brumley 45e625824d FindOpenSSL: Fix OpenSSL 3.0.0 version extraction
Fix the regex syntax added by commit c24791f016 (FindOpenSSL: Detect
OpenSSL 3.0.0, 2020-05-27, v3.17.3~1^2).  Add missing escapes.
Test with `openssl-3.0.0-alpha3`.

While at it, also unset a temporary variable after use.
2020-06-08 08:24:57 -04:00
Frederik Gladhorn ed3cffba95 CPack/IFW: Add Qt installer framework version 3.2
Qt 5.15 comes with IFW 3.2
2020-06-08 08:11:39 -04:00
Frederik Gladhorn 6c1fde0ef1 CPack/IFW: Fix documentation typo: REQUARED 2020-06-08 08:08:58 -04:00
Brad King b1e4c499df Merge topic 'cuda_cudart_status' into release-3.18
c7c3054349 FindCUDAToolkit: Fix cudart not found status message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4861
2020-06-08 07:57:52 -04:00
Raul Tambre c7c3054349 FindCUDAToolkit: Fix cudart not found status message
This ended up after the searching after commit 76ef19f (FindCUDAToolkit: Factor
out discovery code into a separate file, 2020-04-22).
Move it back to where it was and should be.
2020-06-08 07:56:31 -04:00
Brad King b669c8d0b7 Merge topic 'cuda_clang_simulate' into release-3.18
b7190a6980 CUDA: Fix Clang depfile flags when simulating MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4863
2020-06-08 07:55:51 -04:00
Raul Tambre b7190a6980 CUDA: Fix Clang depfile flags when simulating MSVC
__compiler_clang() doesn't call __compiler_gnu() if we're emulating MSVC. Thus
CMAKE_DEPFILE_FLAGS_CUDA remains unset and compiling doesn't work, due to NVCC
dependency injection workaround in CMakeCUDAInformation.cmake, which triggers
for Ninja if they're not set.
Always set the depfile flags to fix this. Most other compiler modules seem to
do the same.
2020-06-08 07:54:51 -04:00
Brad King c15ce222fc Merge topic 'cuda_user_architectures_specifiers' into release-3.18
a580d8b323 CUDA: Fix checking working architectures with specifiers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4856
2020-06-08 07:53:26 -04:00
Raul Tambre a580d8b323 CUDA: Fix checking working architectures with specifiers
We don't distinguish real/virtual architectures during compiler detection.
If the user passes -DCMAKE_CUDA_ARCHITECTURES="70-virtual" we'll test with only
the real architecture.
If it works "architectures" will end up as "70". We check equality using
strings, so this fails and we incorrectly throw an error.
Fix this by comparing against CMAKE_CUDA_ARCHITECTURES with the specifiers
stripped.

We need to deduplicate tested_architectures for the same reason in case the
user specified something like "70-real;70-virtual".
2020-06-05 15:04:23 +03:00