11099 Commits

Author SHA1 Message Date
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
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
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
Craig Scott
0110aa018d IOS_INSTALL_COMBINED: Support Xcode 12 (command line only)
Xcode 12 doesn't allow nested builds within the same build directory.
That means we can no longer do an install by building the install target
when IOS_INSTALL_COMBINED is true. We can, however, still do an install
by running the cmake_install.cmake script or executing cmake --install,
since there is no outer build and therefore the associated SDK can be
built as a sub-build.

The non-build methods previously didn't work when
IOS_INSTALL_COMBINED was true because the generated install script
and the CMakeIOSInstallCombined script both made certain assumptions
that relied on being part of a build. Those assumptions are now
removed. A side-effect of this work is that cpack now also works from the
command line when IOS_INSTALL_COMBINED is true.

Relates: #21282
Fixes: #20023
2021-02-08 18:02:46 +11:00
Brad King
8293064760 FindBoost: Add support for Boost 1.75
Update the list of known versions.

Run the command

    cmake -DBOOST_DIR=/path/to/boost_1_75_0 \
      -P Utilities/Scripts/BoostScanDeps.cmake

to extract dependencies from the 1.75.0 source tree.
They differ from 1.74's dependencies by the addition of
dependencies of the json component, so add a new version
block to FindBoost.

Fixes: #21773
2021-02-03 12:10:40 -05:00
Robert Maynard
4ea6d3c3ae FindCUDAToolkit: Restore use of CUDA_PATH environment variable
Refactoring in commit 7cc815a2a6 (CUDAToolkit: Detect CUDA SDK that
don't have nvcc, 2020-07-24, v3.19.0-rc1~366^2) accidentally broke
use of the `CUDA_PATH` environment variable.

Fixes: #21740
2021-02-03 10:35:21 -05:00
Brad King
2a5955ac09 Intel: Replace deprecated Fortran flag -nofor_main with -nofor-main
The `-nofor_main` flag was originally added by commit ccdd3e943d (Fix
Intel Fortran SHARED libraries on Linux, 2009-10-27, v2.8.2~915).  Since
then, Intel Fortran renamed the option to `-nofor-main` and deprecated
the old name.  The new name has been available for a long time, so
we can just switch to it.

Fixes: #21735
2021-01-22 09:38:57 -05:00
Brad King
7838a065a6 Merge topic 'FindHDF5-silence-output' into release-3.19
b924669385 FindHDF5: silence STATUS messages when found with QUIET
2439a048b0 FindHDF5: avoid writing to the output when testing h5cc

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5722
2021-01-21 09:17:39 -05:00
Ben Boeckel
b924669385 FindHDF5: silence STATUS messages when found with QUIET 2021-01-20 14:05:14 -05:00
Ben Boeckel
2439a048b0 FindHDF5: avoid writing to the output when testing h5cc
The execution of this tool can output error logs to the output during
configure. This can then be caught by CTest and flagged as an error
during the build.
2021-01-20 14:04:25 -05:00
Bianca van Schaik
f2d92b983b GetPrerequisites: Include weak macOS dependencies
Starting with Clang 12, `otool -L` adds `, weak` to weakly linked
libraries.  Update GetPrerequisites to recognize these.

Issue: #21684
2021-01-20 10:26:54 -05:00
Kelly Walker
6718caaa2f IRSL: Install msvcp${v}${d}_atomic_wait.dll if available with CRT
VS now distributes these additional runtime libraries.  Install them
if available.

Fixes: #21675
2021-01-15 10:41:17 -05:00
Brad King
95e3ff2e88 Merge topic 'FindHDF5-dbg-and-rel' into release-3.19
5267ba9d63 FindHDF5: Fix finding both debug and release libs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5653
2021-01-06 14:08:27 -05:00
Kris Thielemans
5267ba9d63 FindHDF5: Fix finding both debug and release libs
Use `target_link_libraries` to set `INTERFACE_LINK_LIBRARIES` so that
the `debug` and `optimized` keywords work.

In commit a8e0a6b3e4 (FindHDF5: Port changes from VTK, 2020-06-10,
v3.19.0-rc1~312^2~1) we added use of `HDF5_LIBRARIES`, but the value may
contain `debug` and `optimized` keywords.

Fixes: #21637
2021-01-04 14:26:38 -05:00
Eduard Valeyev
a5b223aa7f FindMPI: remove single quotes from include path
Intel OneAPI's MPI wraps include paths into single quotes,
remove them when sanitizing _MPI_INCLUDE_PATH

Fixes: #21634
2021-01-04 14:13:43 -05:00
Craig Scott
51595e5f01 FetchContent: Relative SOURCE_DIR override cannot be a hard error
Fixes: #21624
2020-12-22 11:09:18 +11:00
Marc Chevrier
7f44760991 CMakePackageConfigHelpers: Relax restrictions on version range 2020-12-14 14:42:26 +01:00
Brad King
6aff058ab4 Merge topic 'FindGLUT-macos-tbd' into release-3.19
d29d034e2e FindGLUT: Handle Mojave and Big Sur 'tbd' framework files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5601
2020-12-14 07:11:07 -05:00
Brad King
1a5c1a68b6 macOS: Add /opt/homebrew to CMAKE_SYSTEM_PREFIX_PATH on Apple Silicon
According to https://brew.sh/2020/12/01/homebrew-2.6.0/ the `/opt/homebrew`
directory is recommended for installing ARM architecture brew packages.

Fixes: #21585
2020-12-11 13:07:17 -05:00
Robert Maynard
d29d034e2e FindGLUT: Handle Mojave and Big Sur 'tbd' framework files 2020-12-11 11:01:30 -05:00
Brad King
5f882f6ce5 macOS: Offer control over host architecture on Apple Silicon hosts
Since commit b6c60f14b6 (macOS: Default to arm64 architecture on Apple
Silicon hosts, 2020-09-28, v3.19.0-rc1~63^2) we use `sysctl` to detect
that we are running on Apple Silicon in a way that pierces Rosetta.
This always sets `CMAKE_HOST_SYSTEM_PROCESSOR` to be `arm64` on such
hosts.  However, macOS offers strong support for running processes under
an emulated `x86_64` architecture.

Teach CMake to select either `arm64` or `x86_64` as the host
architecture on Apple Silicon based on the architecture of its own
process.  When CMake is built as a universal binary, macOS will select
whichever slice (architecture) is appropriate under the user's shell,
and `CMAKE_HOST_SYSTEM_PROCESSOR` will match.

Also offer a `CMAKE_APPLE_SILICON_PROCESSOR` variable and environment
variable to provide users with explicit control over the host
architecture selection regardless of CMake's own architecture.

Finally, if `CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to
the toolchain to use selected host architecture instead of letting the
toolchain pick.

Fixes: #21554
2020-12-10 12:08:13 -05:00
Brad King
9f66eb74a5 Merge topic 'ispc-system-includes' into release-3.19
8da25e4a3c ISPC: Treat system includes as '-I' includes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5591
2020-12-10 06:57:04 -05:00
Robert Maynard
8da25e4a3c ISPC: Treat system includes as '-I' includes
ISPC doesn't have specific syntax for system includes.
2020-12-09 11:33:44 -05:00
Brad King
61cd587ef3 Merge topic 'FindPython-python2-soabi-suffix-fix' into release-3.19
afb0ffcac7 FindPython2: avoid doubling the extension in CPython2 SOABI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5574
2020-12-08 10:18:28 -05:00
Brad King
41b69348a5 Revert "Intel: Add Intel DPC++ compiler identification"
Revert commit 887f3a88a6 (Intel: Add Intel DPC++ compiler
identification, 2020-09-21, v3.19.0-rc1~124^2).  The compiler has
already been released, and is more usable with CMake by pretending to be
upstream Clang than by identifying it as a compiler for which we have
not implemented support.

Fixes: #21551
2020-12-07 10:46:27 -05:00
Brad King
f0babb53b3 Revert "Intel: Add Intel Clang compiler identification"
Revert commit 5c3a93ab88 (Intel: Add Intel Clang compiler
identification, 2020-09-29, v3.19.0-rc1~68^2).  The compiler has already
been released, and is more usable with CMake by pretending to be
upstream Clang than by identifying it as a compiler for which we have
not implemented support.

Issue: #21551
2020-12-07 10:46:22 -05:00
Ben Boeckel
afb0ffcac7 FindPython2: avoid doubling the extension in CPython2 SOABI
Commit 951640f1f9 (FindPython: manage SOABI for all Python versions,
2020-08-11) extended support for Python2's SOABI variable in order to
support the PyPy interpreter as well. This caused a regression in the
way that the SOABI variable was built up for the CPython interpreter.
This caused the variable to be set to `.so` which ended up causing a
doubling of the resulting `SOABI` variable in the end.

Co-Author: Marc Chevrier <marc.chevrier@gmail.com>
Fixes: #21548
2020-12-04 14:01:27 -05:00
Brad King
f25ac39dee CMakeDetermineCompilerId: Tolerate stray text around INFO strings
When cross-compiling with Xcode our compiler id test binary may be
compiled with multiple architectures.  The INFO strings should be
identical and therefore de-duplicated.  However, this can be broken by
stray text that happens to sit immediately before or after an INFO
string.  Filter out such text so we can match clean INFO strings.

Fixes: #21526
2020-12-03 14:37:21 -05:00
Brad King
5cb66f17ca CMakeDetermineCompilerId: Add whitespace to clarify logic
Also initialize a variable closer to its use.
2020-12-03 14:37:08 -05:00
Brad King
1ee99104f7 CMakeDetermineCompilerId: Filter IAR-AVR format INFO strings earlier
Remove the bytes between characters from the entire list at once.
2020-12-03 14:34:04 -05:00
Brad King
6cf88734a5 Merge topic 'llvm-rc-preprocess-as-c' into release-3.19
f7ff0d34f0 llvm-rc: Force C language for the clang gnu frontend

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5564
2020-12-03 08:37:21 -05:00
Brad King
79077df26b Merge topic 'FindHDF5-hdf5hl_fortran-variable' into release-3.19
175beadd4c FindHDF5: support the hdf5hl_fortran-based variable names
adf108441e FindHDF5: improve error messages when a location variable isn't known

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5563
2020-12-02 09:22:52 -05:00
Brad King
859ecbe446 Merge topic 'ti-c-only-standard' into release-3.19
8eeddb1f0a Compiler/TI: Fix C standard flags in C-only project

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5558
2020-12-02 09:21:30 -05:00
Thomas Bernard
f7ff0d34f0 llvm-rc: Force C language for the clang gnu frontend
When preprocessing the rc file using the clang gnu front end we need to
force the source file type to a c file for the preprocessing to take
place.

Fixes: #21472
2020-12-02 08:19:44 -05:00
Ben Boeckel
175beadd4c FindHDF5: support the hdf5hl_fortran-based variable names
Fixes: #21537
2020-12-01 15:31:47 -05:00
Ben Boeckel
adf108441e FindHDF5: improve error messages when a location variable isn't known 2020-12-01 15:31:21 -05:00
Justin LaPolla
9ee4a42813 Cray: Fix Cray compiler detection on new platforms
Customer reported problems detecting the Cray compiler on their Apollo80
system. We were checking for the __CRAYXC and __CRAYXE predefined
macros. These macros reflect the platform that the compiler is running
on, i.e. Cray XC and Cray XE machines. Naturally, this didn't work on
Apollo80.

This commit uses the official Cray compiler identification macros which
are defined on every platform:

    CCE Version     C Macro     C++ Macro    Fortran Macro
    ============    ========    =========    =============
    version <  9    _CRAYC      _CRAYC       _CRAYFTN
    version >= 9    __cray__    __cray__     _CRAYFTN
2020-12-01 12:20:47 -05:00
Adam Weisi
8eeddb1f0a Compiler/TI: Fix C standard flags in C-only project
Use our compiler architecture variable for C rather than CXX.
2020-12-01 12:14:38 -05:00
Brad King
f264f1d783 Merge topic 'windows-clang-LINKER-prefix' into release-3.19
9ac9876757 Clang on Windows: 'LINKER:' prefix must be honored

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5551
2020-12-01 09:32:07 -05:00
Brad King
5ef2364053 Merge topic 'correct_check_compiler_flag_regression' into release-3.19
72f6b4bfbe Modules: Rename Internal/CMake{CheckCompiler => TryCompilerOrLinker}Flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kumar Gala <kumar.gala@gmail.com>
Merge-request: !5540
2020-11-30 12:37:14 -05:00
Brad King
2e1eaf16a7 Merge topic 'check-lang-conditions' into release-3.19
f3d4254b3d Check*: Tolerate variables set with names of languages
01d91ae5f2 Tests: Fix RunCMake.Check* conditions for enabling Fortran

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !5536
2020-11-30 12:34:31 -05:00
Marc Chevrier
9ac9876757 Clang on Windows: 'LINKER:' prefix must be honored
Fixes: #21094
2020-11-30 15:31:45 +01:00
Marc Chevrier
72ede0218d Merge topic 'FPHSA-usable-outside-find_package' into release-3.19
14ecf9c2f6 FPHSA: ensure it can be used outside 'find_package'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5539
2020-11-28 09:02:54 -05:00
Robert Maynard
72f6b4bfbe Modules: Rename Internal/CMake{CheckCompiler => TryCompilerOrLinker}Flag
Rename the `CheckPIESupported` helper functions so that they
don't clobber other internal functions. Also rename them to
document they can't be unified with `CheckCompilerFlag`.

Fixes: #21497
2020-11-25 11:06:15 -05:00
Marc Chevrier
14ecf9c2f6 FPHSA: ensure it can be used outside 'find_package'
Fixes: #21505
2020-11-25 16:36:12 +01:00
Brad King
f3d4254b3d Check*: Tolerate variables set with names of languages
Fix the language checks added by commit 90dead024c (CheckCompilerFlag:
unified way to check compiler flags per language, 2020-09-25,
v3.19.0-rc1~88^2), commit 10ae907de0 (CheckSoureCompiles: Add a unified
way to check if a source compiles, 2020-09-14, v3.19.0-rc1~118^2~1), and
commit 357e2ef429 (CheckSoureRuns: Add a unified way to check if a
source runs, 2020-09-14, v3.19.0-rc1~118^2) to work when variables of
the language names are set.

Fixes: #21500
2020-11-25 09:11:21 -05:00
Brad King
37add87632 Merge topic 'cuda_detect_vs_codegen' into release-3.19
20807a1882 CUDA: Fix user-set architectures during detection with Visual Studio

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5531
2020-11-25 08:35:08 -05:00
Raul Tambre
20807a1882 CUDA: Fix user-set architectures during detection with Visual Studio
If the user specifies CMAKE_CUDA_ARCHITECTURES we use those during detection
and error out if they don't work.
For Visual Studio a dummy project file is used instead of invoking the compiler
directly. NVCC would thus use its default and we'd fail if
CMAKE_CUDA_ARCHITECTURES was anything other than NVCC's default.

Use the necessary project file variable in CMakeDetermineCompilerId.cmake to
match other generators.

Fixes #21492.
2020-11-25 08:27:40 -05:00
Brad King
92d21eae65 Merge topic 'cuda_11' into release-3.19
046e454fdd CUDA: Error if can't determine toolkit library root
440dc98b07 CUDA: Clang CUDA 11.1 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5525
2020-11-23 11:23:02 -05:00
Brad King
20bb6f24d1 Merge topic 'FindGTest-revert-no-release' into release-3.19
64dc4efc51 FindGTest: Revert "Allow either "Debug" or "Release" configurations."

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5520
2020-11-23 11:21:53 -05:00