Commit Graph

10542 Commits

Author SHA1 Message Date
Craig Scott
800e29ab8f Merge topic 'fetchcontent-externalproject-empty-args'
8dca6bd04b FetchContent: Preserve empty string arguments
cbf2daeed0 ExternalProject: Preserve empty string arguments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4729
2020-05-25 17:20:48 -04:00
Brad King
a354b7f21e Merge topic 'CheckLinkerFlag-module'
af96c0f4fa CheckLinkerFlag: Add module to check validity of linker flags
3c4cc77d55 Tests: Extend Fortran compiler information

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4777
2020-05-25 10:59:01 -04:00
Marc Chevrier
af96c0f4fa CheckLinkerFlag: Add module to check validity of linker flags
Fixes: #15934
2020-05-25 10:57:14 -04:00
Brad King
b82bdbf44a Merge topic 'ep-git-update-strategy'
0aea435aa1 ExternalProject: Provide choice of git update strategies
ea410414c5 ExternalProject: factor out gitupdate step to separate file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4239
2020-05-25 10:53:26 -04:00
Brad King
54baf63965 Merge topic 'FindSquish_settingsgroup_removal'
8492ac1363 FindSquish: Remove settingsGroup argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4763
2020-05-25 10:37:11 -04:00
Brad King
f7960e5488 Merge topic 'cuda-runtime-cleanup'
bcb44ac2ee CUDA: Simplify Clang implicit host linker settings
23519dd24f CUDA: Fix implicit runtime library filtering on Windows
16bed00712 CUDA: Refactor implicit library filtering
5c7ca6f8a8 CUDA: Move VS CudaRuntime selection to be with rest of CUDA options
4468acb979 CUDA: Factor runtime library lookup into helper method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !4776
2020-05-25 10:35:13 -04:00
Craig Scott
8dca6bd04b FetchContent: Preserve empty string arguments
Fixes: #20579
2020-05-23 23:42:43 +10:00
Craig Scott
cbf2daeed0 ExternalProject: Preserve empty string arguments 2020-05-23 23:41:53 +10:00
Craig Scott
0aea435aa1 ExternalProject: Provide choice of git update strategies
Fixes: #16528

Co-Authored-By: Michael Wake <macwake@gmail.com>
2020-05-23 22:27:38 +10:00
Craig Scott
ea410414c5 ExternalProject: factor out gitupdate step to separate file
The refactoring exposed that the original implementation
was referring to an undefined variable src_name, which was
previously only used in error messages. This has been fixed
as part of the refactoring work.

Fixes: #20336
2020-05-23 11:01:59 +10:00
Brad King
62816ff88c Merge topic 'fortran-preprocess-property'
3888de23da Ninja: Skip Fortran preprocessing if Fortran_PREPROCESS is OFF
66c4e87282 Ninja: Add helper functions to generate Fortran build
5cca1ec893 Ninja: Add helper functions to generate Fortran preprocess rule
b0a6161190 Fortran: Add Fortran_PREPROCESS property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4659
2020-05-22 10:35:10 -04:00
Brad King
bcb44ac2ee CUDA: Simplify Clang implicit host linker settings
The purpose of `CMAKE_CUDA_HOST_IMPLICIT_LINK_*` is to capture the
extra link libraries and directories that the CUDA compiler passes
when invoking the host linker.  We need this when using NVCC because
CMake drives the host linker directly rather than through NVCC.
However, this is not needed with Clang because:

* Clang does not pass any CUDA libraries automatically.
* We drive linking with the Clang compiler anyway.

Drop the detection logic for Clang because it only gives the normal C++
runtime libraries which we do not need here.
2020-05-22 08:15:38 -04:00
Brad King
23519dd24f CUDA: Fix implicit runtime library filtering on Windows
The CUDA runtime library names may have a `.lib` suffix.
Exclude those too.
2020-05-22 08:15:38 -04:00
Brad King
16bed00712 CUDA: Refactor implicit library filtering
Filter CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES just after it is
computed.  Re-use the same exclusion list for filtering
CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES to avoid duplication.
2020-05-22 08:15:38 -04:00
Brad King
a7b3102e00 Merge topic 'support_conda_env'
50879ce412 Conda: Add CONDA_PREFIX as an acceptable system prefix path
cd9c3c000f Tests: Update QtAutogen codeeditor test only include headers needed
d806bd2e8c Tests: Update test suite to run in an Anaconda environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4773
2020-05-22 08:12:24 -04:00
Brad King
b54280beb7 Merge topic 'cuda-default-runtime'
d8eee80e30 Merge branch 'backport-cuda-default-runtime' into cuda-default-runtime
e55b21e24e CUDA: Compute CMAKE_CUDA_RUNTIME_LIBRARY default from toolchain
1086e930dc CUDA: Propagate CMAKE_CUDA_RUNTIME_LIBRARY state to try_compile
a4ea293153 Help: Correct CMAKE_CUDA_RUNTIME_LIBRARY applicability

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4762
2020-05-22 06:55:37 -04:00
Brad King
d8eee80e30 Merge branch 'backport-cuda-default-runtime' into cuda-default-runtime 2020-05-22 06:50:19 -04:00
Peter Hill
b0a6161190 Fortran: Add Fortran_PREPROCESS property
Issue: #18870
2020-05-21 11:44:14 -04:00
Brad King
d8b3160ce9 Merge topic 'FindPython-debug-library-lookup'
596db17cdd Merge branch 'backport-3.17-FindPython-debug-library-lookup' into FindPython-debug-library-lookup
e7b9f928f7 FindPython: use CMAKE specific variables to look-up debug library
71e6854b22 FindPython: use CMAKE specific variables to look-up debug library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4764
2020-05-21 11:36:09 -04:00
Robert Maynard
50879ce412 Conda: Add CONDA_PREFIX as an acceptable system prefix path 2020-05-21 11:32:36 -04:00
Robert Maynard
e55b21e24e CUDA: Compute CMAKE_CUDA_RUNTIME_LIBRARY default from toolchain
Since commit 0d0145138f (CUDA: Add abstraction for cuda runtime
selection, 2019-11-29, v3.17.0-rc1~83^2) we add CUDA runtime library
selection flags by default.

To maintain backwards compatibility the default CUDA runtime
library needs to be computed based on what libraries are found
on the initial compiler invocation. For example a toolchain
could establish initial flags that have all CUDA compilations
using the runtime version, and if we don't detect this we will
try to link to both the static and shared runtime.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #20708
2020-05-21 11:15:03 -04:00
Craig Scott
ddcc5a350c Merge topic 'doc-CMAKE_SYSTEM_PREFIX_PATH'
6b3d8f281e Document which environment variables effect CMAKE_SYSTEM_PREFIX_PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4748
2020-05-20 06:28:11 -04:00
Robert Maynard
6b3d8f281e Document which environment variables effect CMAKE_SYSTEM_PREFIX_PATH 2020-05-19 10:57:09 -04:00
Brad King
2fe2d47b33 Merge topic 'FindHDF5-cleanup'
8fa58aea77 FindHDF5: Clean variables and output

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4759
2020-05-19 09:52:22 -04:00
Frederik Gladhorn
8492ac1363 FindSquish: Remove settingsGroup argument
This argument never worked and was not passed on Windows, which is why
the Windows version needs fewer fixups (and used to work independent of
this change).
On Linux (and macOS) it was passed and prevented the server from starting and the
test would not be able to run.

See also comments on https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4648
2020-05-19 11:47:19 +02:00
Seth R Johnson
8fa58aea77 FindHDF5: Clean variables and output
The module's functionality is preserved.  Perform cleanups:

- Format some functions
- Change macros to functions
- Fix return value check from execute_process
- Hide status messages unless HDF5_FIND_DEBUG is enabled
- Normalize TRUE/FALSE capitalization

Fixes: #20718
2020-05-18 12:40:01 -04:00
Brad King
d7e82a11d5 Merge topic 'fetchcontent-SOURCE_SUBDIR'
592085b94b FetchContent: Add support for SOURCE_SUBDIR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4757
2020-05-18 12:31:54 -04:00
Brad King
b246dee7db Merge topic 'cuda-clang'
a653ca9504 Tests: Update CUDA tests to work with Clang
5df21adf46 CUDA: Add support for Clang compiler
dc2eae1f91 FindCUDAToolkit: Factor out discovery code into a separate file
70be10cbf4 CUDA: Remove toolkit include dirs from implicit include dirs only with NVIDIA

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Artem Belevich <tra@google.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Acked-by: friendnick <ikoval67@gmail.com>
Acked-by: Patrik Huber <patrikhuber@gmail.com>
Merge-request: !4442
2020-05-18 12:29:44 -04:00
Brad King
31252bd335 Merge topic 'FindOpenSSL-applink'
7b83ca816a FindOpenSSL: add target OpenSSL::applink to support OpenSSL's applink feature

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4737
2020-05-18 12:22:24 -04:00
Marc Chevrier
e7b9f928f7 FindPython: use CMAKE specific variables to look-up debug library
Fixes: #20714
2020-05-18 15:11:19 +02:00
Craig Scott
592085b94b FetchContent: Add support for SOURCE_SUBDIR
Fixes: #19875
2020-05-16 17:01:10 +10:00
Raul Tambre
5df21adf46 CUDA: Add support for Clang compiler
When crosscompiling we pass the sysroot.

We need to try various architecture flags. Clang doesn't automatically
select one that works.  First try the ones that are more likely to work
for modern installations:

* <=sm_50 is deprecated since CUDA 10.2, try sm_52 first for
          future compatibility.
* <=sm_20 is removed since CUDA 9.0, try sm_30.

Otherwise fallback to Clang's current default. Currently that's `sm_20`,
the lowest it supports.

Separable compilation isn't supported yet.

Fixes: #16586
2020-05-15 17:46:51 +03:00
Raul Tambre
dc2eae1f91 FindCUDAToolkit: Factor out discovery code into a separate file
This allows for re-use in other parts of the code, that require the CUDA
toolkit location, but can't or may not want to use the full
`FindCUDAToolkit`.
2020-05-15 17:46:51 +03:00
Brad King
70be10cbf4 CUDA: Remove toolkit include dirs from implicit include dirs only with NVIDIA
The special case added by commit 87df637078 (CUDA: Do not treat CUDA
toolkit include directories as implicit, 2020-02-02, v3.17.0-rc1~31^2)
breaks CMake's protections against changing the compiler's implicit
include directory order.  Do this only for the NVIDIA compiler where it
is needed as a workaround to another problem.  That compiler does not
put the host compiler's implicit include directories in `-I` paths so we
do not detect them as `CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES` anyway.
2020-05-15 17:46:51 +03:00
Brad King
a9559ccba5 Merge topic 'objc-env-vars'
13ea190725 Help: Add 3.17.3 release note for Objective C/C++ compiler selection
16bf978e0c Merge branch 'backport-3.16-objc-env-vars' into objc-env-vars
67b9f55d46 Objective C/C++: Honor CC and CXX env vars to select compiler
ab9be6662f Help: Document OBJC and OBJCXX env vars for Objective C/C++ compilers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4746
2020-05-15 09:15:46 -04:00
Brad King
96b6bafd17 Merge topic 'FindSquish-add_test'
2137384202 FindSquish: Make squish_add_test work with any Squish version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4648
2020-05-15 09:14:36 -04:00
gnaggnoyil
7b83ca816a FindOpenSSL: add target OpenSSL::applink to support OpenSSL's applink feature
Fixes: #20701
2020-05-15 15:50:10 +08:00
Brad King
165da10680 Merge topic 'squish_windows_ext'
c587b8d026 FindSquish: Fix target app name on windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4742
2020-05-14 07:46:59 -04:00
Brad King
16bf978e0c Merge branch 'backport-3.16-objc-env-vars' into objc-env-vars 2020-05-14 07:27:24 -04:00
Brad King
67b9f55d46 Objective C/C++: Honor CC and CXX env vars to select compiler
If the `OBJC` or `OBJCXX` environment variable is not set to specify an
Objective C or C++ compiler, check `CC` or `CXX` too.

Fixes: #20703
2020-05-14 07:17:48 -04:00
Brad King
b07bc05961 Merge topic 'fix-cache-args-file-to-dep-list' into release-3.17
0199dd9f1b ExternalProject: expose _ep_cache_args_script to the caller

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4710
2020-05-13 12:12:28 -04:00
Brad King
0d8aec412a Merge topic 'fix-cache-args-file-to-dep-list'
0199dd9f1b ExternalProject: expose _ep_cache_args_script to the caller

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4710
2020-05-13 12:12:28 -04:00
Brad King
3bb261b0fe Merge topic 'conditional-CMAKE_EXPORT_COMPILE_COMMANDS'
fe19df49d4 Initialize CMAKE_EXPORT_COMPILE_COMMANDS only if not set already

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4738
2020-05-13 07:42:52 -04:00
Brad King
7c4f609eed Merge topic 'FindPython-IronPython-support'
e8ffc60220 FindPython: Add IronPython support on all platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4730
2020-05-13 07:41:45 -04:00
Frederik Gladhorn
2137384202 FindSquish: Make squish_add_test work with any Squish version
Update the documentation (Squish 4 is from 2010, so people are likely
using something newer) and let squish_add_test call either the v3 or v4
macro based on the detected Squish version.

This cannot break things, since mixing incompatible versions would not
have worked before.
2020-05-13 07:06:34 -04:00
Frederik Gladhorn
c587b8d026 FindSquish: Fix target app name on windows
Windows has .exe in the target name, but Squish only uses the name without extension
which makes things a lot easier when running tests on several platforms.

Discovered when coming back to Windows and doing a fresh build and suddenly the
binary to be tested was no longer found due to the name mismatch.
2020-05-13 11:51:27 +02:00
Ben Boeckel
0199dd9f1b ExternalProject: expose _ep_cache_args_script to the caller
This is needed so that the caller can add a dependency on the cache
file.

Fixes: #20668
2020-05-12 10:34:23 -04:00
Brad King
fe19df49d4 Initialize CMAKE_EXPORT_COMPILE_COMMANDS only if not set already
Also de-duplicate its initialization code.

Fixes: #16588
2020-05-12 08:08:20 -04:00
Brad King
91dd23d3d5 Merge topic 'pch-msvc-pragma' into release-3.17
6c2514dabe MSVC: Use 'pragma system_header' in PCH only on cl 19.13 and above

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4736
2020-05-12 06:52:40 -04:00
Brad King
cd89ebdda2 Merge topic 'pch-msvc-pragma'
6c2514dabe MSVC: Use 'pragma system_header' in PCH only on cl 19.13 and above

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4736
2020-05-12 06:52:40 -04:00