Commit Graph

10759 Commits

Author SHA1 Message Date
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
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
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
Brad King
c1b60f94c9 Merge topic 'FindXalanC-1.12'
4bf102418b FindXalanC: Fix version parsing for XalanC 1.12

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5056
2020-07-27 10:43:55 -04:00
Brad King
fadedcbb72 Merge topic 'FindXalanC-1.12' into release-3.18
4bf102418b FindXalanC: Fix version parsing for XalanC 1.12

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5056
2020-07-27 10:43:54 -04:00
Nate Avers
8dbefc3ca6 ExternalProject: omit --no-checkout from git clone when using git 2.20.x.
The optimization from commit 627fc5b44f (ExternalProject: Avoid
unnecessary checkout on clone, 2019-07-29, v3.16.0-rc1~325^2) triggers a
bug in the Git 2.20.x series that is not in older or newer versions.
Drop the optimization for that specific range of Git versions.

Fixes: #21009
2020-07-24 09:39:06 -04:00
Brad King
4bf102418b FindXalanC: Fix version parsing for XalanC 1.12
The version header now puts parentheses around the components.

Fixes: #21010
2020-07-24 07:23:19 -04:00
Brad King
64e5c239d3 Merge topic 'pgi-no-A'
52eee19389 PGI: Remove -A from the C++ flags we use when CXX_EXTENSIONS is OFF

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Chuck Atkins <chuck.atkins@kitware.com>
Merge-request: !5025
2020-07-23 08:29:02 -04:00
Brad King
e3b5abd068 Merge topic 'fix-typos-identified-using-codespell'
207373802e Fix typos identified using codespell

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5040
2020-07-23 08:28:21 -04:00
Brad King
b890937fdd Merge topic 'CheckTypeSize-std-types'
7f786c6a40 Tests: Cover CheckTypeSize with uint8_t and std::uint8_t
371072e9e1 CheckTypeSize: Use C++-style headers to check for std:: types

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5008
2020-07-23 08:25:10 -04:00
Jean-Christophe Fillion-Robin
207373802e Fix typos identified using codespell
See https://github.com/codespell-project/codespell#readme

The following command was used:

```
codespell -q6 --skip="\
.git,\
*.json,\
./Copyright.txt,\
./Help/command/foreach.rst,\
./Help/prop_test/REQUIRED_FILES.rst,\
./Help/variable/CTEST_COVERAGE_COMMAND.rst,\
./Modules/CMakeCheckCompilerFlagCommonPatterns.cmake,\
./Modules/CMakeRCInformation.cmake,\
./Modules/Internal/CPack/NSIS.template.in,\
./Modules/FindMatlab.cmake,\
./Modules/MatlabTestsRedirect.cmake,\
./Modules/Platform/Windows-Clang.cmake,\
./Modules/Platform/Windows-Intel-Fortran.cmake,\
./Modules/Platform/Windows-MSVC.cmake,\
./Source/CMakeVersion.cmake,\
./Source/cmConvertMSBuildXMLToJSON.py,\
./Source/cmCreateTestSourceList.cxx,\
./Source/cmGlobalVisualStudio10Generator.cxx,\
./Source/cmExportBuildFileGenerator.cxx,\
./Source/cmExportInstallAndroidMKGenerator.cxx,\
./Source/cmExportInstallFileGenerator.cxx,\
./Source/cmExportSet.cxx,\
./Source/cmExportTryCompileFileGenerator.cxx,\
./Source/cmFindPackageCommand.cxx,\
./Source/cmInstallCommand.cxx,\
./Source/cmGeneratorExpressionLexer.cxx,\
./Source/cmLocalVisualStudio7Generator.cxx,\
./Source/cmOrderDirectories.cxx,\
./Source/cmTarget.cxx,\
./Source/kwsys/*,\
./Source/QtDialog/CMakeSetupDialog.ui,\
./Source/CPack/WiX/cmWIXRichTextFormatWriter.cxx,\
./Source/CTest/cmParseCoberturaCoverage.h,\
./Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in,\
./Tests/RunCMake/CPack/tests/DMG_SLA/English.license.rtf,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.license.txt,\
./Tests/RunCMake/CPack/tests/DMG_SLA/German.menu.txt,\
./Tests/RunCMake/GoogleTest/xml_output.cpp,\
./Tests/RunCMake/Make/TargetMessages*,\
./Utilities/*,\
" \
-L "\
dependees,\
endwhile,\
fo,\
filetest,\
helpfull,\
nd,\
objext,\
stoll,\
supercedes,\
superceded,\
vas,\
varn,\
"
```
2020-07-22 12:44:47 -04:00
Tin Huynh
52eee19389 PGI: Remove -A from the C++ flags we use when CXX_EXTENSIONS is OFF
Since commit 9b97cb5562 (PGI: Add language standards for PGI,
2017-05-01, v3.9.0-rc1~174^2), we have passed the `-A` flag to
the PGI C++ compiler when specifying a C++ standard flag with
compiler extensions turned off.  The flag is not meant for that.
The PGI C++ standard flags do not turn extensions on by default
and have a separate `--gnu_extensions` flag for that which we
already use when CXX_EXTENSIONS is ON.  Simply drop the `-A` flag.

Fixes: #20997
2020-07-22 07:26:01 -04:00
Craig Scott
8abeec58f3 Merge topic 'xcode-native-arch'
26673bf480 Xcode: Explicitly specify default native architecture on macOS
ce624cfbd4 cmGlobalXCodeGenerator: Save CMAKE_SYSTEM_NAME in member

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5023
2020-07-21 07:19:02 -04:00
Aiden Woodruff
371072e9e1 CheckTypeSize: Use C++-style headers to check for std:: types
In order to check for types like `std::uint8_t` in C++, we need to
include `<cstdint>` instead of `<stdint.h>`.
2020-07-20 15:47:18 -04:00
Brad King
26673bf480 Xcode: Explicitly specify default native architecture on macOS
When `CMAKE_OSX_ARCHITECTURES` is not specified, we add the Xcode
setting `ONLY_ACTIVE_ARCH = YES` with the intention of targeting the
native architecture of the host.  However, the default `ARCHS` value
chosen by "Xcode 12 Universal Apps" includes multiple architectures.
Add an explicit `ARCHS` setting with value `$(NATIVE_ARCH_ACTUAL)`
to tell Xcode to use the host's native architecture only.

Fixes: #20893
2020-07-20 10:03:15 -04:00
Kurt Sansom
fa7157b86d FindX11: Add Xaw libraries
Fixes: #20963
2020-07-16 14:16:24 -05:00
Brad King
ffb888b748 Merge topic 'macOS-sdk-latest'
17e13fb6d0 macOS: Always pick latest SDK if user has not set one explicitly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5012
2020-07-16 10:16:48 -04:00
Brad King
e169ec9c23 Merge topic 'compi-ti-improvements'
98fea8205e Compiler/TI: Avoid response file usage for linker
5dec322f33 Compiler/TI: Add compiler flags to linker
763b44e519 Compiler/TI: Avoid usage of ranlib
ef528f10bf Compiler/TI: Sync ASM settings to C/CXX
a548a52230 Compiler/TI: Refactor C/CXX to use a common file
195aa488e3 Compiler/TI: Detect architecture

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5010
2020-07-15 06:48:37 -04:00
Brad King
d1329ebc3e Merge topic 'nvcc_host'
ff086f066b NVCC: Handle host compiler with spaces in path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5019
2020-07-15 06:42:57 -04:00
Raul Tambre
ff086f066b NVCC: Handle host compiler with spaces in path
Need to surround it with quotes otherwise the different bits are passed as
separate arguments.

Fixes #20954.
2020-07-14 22:27:58 +03:00
Brad King
7968d9d442 Help: Document CMAKE_CUDA_HOST_COMPILER as specific to NVIDIA nvcc
Explain the purpose of this variable and the conditions under which
it can be set.  Point out that it should not be set explicitly without
also setting `CMAKE_CUDA_COMPILER` explicitly.

Issue: #20826
2020-07-14 15:22:54 -04:00
Tor Arne Vestbø
17e13fb6d0 macOS: Always pick latest SDK if user has not set one explicitly
Apple tech note QA1806 recommends always building against the latest
SDK.

Fixes: #20949
2020-07-14 15:43:45 +02:00
Josef Angstenberger
98fea8205e Compiler/TI: Avoid response file usage for linker
The object and library files have to be listed after the `--run-linker`
flag.

But after this flag the `--cmd_file` flag for response files cannot be
used any more.

Putting the whole command line into a response file would work, but
this is not supported by CMake (yet).
2020-07-14 02:41:51 +02:00
Josef Angstenberger
5dec322f33 Compiler/TI: Add compiler flags to linker
By adding the compiler flags via `<FLAGS>` to the linker call,
the linker can decide which default library to use.

CMake replaces `<FLAGS>` by the content of `CMAKE_<LANG>_FLAGS`.
So any relevant flag needs to be defined in this variable, preferably
in a toolchain file.

The compiler flags have to be specified before the `--run_linker`
flag and the linker flags afterwards.

Replaces Merge-request !4890
2020-07-14 02:41:50 +02:00
Josef Angstenberger
763b44e519 Compiler/TI: Avoid usage of ranlib
If a ranlib executable has been found it is used for finishing
an archive.

In case of the TI compiler the archive file gets corrupted.

Fixes: #14876
2020-07-14 02:23:58 +02:00
Josef Angstenberger
ef528f10bf Compiler/TI: Sync ASM settings to C/CXX
For assembler the same compiler executable is used as for C/CXX.

So the setting shall be kept in sync.
2020-07-14 02:23:57 +02:00
Josef Angstenberger
a548a52230 Compiler/TI: Refactor C/CXX to use a common file 2020-07-14 02:23:57 +02:00
Josef Angstenberger
195aa488e3 Compiler/TI: Detect architecture 2020-07-14 02:23:56 +02:00
Brad King
d8cdec066a Merge topic 'irsl-intel-ia32' into release-3.18
f332ce12d6 IRSL: Fix path to Intel 32-bit redist libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4995
2020-07-10 06:43:58 -04:00
Brad King
2cc5f76701 Merge topic 'irsl-intel-ia32'
f332ce12d6 IRSL: Fix path to Intel 32-bit redist libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4995
2020-07-10 06:43:58 -04:00
Brad King
2e290682b8 Merge topic 'FindOpenMP-version' into release-3.18
656d6ea821 FindOpenMP: Set version variables every time CMake runs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4996
2020-07-10 06:42:43 -04:00
Brad King
c2f6988ec1 Merge topic 'FindOpenMP-version'
656d6ea821 FindOpenMP: Set version variables every time CMake runs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4996
2020-07-10 06:42:43 -04:00
Brad King
13b5588a86 Merge topic 'FindMatlab-unknown-version'
a3c389cb17 FindMatlab: set MATLAB_DEFAULT_RELEASE for unknown version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4986
2020-07-09 06:52:01 -04:00
Brad King
ed9b60e89e Merge topic 'cpack2'
ca9bd43f2d Help: Duplicate essential information on install paths in CPack.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4987
2020-07-09 06:51:01 -04:00
Brad King
395ba3eb17 Merge topic 'FindJava-no-macos-stub'
e8051b1f20 FindJava: Update check to avoid accepting macOS stub 'java' as Java

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4993
2020-07-09 06:49:22 -04:00
Brad King
8e71d199dc Merge topic 'FindJava-no-macos-stub' into release-3.18
e8051b1f20 FindJava: Update check to avoid accepting macOS stub 'java' as Java

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4993
2020-07-09 06:49:21 -04:00
Brad King
9165c839f8 Merge topic 'cuda-11-ptx-arch'
8707178c1c FindCUDA/select_compute_arch: generate PTX for the latest architecture

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4991
2020-07-09 06:47:43 -04:00
Brad King
e69c64a144 Merge topic 'cuda-11-ptx-arch' into release-3.18
8707178c1c FindCUDA/select_compute_arch: generate PTX for the latest architecture

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4991
2020-07-09 06:47:42 -04:00
Brad King
6ce96dfbc7 Merge topic 'doc-CPack-source-package' into release-3.18
f8b7acaf90 Help: Fix CPack module docs on config file for source package

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4985
2020-07-09 06:46:41 -04:00
Brad King
10a5ba8dd8 Merge topic 'doc-CPack-source-package'
f8b7acaf90 Help: Fix CPack module docs on config file for source package

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4985
2020-07-09 06:46:41 -04:00
Torgeir Rusten
f332ce12d6 IRSL: Fix path to Intel 32-bit redist libraries
The path to the 32 bit libraries in the Intel windows/redist folder use
ia32.  I don't remember if this has changed at some point, but ia32 has
been used at least since Intel Fortran XE 2018.
2020-07-09 06:29:40 -04:00
Brad King
656d6ea821 FindOpenMP: Set version variables every time CMake runs
The version is determined in two steps.  First, the "spec date" is
detected and cached.  Second, the date is converted to a version.
Move the second step out of the spec date cache guard condition
so that it runs every time even if the spec date is already cached.

Fixes: #19150
2020-07-09 06:17:44 -04:00