Commit Graph

10291 Commits

Author SHA1 Message Date
Brad King
4e0d69c142 Merge topic 'fortran-subdir-simplify'
a7b844d6d4 CMakeAddFortranSubdirectory: Simplfy logic to always build subdir

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4296
2020-01-29 10:23:19 -05:00
Brad King
0adc266594 Merge topic 'blas-intel-mkl'
4d7c69208e Find{BLAS,LAPACK}: Search always in dynamic linker paths
fde5fcbc71 Find{BLAS,LAPACK}: Avoid repeated setting of prefered library suffixes
fd1d4b823f Find{BLAS,LAPACK}: Fixed incorrect static library suffix for Apple
c60c847510 Find{BLAS,LAPACK}: Added support for MKL single dynamic library
59dbff6daa Find{BLAS,LAPACK}: Added support for static MKL required linker flags
6bd9cee638 Find{BLAS,LAPACK}: Fixed detection of MKL, and several MKL improvements

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4246
2020-01-29 10:22:12 -05:00
Rodolfo Lima
916d54dfb3 FindCUDAToolkit: Fix behavior on multiple calls
Update `_CUDAToolkit_find_and_add_import_lib` to create and add
dependencies to a target in one step that shared a single guard against
repeated definitions.  Otherwise we were adding dependencies again on
every call.

Fixes: #20282
2020-01-28 14:21:24 -05:00
Rodolfo Lima
b452e2bd6a FindCUDAToolkit: Fix CUDA::* target guard logic
Issue: #20282
2020-01-28 14:21:24 -05:00
Brad King
a7b844d6d4 CMakeAddFortranSubdirectory: Simplfy logic to always build subdir
In the case that we use ExternalProject_Add to drive the subdirectory
build, replace the `forcebuild` step with the official `BUILD_ALWAYS`
option.

Issue: #20179
2020-01-28 13:57:05 -05:00
Brad King
1d08099be7 Merge topic 'FindBoost-delay-helper-targets'
e0e87b9d70 FindBoost: Do not add any Boost targets until after Boost found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alexander Grund <github@grundis.de>
Merge-request: !4280
2020-01-28 11:02:41 -05:00
Brad King
193352e420 Merge topic 'clang-tidy-driver-mode'
f6f4eb0907 clang-tidy: Add driver mode argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4208
2020-01-28 11:01:19 -05:00
Brad King
571205fb6b Merge topic 'QNX_CMAKE_SYSROOT'
32a6ab1f3b QNX: Add support for CMAKE_SYSROOT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4277
2020-01-28 10:56:41 -05:00
Brad King
1f9321c683 Merge topic 'cuda_runtime_library_controls'
0d0145138f CUDA: Add abstraction for cuda runtime selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4178
2020-01-28 10:52:33 -05:00
Brad King
2e4a948fb8 Merge topic 'findCUDAToolkit_better_find_root_support'
45d21dd5d4 CUDAToolkit: Use CMAKE_FIND_ROOT_PATH for all sdk lib searches
e357772f20 CUDAToolkit: Use HINTS as it has higher precedence for searches
c6ec51c625 CUDAToolkit: functions names now use CMake's reserved namespace

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4278
2020-01-28 10:49:05 -05:00
Mario Emmenlauer
4d7c69208e Find{BLAS,LAPACK}: Search always in dynamic linker paths
Previously the search in the dynamic linker paths 'LIB', 'LD_LIBRARY_PATH'
and 'DYLD_LIBRARY_PATH' was dependent on the value of the environment
variable 'MKLROOT'. If MKLROOT was given, the dynamic linker paths where
not searched. This seems slightly counter-intuitive.
This PR changes the behavior so that MKLROOT is searched first, but if
unsuccesful, the dynamic linker paths are tried as well.
2020-01-28 10:27:22 +01:00
Mario Emmenlauer
fde5fcbc71 Find{BLAS,LAPACK}: Avoid repeated setting of prefered library suffixes 2020-01-28 10:27:22 +01:00
Mario Emmenlauer
fd1d4b823f Find{BLAS,LAPACK}: Fixed incorrect static library suffix for Apple 2020-01-28 10:27:22 +01:00
Mario Emmenlauer
c60c847510 Find{BLAS,LAPACK}: Added support for MKL single dynamic library 2020-01-28 10:27:22 +01:00
Mario Emmenlauer
59dbff6daa Find{BLAS,LAPACK}: Added support for static MKL required linker flags 2020-01-28 10:27:22 +01:00
Mario Emmenlauer
6bd9cee638 Find{BLAS,LAPACK}: Fixed detection of MKL, and several MKL improvements 2020-01-28 10:27:22 +01:00
Robert Maynard
0d0145138f CUDA: Add abstraction for cuda runtime selection
Fixes #17559
Replace our hard-coded default of cudart=static with a first-class abstraction to select the runtime library from an enumeration of logical names.
2020-01-27 16:02:26 -05:00
Niall Murphy
e0e87b9d70 FindBoost: Do not add any Boost targets until after Boost found
Move creation of the "helper" targets that do not require anything to be
found to be done only after Boost is found.

Fixes: #20261
2020-01-27 15:56:37 -05:00
Stephen Kelly
32a6ab1f3b QNX: Add support for CMAKE_SYSROOT
QCC is a wrapper around GCC, but it is not a fully transparent wrapper.
Some compile options need to be passed to GCC using a `-Wc` option.

QCC does not support --sysroot, so setting CMAKE_SYSROOT in a toolchain
file currently does not work.  This means that it is likely that no one
is setting CMAKE_SYSROOT in existing QNC toolchain files.  Override the
GCC option for sysroot in the QCC.cmake file with -Wc,-isysroot.

This exposes a further issue in that the QNX SDK does not follow the
same architectural folder structure as linux uses.  That is, on linux
systems, architecture-specific libraries might be in

    <sysroot>/usr/lib/<arch>

such as

    /usr/lib/x86_64-linux-gnu/libcurl.so

CMake models this by suffixing the <arch> onto lib directories when
searching for libraries.

The QNX SDK is structured differently such that the <arch> should be
used as a prefix:

    <sysroot>/<arch>/usr/lib

such as

    <sysroot>/x86_64/usr/lib/libcurl.so

Add a variable for platform configuration to set whether to prefix or
suffix the <arch> and set that in the QCC.cmake.

Use the directory structure of the QNX SDK to compute the <arch> from
the implicit library directories.  The assumption is that the arch will
be a single directory directly below the CMAKE_SYSROOT, below which the
usr/ prefix occurs.

It would not be appropriate to instruct users to make the <arch> part of
the sysroot when specified in the toolchain file because:

1.  That would be non-DRY - The QCC wrapper already determines the <arch>
    by the -V argument passed to the compiler, specified in the toolchain
    file as the CMAKE_C_COMPILER_TARGET variable.
2.  The includes in the QNX SDK are not below the <arch> directory.

So, the location of the <arch> in the full path is different on QNX
compared to, say an embedded linux platform, but the intent is the same.

Add documentation to recommend the use of CMAKE_SYSROOT in a QNX
toolchain file.

As the CMAKE_SYSROOT is always the same for QNX, it would be possible to
simply set it in QCC.cmake.  However, that would change behavior for
existing users as when CMAKE_SYSROOT is set, files/paths outside of the
CMAKE_SYSROOT do not get found.

The <arch> prefixing is only enabled in cmSearchPath.cxx if
CMAKE_SYSROOT is set.  This ensures that the user gets consistency in
the current state without CMAKE_SYSROOT, and gets better consistency
when using CMAKE_SYSROOT.
2020-01-27 14:04:56 -05:00
Hanjiang Yu
f6f4eb0907 clang-tidy: Add driver mode argument
`clang-tidy` does not infer driver mode if it is not provided with a
JSON compilation database.  This is exactly the way cmake launches it.
Hence clang-tidy will only use the default driver mode.  Add an explicit
driver mode argument to avoid this.
2020-01-27 13:59:05 -05:00
Robert Maynard
45d21dd5d4 CUDAToolkit: Use CMAKE_FIND_ROOT_PATH for all sdk lib searches 2020-01-27 13:42:18 -05:00
Brad King
fd6c1d99e3 Merge topic 'check-language-make-program'
9d0f61839b CheckLanguage: Pass CMAKE_MAKE_PROGRAM to child process

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4272
2020-01-27 09:35:14 -05:00
Brad King
e0a288b0ff Merge topic 'FindGTest-upstream-lib-names'
fbd3ea2047 FindGTest: Add GTest::{gtest,gtest_main} library names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4268
2020-01-27 09:29:10 -05:00
Brad King
64e3bb4aee Merge topic 'cpack-deb-fix-description'
baec299ecd CPack: Fix regression in Deb description

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4271
2020-01-27 09:27:36 -05:00
Craig Scott
b578b00223 Merge topic 'Qt4Macros-last-ext'
fd83dab339 Qt4Macros: Only cut last extension (".ts") and replace it with ".qm"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4211
2020-01-25 16:48:15 -05:00
Robert Maynard
e357772f20 CUDAToolkit: Use HINTS as it has higher precedence for searches 2020-01-24 15:31:53 -05:00
Robert Maynard
c6ec51c625 CUDAToolkit: functions names now use CMake's reserved namespace 2020-01-24 15:31:36 -05:00
Kyle Edwards
9d0f61839b CheckLanguage: Pass CMAKE_MAKE_PROGRAM to child process
Fixes: #20017
2020-01-24 11:23:04 -05:00
Paweł Bylica
fbd3ea2047 FindGTest: Add GTest::{gtest,gtest_main} library names
This introduces 2 new INTERFACE IMPORTED libraries: GTest::gtest and
GTest::gtest_main. They link to GTest::GTest and GTest::Main targets
respectively, therefore working as aliases. These new names map the
names of the targets from upstream GTest's CMake package config.

Fixes: #20255
2020-01-24 10:18:36 -05:00
Brad King
4dbc9dfc7a Merge topic 'findCUDAToolkit_support_cross_compilation'
48bd2e0630 CUDAToolkit: Make sure to also search 'stubs' directory
69fcad9332 CUDAToolkit: Add support for cross-compiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4253
2020-01-24 09:22:12 -05:00
Brad King
1397b3d26e Merge topic 'fphsa-no-regexp'
31144f85af FPHSA: Check _FOUND var name with STREQUAL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4266
2020-01-24 09:16:19 -05:00
Kyle Edwards
baec299ecd CPack: Fix regression in Deb description
Fixes: #20254
2020-01-24 08:50:43 -05:00
FeRD (Frank Dana)
31144f85af FPHSA: Check _FOUND var name with STREQUAL
Using MATCHES "^${_Name}_FOUND$" limits the name of the found variable,
since it can't contain any regular expression special-chars (period,
plus sign, etc.)
2020-01-23 20:26:05 -05:00
Kai Blaschke
fd83dab339 Qt4Macros: Only cut last extension (".ts") and replace it with ".qm" 2020-01-24 07:55:53 +11:00
Robert Maynard
48bd2e0630 CUDAToolkit: Make sure to also search 'stubs' directory
Fixes #20252
2020-01-23 13:07:21 -05:00
Robert Maynard
69fcad9332 CUDAToolkit: Add support for cross-compiling
CUDAToolkit now searches the correct targets folder based on
what platform we are cross-compiling for.

Fixes: #20232
2020-01-23 12:51:29 -05:00
Brad King
7cc74a59f3 Merge topic 'findmpi-documentation'
95a501addb Help: Add more variable documentation to FindMPI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4263
2020-01-23 10:01:57 -05:00
Brad King
6638fa4ad6 Merge topic 'blas-lapack-whitespace'
beb2bbd5b5 Find{BLAS,LAPACK}: Cleanup whitespace, style, and comments
972c2cc7ca FindLAPACK: Fixed order of arguments for internal helper macro
7346a3226f Find{BLAS,LAPACK}: Clarify names of internal helper macro

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4243
2020-01-23 10:00:13 -05:00
Kyle Edwards
95a501addb Help: Add more variable documentation to FindMPI 2020-01-22 14:46:09 -05:00
Brad King
15c573df41 Merge topic 'mark_as_advanced-without-cache'
3ec82b713e cmMarkAsAdvancedCommand: ignore variables which don't exist in the cache
701a5c60e0 cmake: avoid marking local or unused variables as advanced
af158149e7 FindOpenSSL: do not mark a local variable as advanced
74f659f1f2 FindCurses: only mark CURSES_EXTRA_LIBRARY when it is used
7e2ae4e96d FindOpenGL: only mark declared cache variables as advanced
7cc02a0c29 FindLua: only mark LUA_MATH_LIBRARY as advanced if required
85cd26b8a6 FindBoost: only mark Boost_DIR as advanced if defined
338c7916ba CTest: avoid marking undeclared cache variables as advanced
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4150
2020-01-22 09:50:49 -05:00
Brad King
fbd20759be Merge topic 'FindMPI-fix-return'
8217a26d29 FindMPI: Fix regression when compiling with MPI wrappers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4254
2020-01-22 09:30:53 -05:00
Brad King
39c357b9c4 Merge topic 'msvc-runtime-library-masm' into release-3.16
1421005835 ASM_MASM: Populate MSVC runtime library abstraction table

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4257
2020-01-22 09:17:41 -05:00
Brad King
2bca519eca Merge topic 'msvc-runtime-library-masm'
1421005835 ASM_MASM: Populate MSVC runtime library abstraction table

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4257
2020-01-22 09:17:41 -05:00
Mario Emmenlauer
beb2bbd5b5 Find{BLAS,LAPACK}: Cleanup whitespace, style, and comments
Bring whitespace and code style up to date in these scripts.  Both
scripts share the same origin but have diverged over time, so
synchronize them again.  This is relevant because BLAS and LAPACK
detection is often performed simultaneously, so both scripts should
evolve in sync.  While at it, update a few comments.

This update is intended to have no functional changes.
2020-01-21 22:55:17 +01:00
Mario Emmenlauer
972c2cc7ca FindLAPACK: Fixed order of arguments for internal helper macro 2020-01-21 22:54:15 +01:00
Brad King
99e1be5d43 Merge branch 'msvc-runtime-library-masm' into release-3.15
Merge-request: !4257
2020-01-21 12:55:36 -05:00
Brad King
1421005835 ASM_MASM: Populate MSVC runtime library abstraction table
In commit fb3370b6a1 (MSVC: Add abstraction for runtime library
selection, 2019-04-10, v3.15.0-rc1~229^2) we overlooked populating the
runtime library selection flags for the Microsoft assembler.  It does
not actually have any such flags, but since its compiler id is `MSVC`
our generators expect the table to be populated.  Use empty values.

Without this fix, enabling the `ASM_MASM` language with policy `CMP0091`
set to `NEW` causes an error due to the missing table entries.

Fixes: #20236, #19453
2020-01-21 12:54:50 -05:00
Brad King
763beb5944 FindGTK2: Fix documentation formatting
Fixes: #20223
2020-01-21 12:05:45 -05:00
Brad King
8217a26d29 FindMPI: Fix regression when compiling with MPI wrappers
The change in commit 5861c6d450 (FindMPI: Preserve include order when
extracting component directories, 2019-12-19) converted a CMake-language
function to a macro.  However, it contains a `return()` call that now
applies in the caller's scope, which is in correct.  The `return()` is
meant to skip work when using a MPI compiler wrapper as the main
compiler.  Move that condition to the call site instead.

Fixes: #20234
2020-01-21 10:41:20 -05:00
Brad King
958df7021f Merge topic 'mingw-find-no-dll'
afbbfe5109 MinGW: Update find_library to not find plain .dll files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4248
2020-01-21 09:52:20 -05:00