Commit Graph

11372 Commits

Author SHA1 Message Date
Brad King e1ea0c9540 Merge topic 'nag-fortran-include-moddir' into release-3.20
ec030877a2 NAG: Fix using Fortran modules from their output directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5842
2021-02-23 08:06:30 -05:00
Brad King e9efa04d8d Merge topic 'fix-IS_NEWER_THAN-usage' into release-3.20
b0da671243 FetchContent: Don't update timestamps if files don't change
404cddb7bb ExternalProject: Fix misuse of IS_NEWER_THAN in timestamp checks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5825
2021-02-22 11:05:45 -05:00
Craig Scott b0da671243 FetchContent: Don't update timestamps if files don't change
The refactoring in 17e5516e60 (FetchContent: Invoke steps directly and
avoid a separate sub-build, 2021-01-29) uses a different way of writing
out the step scripts and updating time stamps when steps are executed.
That inadvertently always wrote out the scripts for custom commands,
even when the contents didn't change. This caused their timestamp to
always be updated, resulting in those steps always being seen as
out-of-date and needing to be re-executed.

The way timestamps were checked to determine whether to re-execute
a step also did not adequately account for file systems which only have
second-resolution timestamps. The IS_NEWER_THAN if condition also
returns true when timestamps are the same, so one needs to use the
negative form to get a true "is newer than" test.

ExternalProject is not susceptible to this problem because it uses
file(GENERATE) to write out the script files and that only updates the file's
timestamp if the contents change. It also mostly leaves timestamp
checking to the build tool.
2021-02-22 11:02:20 -05:00
Craig Scott 404cddb7bb ExternalProject: Fix misuse of IS_NEWER_THAN in timestamp checks
When using a file system which only has second resolution timestamps,
there is a reasonably high likelihood of timestamps being the same.
The IS_NEWER_THAN test returns true when timestamps are the same,
so don't redo downloads when they match exactly.
2021-02-22 11:02:20 -05:00
Brad King ec030877a2 NAG: Fix using Fortran modules from their output directory
The NAG Fortran compiler's `-mdir` flag sets the module output
directory but does not add the directory to the search path for using
modules.  This is inconsistent with other compilers like the GNU Fortran
compiler's `-J` flag that does both.  In order to make these consistent,
add the module output directory with a `-I` flag on the NAG Fortran
compiler so that it will be searched when using modules too.

We already do this for the XL Fortran compiler since commit 210b0b99a9
(XL: Fix using Fortran modules from their output directory, 2020-02-28,
v3.18.0-rc1~640^2~1).
2021-02-22 09:38:12 -05:00
Brad King 020d8c85e2 Merge topic 'intel-fortran-preprocess' into release-3.20
c9244f369a IntelLLVM: Make explicit Fortran preprocessing under Ninja more robust
056d4bf528 Merge branch 'backport-intel-fortran-preprocess'
af074c266e Intel: Make explicit Fortran preprocessing under Ninja more robust

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5826
2021-02-19 09:35:18 -05:00
Brad King 94408da2a7 Merge topic 'fix-intel-compiler-check' into release-3.20
dc7b6c2c06 DetermineCompiler: Fix copy-paste error in Intel Compiler detection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5818
2021-02-18 08:19:45 -05:00
Brad King c9244f369a IntelLLVM: Make explicit Fortran preprocessing under Ninja more robust
Tell the Fortran compiler to write preprocessor output directly to a
file, as we do for the GNU compiler.  The previous "redirect stdout"
approach could break during ABI detection with some `mpif90` wrappers
that add version information to stdout when called with `-v`.

Issue: #21828
2021-02-18 07:36:32 -05:00
Brad King 056d4bf528 Merge branch 'backport-intel-fortran-preprocess' 2021-02-18 07:35:35 -05:00
Brad King af074c266e Intel: Make explicit Fortran preprocessing under Ninja more robust
Tell the Fortran compiler to write preprocessor output directly to a
file, as we do for the GNU compiler.  The previous "redirect stdout"
approach could break during ABI detection with some `mpif90` wrappers
that add version information to stdout when called with `-v`.

Fixes: #21828
2021-02-18 07:35:12 -05:00
Craig Scott bd876f3849 FetchContent: Restore patch command support
The refactoring in 17e5516e60 (FetchContent: Invoke steps directly and
avoid a separate sub-build, 2021-01-29) contained a typo which resulted
in any PATCH_COMMAND being ignored. Fix the typo and add a test case
that would have caught the regression.
2021-02-18 09:40:39 +11:00
Gregor Jasny dc7b6c2c06 DetermineCompiler: Fix copy-paste error in Intel Compiler detection
Fixes: #21561
Fixes: a90d2a9eed (IntelLLVM: Add support for Intel LLVM-based compilers, 2020-11-02)
2021-02-17 08:23:45 +01:00
Brad King 67079c2a89 Merge topic 'FindPython-fix-variable-handling' into release-3.20
754f4f6876 FindPython: fix erroneous variable handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5816
2021-02-16 12:07:17 -05:00
Marc Chevrier 754f4f6876 FindPython: fix erroneous variable handling
Fixes: #21817
2021-02-16 10:46:28 -05:00
Brad King e6d6cf9022 Merge topic 'FindPNG-advanced-variables' into release-3.20
17ae4e1bef FindPNG: only mark used variables as advanced

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5809
2021-02-16 10:41:26 -05:00
Brad King 516c0736e8 Merge topic 'IntelLLVM-unused-C17' into release-3.20
4642c81c72 IntelLLVM: Remove incomplete C17 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5805
2021-02-16 10:40:29 -05:00
Brad King 4642c81c72 IntelLLVM: Remove incomplete C17 support
CMake does not yet model support for C17.  Avoid possible confusion by
removing the settings for IntelLLVM pending a full implementation.
2021-02-15 10:43:35 -05:00
Ben Boeckel 17ae4e1bef FindPNG: only mark used variables as advanced
The `PNG_LIBRARY` variable is an output and not a cache variable.

Fixes some CMP0102 warnings.
2021-02-15 10:33:01 -05:00
Brad King c1e90c5544 Merge topic 'cuda-nvcc-output' into release-3.20
9ea66b2d86 CUDA: Capture all nvcc output when extracting toolkit root

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Tested-by: Raul Tambre <raul@tambre.ee>
Acked-by: Rong Ou <rong.ou@gmail.com>
Merge-request: !5804
2021-02-15 10:29:24 -05:00
Brad King 26eae560ff Merge topic 'FindGDAL-improvements' into release-3.20
55e493928b FindGDAL: add release note
f4b53fadda FindGDAL: support finding additional GDAL library names
1b2774450d FindGDAL: add support for skipping gdal-config
1621cb3eb1 FindGDAL: add documentation to cache variables
3caaff4c08 FindGDAL: conditionally set the output variables
3f6a4f2062 FindGDAL: mark cache variables as advanced
02e906305d FindGDAL: use execute_process instead of exec_program
140344da14 FindGDAL: fix some indentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5799
2021-02-15 10:21:18 -05:00
Ben Boeckel f4b53fadda FindGDAL: support finding additional GDAL library names 2021-02-12 07:43:23 -05:00
Brad King 9ea66b2d86 CUDA: Capture all nvcc output when extracting toolkit root
Since commit fb2afef620 (CUDA: Support nvcc symlinking to ccache,
2021-01-07) and commit 3cef91a321 (CUDA: Always extract CUDA Toolkit
root from nvcc verbose output, 2021-02-03) we always run the command
`nvcc -v __cmake_determine_cuda` to look for the toolkit root in its
stderr.  On Windows, that command may print to stdout instead, so
capture that as well.
2021-02-12 07:23:48 -05:00
Brad King a86cd9cb3c Merge topic 'FindMPI-lang-reason' into release-3.20
8251b62ba0 FindMPI: Fix reason for a non-enabled non-requested language

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5801
2021-02-12 06:53:41 -05:00
Felipe Torrezan 8ee933900e IAR: add support for the STM8 compiler 2021-02-12 06:51:05 -05:00
Ben Boeckel 1b2774450d FindGDAL: add support for skipping gdal-config
This can be confusing if there are autotools and CMake-built GDAL builds
within the same environment as the autotools variant will always be
preferred.
2021-02-11 09:46:10 -05:00
Ben Boeckel 1621cb3eb1 FindGDAL: add documentation to cache variables 2021-02-11 09:46:10 -05:00
Ben Boeckel 3caaff4c08 FindGDAL: conditionally set the output variables 2021-02-11 09:46:10 -05:00
Ben Boeckel 3f6a4f2062 FindGDAL: mark cache variables as advanced 2021-02-11 09:46:10 -05:00
Ben Boeckel 02e906305d FindGDAL: use execute_process instead of exec_program 2021-02-11 09:46:10 -05:00
Ben Boeckel 140344da14 FindGDAL: fix some indentation 2021-02-11 09:46:10 -05:00
Axel Huebl 8251b62ba0 FindMPI: Fix reason for a non-enabled non-requested language
In pure C/CXX projects, when doing an optional search for C/CXX
MPI APIs, I keep getting a reason appended of the form:

```
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS)
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS)
-- Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
    Reason given by package: MPI component 'Fortran' was requested, but language Fortran is not enabled.
```

The reason makes no sense since I did not request Fortran and thus
confuses the reader. It is now only added if the component was truly
requested.
2021-02-11 09:05:19 -05:00
Brad King b1e544dd64 Merge topic 'IntelLLVM-no-imsvc' into release-3.20
e5563e592f IntelLLVM: Remove unsupported -imsvc system include flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5795
2021-02-11 08:58:40 -05:00
Brad King ea07176b9a Merge topic 'FindBoost-no-warn'
90467747a1 FindBoost: Add option to suppress new boost version dependency warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5794
2021-02-10 08:14:40 -05:00
John Melas 90467747a1 FindBoost: Add option to suppress new boost version dependency warning
Add option `Boost_NO_WARN_NEW_VERSIONS` to suppress new boost version
dependency warning.

Fixes: #21786
2021-02-10 08:02:24 -05:00
william.r.dieter e5563e592f IntelLLVM: Remove unsupported -imsvc system include flag
`clang-cl` supports the `-imsvc` flag to tell the compiler an include
directory is intended for system paths.  `icx` does not accept this
flag, even on MSVC platforms, so do not tell CMake that it exists.

Fixes: #21801
Signed-off-by: william.r.dieter <william.r.dieter@intel.com>
2021-02-10 07:55:00 -05:00
Brad King bb68658e98 Merge topic 'findcudatoolkit_handle_cuda_compiler_without_enabled_lang'
cd89d1c328 FindCUDAToolkit: Robust version checks when CUDA lang is not enabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Tested-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5787
2021-02-10 07:48:50 -05:00
Brad King 691e8ac480 Merge topic 'clang-imsvc'
2fc5e5dba9 Clang: Use -imsvc for system include only with MSVC-like front-end

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Thomas Bernard <thomas@famillebernardgouriou.fr>
Merge-request: !5792
2021-02-10 07:46:33 -05:00
Brad King 2fc5e5dba9 Clang: Use -imsvc for system include only with MSVC-like front-end
In commit bb61c2d024 (Clang: use -imsvc for system include dirs when
running on Windows, 2020-09-16, v3.19.0-rc1~162^2) we added `-imsvc`
for all Clang compilers targeting the MSVC ABI.  However, the option
only exists for the MSVC-like front-end.  The GNU-like front-ends
use `-isystem`.

Fixes: #21789
2021-02-09 11:24:41 -05:00
Robert Maynard cd89d1c328 FindCUDAToolkit: Robust version checks when CUDA lang is not enabled
Previously if you set `CMAKE_CUDA_COMPILER` but hadn't enabled
the CUDA language, FindCUDAToolkit would not correctly compute
the version information.
2021-02-09 09:39:20 -05:00
Brad King 340ca27f8d Merge topic 'FindXCTest-bundle-inject' into release-3.19
eafe740ead FindXCTest: Fix output directory for test bundle with new build system

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5786
2021-02-09 08:25:27 -05:00
Brad King c4c902d132 Merge topic 'FindXCTest-bundle-inject'
eafe740ead FindXCTest: Fix output directory for test bundle with new build system

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5786
2021-02-09 08:25:27 -05:00
Brad King cab99f7dba Merge topic 'xcode12-ios_install_combined'
0110aa018d IOS_INSTALL_COMBINED: Support Xcode 12 (command line only)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5785
2021-02-09 08:23:30 -05:00
Brad King 9b9075f723 Merge topic 'cuda_support_nvcc_from_hpctoolkit'
3cef91a321 CUDA: Always extract CUDA Toolkit root from nvcc verbose output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Tested-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5777
2021-02-09 08:21:17 -05:00
Brad King 18fa819e26 Merge topic '21479-branding-name-cpack-nsis'
0aabeb0c30 CPack/NSIS: Add option for setting branding text

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5784
2021-02-09 08:20:17 -05:00
Yauheni Khnykin eafe740ead FindXCTest: Fix output directory for test bundle with new build system
The output directory was still correct for macOS with the new build system,
but not for iOS.

Fixes: #20662
2021-02-09 10:20:57 +11:00
Robert Maynard 3cef91a321 CUDA: Always extract CUDA Toolkit root from nvcc verbose output
Fixes #21750, #21763

Given that NVCC can be provided by multiple different sources (NVIDIA HPC SDK, CUDA Toolkit, distro)
each of which has a different layout, we need to extract the CUDA toolkit root from the compiler
itself, allowing us to support numerious different scattered toolkit layouts.

The NVIDIA HPC SDK specifically ships two copies of nvcc one in
`compilers/bin/` and one in `cuda/bin`. Thus when using
`compilers/bin/nvcc` the Toolkit root logic fails.
2021-02-08 12:13:01 -08:00
Brad King 9cddaad940 AddFileDependencies: Deprecate this unnecessary module
Document that one can call `set_property` directly instead.
2021-02-08 12:44:37 -05:00
Brad King 4841d38a7a MacroAddFileDependencies: Explicitly deprecate by documentation
This module has been discouraged since commit 1e20be319f (STYLE: add
documentation for MACRO_ADD_FILE_DEPENDENCIES(), 2009-07-14,
v2.8.0~433).  It has been listed in the `cmake-modules(7)` manual
as deprecated since commit df780bcc01 (Help: Move deprecated modules to
appropriate section., 2018-11-12, v3.14.0-rc1~374^2).  Add the explicit
deprecation mark in its documentation.
2021-02-08 12:34:15 -05:00
Brad King 777c14af82 MacroAddFileDependencies: Simplify implementation 2021-02-08 12:34:15 -05:00
Brad King 17d4138108 Merge topic 'AddFileDependencies-simplify'
0f6fc388ea AddFileDependencies: Avoid leaking temporary variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !5779
2021-02-08 12:22:23 -05:00