Commit Graph

10075 Commits

Author SHA1 Message Date
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
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
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
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
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
Brad King
bcb0816cf9 Merge topic 'InstallRequiredSystemLibraries-redist' into release-3.16
7ca923bcaf IRSL: Install msvcp140_{1,2,codecvt_ids}.dll if available

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Andrey Vihrov <andrey.vihrov@gmail.com>
Merge-request: !4247
2020-01-21 09:15:17 -05:00
Brad King
01f0a5d3dd Merge topic 'InstallRequiredSystemLibraries-redist'
7ca923bcaf IRSL: Install msvcp140_{1,2,codecvt_ids}.dll if available

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Andrey Vihrov <andrey.vihrov@gmail.com>
Merge-request: !4247
2020-01-21 09:15:17 -05:00
Ben Boeckel
af158149e7 FindOpenSSL: do not mark a local variable as advanced 2020-01-20 15:49:29 -05:00
Ben Boeckel
74f659f1f2 FindCurses: only mark CURSES_EXTRA_LIBRARY when it is used 2020-01-20 15:49:29 -05:00
Ben Boeckel
7e2ae4e96d FindOpenGL: only mark declared cache variables as advanced 2020-01-20 15:49:29 -05:00
Brad King
afbbfe5109 MinGW: Update find_library to not find plain .dll files
Modern distributions of packages built with MinGW tools provide `.dll.a`
import libraries.  Prefer those instead of finding plain `.dll` files.
This avoids accidentally finding unrelated Windows `.dll` files.

Fixes: #20019
2020-01-20 13:31:45 -05:00
Brad King
7ca923bcaf IRSL: Install msvcp140_{1,2,codecvt_ids}.dll if available
VS now distributes these additional runtime libraries.  Install them if
available.

Fixes: #20228
2020-01-20 13:19:56 -05:00
Brad King
bf3142e253 Merge topic 'fphsa-name-mismatch'
be4d1bdf9a FPHSA: acknowledge the name mismatches in CMake-owned modules
ee4673c1ae FPHSA: detect package name mismatches

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Eric Noulard <eric.noulard@gmail.com>
Merge-request: !4123
2020-01-20 11:53:14 -05:00
Mario Emmenlauer
7346a3226f Find{BLAS,LAPACK}: Clarify names of internal helper macro
Also clarify names of their arguments.
2020-01-20 11:30:53 -05:00
Brad King
f80437ad34 Merge topic 'csharp-default-langversion'
2e882b4275 CSharp: Set C# compiler to default version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4232
2020-01-17 09:37:57 -05:00
Brad King
4c907eae69 Merge topic 'findopenssl-dependencies-link-order' into release-3.16
d2880aaa06 FindOpenSSL: Fix ordering of dependency link flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4235
2020-01-17 09:25:23 -05:00
Brad King
b2edb72642 Merge topic 'nag-submodule'
f7f60ddcf9 Fortran: Add support for NAG Fortran submodules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4229
2020-01-16 10:56:03 -05:00
Brad King
8cd35baae9 Merge topic 'nag-submodule' into release-3.16
f7f60ddcf9 Fortran: Add support for NAG Fortran submodules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4229
2020-01-16 10:56:02 -05:00
Ashley Whetter
d2880aaa06 FindOpenSSL: Fix ordering of dependency link flags
Fixes: #20082, #20224
2020-01-16 10:53:19 -05:00
Brad King
05738b5f21 Merge topic 'pch_job_pool'
97c124e30f Ninja: Add a separate job pool for PCH creation
ebd0b16ddb vim: Add target_precompile_headers command highlighting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !4224
2020-01-16 10:33:48 -05:00
Dan Johnston
97c124e30f Ninja: Add a separate job pool for PCH creation
Add a `JOB_POOL_PRECOMPILE_HEADER` target property to specify the pool
name, and its associated `CMAKE_JOB_POOL_PRECOMPILE_HEADER` variable.

Fixes: #20217
2020-01-16 10:32:25 -05:00