Commit Graph

10542 Commits

Author SHA1 Message Date
Markus Rickert
dd506714f4 FindLibXslt: identify libexslt include directory 2020-04-28 19:12:18 +02:00
Jiri Malak
d3640dbdd5 OpenWatcom: Organize and update C/C++ toolchain command lines 2020-04-28 09:36:05 -04:00
Jiri Malak
7aa9e89b1c OpenWatcom: Move non-Windows settings to Modules/Compiler
Restructure OpenWatcom toolchain support files to simplify adding of new
targets DOS, OS/2 and Linux including cross-compilation.
2020-04-28 09:36:04 -04:00
Marc Chevrier
d2c47c822b FindPython: Add capability to specify Python implementations
Through hint Python_FIND_IMPLEMENTATIONS it is possble to specify, as an
ordered list, which implementations must be searched for.
Currently possible values are:
* CPython
* IronPython
2020-04-28 13:56:18 +02:00
pheonix xx
5c40e5ddb4 FindVulkan: Prefer VULKAN_SDK env var before standard paths
Reference the environment variable as HINTS instead of PATHS.

Fixes: #20637
2020-04-28 07:25:55 -04:00
Brad King
73f81c5070 Merge topic 'FindLAPACK-target'
4ed936d1b8 FindLAPACK: Provide the LAPACK::LAPACK import target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4677
2020-04-28 07:18:41 -04:00
Brad King
4bc4e14899 Merge topic 'FindBoost-1.73'
69ed51960b FindBoost: Prevent warning with boost 1.73

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4662
2020-04-28 07:14:09 -04:00
Brad King
ee1dd905c0 Merge topic 'FindBoost-1.73' into release-3.17
69ed51960b FindBoost: Prevent warning with boost 1.73

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4662
2020-04-28 07:14:08 -04:00
Orgad Shaneh
69ed51960b FindBoost: Prevent warning with boost 1.73
In commit 9daf79c53b (FindBoost: Add support for Boost 1.73, 2020-04-19)
we forgot to update the version comparison for the warning.
2020-04-27 14:34:02 -04:00
Robert Maynard
4ed936d1b8 FindLAPACK: Provide the LAPACK::LAPACK import target 2020-04-27 14:19:02 -04:00
Brad King
9e3d982e05 Merge topic 'FindPython-reason-failure'
a7eca04163 FindPython: fix reason failure propagation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4660
2020-04-27 10:41:20 -04:00
Brad King
0ae7232334 Merge topic 'FindBLAS-target'
85a9813a76 BLAS: Provide the BLAS::BLAS import target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4657
2020-04-27 10:39:30 -04:00
Marc Chevrier
a7eca04163 FindPython: fix reason failure propagation 2020-04-24 15:47:05 +02:00
Brad King
360862f845 Merge topic 'FindPython-fix-python-compiler-validation'
f39da773ee FindPython: fix python compiler validation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4655
2020-04-24 08:36:17 -04:00
Robert Maynard
85a9813a76 BLAS: Provide the BLAS::BLAS import target 2020-04-23 13:59:33 -04:00
Marc Chevrier
f39da773ee FindPython: fix python compiler validation
Ensure also the cache of properties is erased in case of multiple
searches.

Fixes: #20626, #20627
2020-04-23 17:47:22 +02:00
Brad King
61ac8e6dfa Merge topic 'remove-documentation-module'
306a1ba960 Modules/Documentation: remove
ad4487a96a cmIncludeCommand: add infrastructure for deprecated modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4617
2020-04-23 09:15:24 -04:00
Brad King
b779cb13b4 Merge topic 'ninja-compiler-PATH-windows'
e01990999a Ninja: On Windows, select the compiler occurring first in PATH

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4625
2020-04-23 09:13:56 -04:00
Ben Boeckel
306a1ba960 Modules/Documentation: remove
This is an old module from when VTK and other Kitware projects drove the
addition of commands and modules into CMake itself. Modern VTK doesn't
need this module and it can be ignored.

This module is kept around so that the ancient VTK versions which use it
are not broken by it. VTK itself stopped using the module in 2012 and
the last usage by an example in VTK was removed in 2020.

Fixes: #20591
2020-04-22 10:46:03 -04:00
Brad King
370def7b3e Merge topic 'FindSquish-windows'
c77c92791c FindSquish: Fix setting the application under test
879b279154 FindSquish: Fix launching the Squish server process on Windows
0bc4fa2be2 FindSquish: Fix finding on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4620
2020-04-22 08:34:24 -04:00
Brad King
e01990999a Ninja: On Windows, select the compiler occurring first in PATH
On Windows, toolchains like MSVC require a set of environment variables
to be configured for the compiler to work correctly.  The scripts that
prepare these environments typically put the compiler's directory ahead
of others in the `PATH`.  Teach the Ninja generators to use this as a
heuristic to select the compiler when none is explicitly specified.

This is not necessary with Makefile generators because each toolchain's
environment comes with its own make tool variant, and the corresponding
Makefile generator (e.g. "NMake Makefiles") automatically implies the
matching compiler.

Fixes: #20585
2020-04-22 08:03:16 -04:00
Brad King
a583360d10 Merge topic 'external-project-mkdir-step-fix'
e5b33871ed ExternalProject: Fix step dependency on mkdir step

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4640
2020-04-21 08:21:46 -04:00
Brad King
a0cf159b9b Merge topic 'FindMPI-msmpi-env'
faa0c62106 FindMPI: Normalize paths from MSMPI environment variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4644
2020-04-21 08:20:48 -04:00
Brad King
22d2354ec5 Merge topic 'nasm-with-CXX'
3328e0a387 NASM: Fix object format when CXX is enabled but not C

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4642
2020-04-21 08:17:43 -04:00
Brad King
cd957389f2 Merge topic 'findpython-remove-unneeded-guard'
c6ba196314 FindPython: remove unnecessary if check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4641
2020-04-21 08:16:39 -04:00
Brad King
dba914aa31 Merge topic 'ti-compilers-fix-cxx'
65c1320719 Compiler/TI: Fix C++ toolchain command-lines
4110d9dffb Compiler/TI: Fix linker command line for C++

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4627
2020-04-21 08:15:31 -04:00
Brad King
4a5de69e09 Merge topic 'FindBoost-1.73' into release-3.17
9daf79c53b FindBoost: Add support for Boost 1.73
f48051d33f FindBoost: Simplify Boost_VERSION_STRING comparisons
56b3375f3e BoostScanDeps: Fix typo in numpy handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4635
2020-04-21 07:44:31 -04:00
Brad King
3465ae916f Merge topic 'FindBoost-1.73'
9daf79c53b FindBoost: Add support for Boost 1.73
f48051d33f FindBoost: Simplify Boost_VERSION_STRING comparisons
56b3375f3e BoostScanDeps: Fix typo in numpy handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4635
2020-04-21 07:44:31 -04:00
Frederik Gladhorn
c77c92791c FindSquish: Fix setting the application under test
The AUT (application under test) was previously set by trying to extract the target location,
which is no longer supported.
2020-04-20 22:20:11 +02:00
Frederik Gladhorn
879b279154 FindSquish: Fix launching the Squish server process on Windows
There are countless posts (e.g. stack overflow) that start /b takes a window title as first argument.
Once I added a random string there the server was started and things started to work.
2020-04-20 22:20:11 +02:00
Brad King
faa0c62106 FindMPI: Normalize paths from MSMPI environment variables
Fixes: #20606
2020-04-20 13:39:06 -04:00
Vyacheslav Yurkov
e5b33871ed ExternalProject: Fix step dependency on mkdir step
When looking at `list(FIND)` result, zero index is ignored due to
incorrect error handling, and users can't set dependencies on mkdir
step.

Fixes: #20605
2020-04-20 18:49:17 +02:00
Christian Feldmann
3328e0a387 NASM: Fix object format when CXX is enabled but not C
Check CXX data pointer size if C is not set.
2020-04-20 11:07:30 -04:00
Ben Boeckel
c6ba196314 FindPython: remove unnecessary if check
`list(REMOVE_DUPLICATES)` is safe on empty lists since 3.14.
2020-04-20 10:30:09 -04:00
Alexander Grund
9daf79c53b FindBoost: Add support for Boost 1.73
Run `Utilities/Scripts/BoostScanDeps.cmake` with the Boost 1.73.0
sources to compute dependencies.

This includes a new Boost.Nowide library.

Special case: Boost.Filesystem is an optional dependency as the include
is only required to make Boost.Filesystem use UTF-8 paths on user
request
2020-04-20 08:27:32 -04:00
Alexander Grund
f48051d33f FindBoost: Simplify Boost_VERSION_STRING comparisons 2020-04-20 08:27:32 -04:00
Brad King
5d32699975 Merge topic 'device-link'
4248bb452a CUDA: Device linking use now link options
ec48e023f6 CUDA: Add information for LINKER: pattern translation
3fdae5acaa Genex: Add generator expressions $<DEVICE_LINK> and $<HOST_LINK>
38332fc4fa cmGeneratorExpressionDAGChecker: introduce method Top()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !4577
2020-04-20 08:14:16 -04:00
Marc Chevrier
4248bb452a CUDA: Device linking use now link options
properties LINK_OPTIONS and INTERFACE_LINK_OPTIONS are propagated
to the device link step.

To control which options are selected for normal link and device link steps,
the $<DEVICE_LINK> and $<HOST_LINK> generator expressions can be used.

Fixes: #18265
2020-04-19 15:53:11 +02:00
Marc Chevrier
ec48e023f6 CUDA: Add information for LINKER: pattern translation 2020-04-19 15:04:56 +02:00
Rolf Eike Beer
95ead38375 FindPkgConfig: fix handling of frameworks 2020-04-18 17:14:56 +02:00
Alekseev Alexey
65c1320719 Compiler/TI: Fix C++ toolchain command-lines
Applied commit 5a0fc68312 (TI: Fix C toolchain command-lines, 2020-03-03) for C++:
Fix `armar` arguments.  Fix the linker `--map_file=` argument.
Enable response files.
2020-04-18 12:12:20 +03:00
Alekseev Alexey
4110d9dffb Compiler/TI: Fix linker command line for C++
Just like C, libraries must be in the last part of the linker.
Commit 89317915d9 (Compiler/TI: Pass libraries as last part to linker, 2016-06-02)
2020-04-18 12:12:20 +03:00
Ben Boeckel
62b51845db FindPython: fix some indentation 2020-04-17 09:00:26 -04:00
Brad King
ee79216b82 Merge topic 'ios_multi_arch_fix' into release-3.17
170e598add iOS: Fix detection of supported SDK architectures

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Merge-request: !4615
2020-04-17 08:07:29 -04:00
Brad King
ea2f95f4b9 Merge topic 'ios_multi_arch_fix'
170e598add iOS: Fix detection of supported SDK architectures

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Merge-request: !4615
2020-04-17 08:07:29 -04:00
Brad King
d601a2c75c Merge topic 'FindPython-dev-subcomponents'
c1b4044d3e FindPython: add sub-components to Development component

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !4616
2020-04-17 08:05:39 -04:00
Frederik Gladhorn
0bc4fa2be2 FindSquish: Fix finding on Windows
The whole script looks rather dated and dusty, but it actually does find
newer Squish versions - e.g. version 6.5 here.
I assume more work is needed, but at least with this tiny patch the path
is located on Windws when the SQUISH_INSTALL_DIR environment variable is
set.
2020-04-16 23:52:50 +02:00
Brad King
7e8df1bb24 Merge topic 'cuda_architectures'
21131ca60c CUDA: Add CudaOnly.CompileFlags test
f0931b0790 CUDA: Convert tests to use CUDA_ARCHITECTURES
e98588aaba CUDA: Add CUDA_ARCHITECTURES target property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Patrick Stotko <stotko@cs.uni-bonn.de>
Merge-request: !4568
2020-04-16 11:11:33 -04:00
Marc Chevrier
c1b4044d3e FindPython: add sub-components to Development component
Fixes: #20425
2020-04-16 14:38:39 +02:00
Alexandru Croitor
170e598add iOS: Fix detection of supported SDK architectures
Instead of relying on SDKSettings.plist which does not contain the
certain architectures, deduce the supported architectures by
inspecting libSystem.tbd and libSystem.dylib.

.tbd files are text files, so just parse out the archs string.
.dylib files can be fat or non-fat, so use lipo -info to extract
the architectures and parse lipo output.

Fixes: #20588
2020-04-16 07:51:03 -04:00
Raul Tambre
e98588aaba CUDA: Add CUDA_ARCHITECTURES target property
Simplifies CUDA target architecture handling.

Required for Clang support as Clang doesn't automatically select a supported architecture.
We detect a supported architecture during compiler identification and set CMAKE_CUDA_ARCHITECTURES to it.

Introduces CMP0104 for backwards compatibility with manually setting code generation flags with NVCC.

Implements #17963.
2020-04-15 17:55:41 +03:00
Brad King
5e70315fa8 Merge topic 'support_pseudo_sysroots'
8cc384f629 Compilers: Add paths from -print-sysroot to system prefix path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4585
2020-04-15 09:53:08 -04:00
Brad King
4f7d16c68f Merge topic 'cpack-nsis-dpi-aware'
d6840a4f3c CPack/NSIS: Add option for setting DPI-aware

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4607
2020-04-15 09:50:49 -04:00
Brad King
0a6b715c5c Merge topic 'CMakePrintSystemInformation-processor'
06e2c54115 CMakePrintSystemInformation: Add CMAKE_SYSTEM_PROCESSOR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4608
2020-04-15 09:42:41 -04:00
Brad King
5fde1af854 Merge topic 'FindPython-if-auto-deref' into release-3.17
894fdea2a9 FindPython: remove extra dereference
0b9c9e2c8c FindPython: avoid autoderef in version comparisons

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4610
2020-04-15 09:38:03 -04:00
Brad King
d561898572 Merge topic 'FindPython-if-auto-deref'
894fdea2a9 FindPython: remove extra dereference
0b9c9e2c8c FindPython: avoid autoderef in version comparisons

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4610
2020-04-15 09:38:03 -04:00
Brad King
d93ce24b0f Merge topic 'FindCUDAToolkit-search-stubs'
4f1e24efa0 FindCUDAToolkit searches stub location last

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4589
2020-04-15 09:36:25 -04:00
Brad King
17e6666a43 Merge topic 'FindCUDAToolkit-search-stubs' into release-3.17
4f1e24efa0 FindCUDAToolkit searches stub location last

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4589
2020-04-15 09:36:24 -04:00
Robert Maynard
8cc384f629 Compilers: Add paths from -print-sysroot to system prefix path 2020-04-14 13:48:28 -04:00
Ben Boeckel
894fdea2a9 FindPython: remove extra dereference
If the version is not found (e.g., missing headers), this causes a CMake
error about `if(blah VERSION_EQUAL)` being an invalid statement.
2020-04-14 11:03:35 -04:00
Ben Boeckel
0b9c9e2c8c FindPython: avoid autoderef in version comparisons 2020-04-14 11:03:35 -04:00
Jiri Malak
06e2c54115 CMakePrintSystemInformation: Add CMAKE_SYSTEM_PROCESSOR 2020-04-14 09:48:50 -04:00
Robert Maynard
4f1e24efa0 FindCUDAToolkit searches stub location last
Fixes #20252
2020-04-14 09:39:46 -04:00
Brad King
ce9777c62f Merge topic 'UseJava-quoting'
01d5b888a3 UseJava: Quote -classpath argument correctly on more platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Marc Chevrier <marc.chevrier@gmail.com>
Merge-request: !4597
2020-04-14 09:39:37 -04:00
Johnny Jazeix
d6840a4f3c CPack/NSIS: Add option for setting DPI-aware
See https://nsis.sourceforge.io/Reference/ManifestDPIAware
for more information.

Fixes: #17724
2020-04-14 13:47:49 +02:00
Brad King
adc58e9612 Merge topic 'FindMPI-pgi-spectrum-mpi-wrappers'
cd449c6175 FindMPI: Add the pgi compiler wrapper names used by IBM Spectrum MPI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4598
2020-04-13 10:57:23 -04:00
Brad King
e14386db8f Merge topic 'FindMPI-pgi-spectrum-mpi-wrappers' into release-3.17
cd449c6175 FindMPI: Add the pgi compiler wrapper names used by IBM Spectrum MPI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4598
2020-04-13 10:57:22 -04:00
Brad King
b30e5fd972 Merge topic 'clang_cuda_prep'
d86fcc6359 CUDAToolkit: Deduce toolkit binary directory from compiler path only for NVCC
87e98bf8be CUDA: Forward CMAKE_CUDA_COMPILER_TARGET in try_compile()
60e60b9201 GNU: Disable depfiles in try-compile mode only for GCC
5f02add366 CUDA: Refactor PTX compilation flag into compiler modules
25439c7d62 Clang: Refactor CXX standard flags into __compiler_clang_cxx_standards()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4567
2020-04-13 10:46:12 -04:00
Marc Chevrier
525c730afe Help: FindPython: fix typos and add some clarifications 2020-04-11 12:57:23 +02:00
Chuck Atkins
cd449c6175 FindMPI: Add the pgi compiler wrapper names used by IBM Spectrum MPI 2020-04-10 12:01:59 -04:00
Brad King
7e302b6438 Merge topic 'openal-typo'
dab57d3f5f FindOpenAL: Fix documentation typos

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4596
2020-04-10 11:05:37 -04:00
Brad King
01d5b888a3 UseJava: Quote -classpath argument correctly on more platforms
Add the `VERBATIM` option to our `add_custom_command` calls so that all
arguments are correctly escaped for the shell.  Otherwise when using a
POSIX shell on Windows, the `-classpath` separator is `;` and without
quoting ends the command.

Fixes: #20567
Inspired-by: Nevyn Bengtsson <nevyn.jpg@gmail.com>
2020-04-10 10:59:30 -04:00
Nguyễn Gia Phong
dab57d3f5f FindOpenAL: Fix documentation typos 2020-04-10 20:49:10 +07:00
Brad King
35eb021942 Merge topic 'FindBLAS_FindLAPACK_ArmPL'
14ffa6e90e Find{BLAS,LAPACK}: Add support for ArmPL targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4502
2020-04-10 09:47:29 -04:00
Brad King
6c737b273a Merge topic 'googletest-skipped'
89a843d6ea GoogleTest: Add testcase for skipped tests
98868dad1c GoogleTest: Add support for skipped tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4586
2020-04-10 09:46:14 -04:00
Alexander Stein
98868dad1c GoogleTest: Add support for skipped tests
Skipped tests are currently reported as successful. Using
SKIP_REGULAR_EXPRESSION on googletest's output prefix, skipped tests can
be detected and accounted accordingly.
Using SKIP_RETURN_CODE is not possible, googletests exit code is not
affected by skipped tests.

Fixes: #19669
2020-04-10 09:43:26 -04:00
Olly Perks
14ffa6e90e Find{BLAS,LAPACK}: Add support for ArmPL targets
Add support for the Arm Performance Libraries (ArmPL) which provide an
implementation of BLAS, LAPACK and FFTW for use on Arm Linux systems:

    https://developer.arm.com/tools-and-software/server-and-hpc/compile/arm-compiler-for-linux/arm-performance-libraries
2020-04-09 11:55:04 -04:00
Brad King
e2a1b463a9 Merge topic 'CTestCoverageCollectGCOV-log'
5b12fe4633 CTestCoverageCollectGCOV: Avoid capturing gcov output in QUIET mode
43aaf2ac1e CTestCoverageCollectGCOV: Capture gcov output in log file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4582
2020-04-09 08:29:12 -04:00
Brad King
5b12fe4633 CTestCoverageCollectGCOV: Avoid capturing gcov output in QUIET mode
The `QUIET` mode suppresses any mention of our logged output, so do not
bother logging it.  This also provides a way for users to avoid saving
possibly large output on disk.

Fixes: #20554
2020-04-08 13:53:36 -04:00
Brad King
43aaf2ac1e CTestCoverageCollectGCOV: Capture gcov output in log file
The output of gcov can be large and we only display it in a failure
case.  Put it in a log file to avoid accumulating large output in
memory.

Issue: #20554
2020-04-08 13:52:37 -04:00
Brad King
da25220d83 Merge branch 'backport-3.17-apple-arch-sysroots' into apple-arch-sysroots 2020-04-08 13:44:42 -04:00
Brad King
45fa9b32ca Apple: Improve handling of missing SDKs in CMAKE_APPLE_ARCH_SYSROOTS
Use `<arch>-SDK-NOTFOUND` instead of an empty string as a placeholder in
`CMAKE_APPLE_ARCH_SYSROOTS` for architectures whose SDK is not found.
This ensures the length of `CMAKE_APPLE_ARCH_SYSROOTS` matches the
length of `CMAKE_OSX_ARCHITECTURES`.  It also makes the missing SDKs
more visible in the value.

Issue: #20534
2020-04-08 11:51:02 -04:00
Raul Tambre
d86fcc6359 CUDAToolkit: Deduce toolkit binary directory from compiler path only for NVCC
This assumption doesn't hold for Clang.
When crosscompiling this causes X86 libraries to be used and thus linker errors.
2020-04-07 09:33:26 -04:00
Raul Tambre
60e60b9201 GNU: Disable depfiles in try-compile mode only for GCC
Disabling them causes issues for Clang's CUDA frontend.
Since this is a GCC bug, simply check for GCC.
2020-04-07 09:33:25 -04:00
Raul Tambre
5f02add366 CUDA: Refactor PTX compilation flag into compiler modules 2020-04-07 09:33:25 -04:00
Raul Tambre
25439c7d62 Clang: Refactor CXX standard flags into __compiler_clang_cxx_standards()
These standard flags are the same for CXX, OBJCXX and CUDA.
Refactor them into a single macro to reduce duplication and so we can easily reuse them.

Updated bootstrap script to search in the general Clang module instead of the language-specific.
2020-04-07 09:33:09 -04:00
Brad King
c0438d272d Merge topic 'llvm-rc-include-path'
35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4570
2020-04-07 08:00:45 -04:00
Brad King
3d61ff7b10 Merge topic 'llvm-rc-include-path' into release-3.17
35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4570
2020-04-07 08:00:44 -04:00
Brad King
a4c873fc5d Merge topic 'UseJava-clean-stale'
4559eb490a UseJava: clean class files from previous builds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Leonid Pospelov <pospelovlm@yandex.ru>
Merge-request: !4381
2020-04-07 07:58:30 -04:00
Thomas Bernard
35a29ec827 llvm-rc: Restore include path for data after explicit preprocessing
Since commit 1c2d031cbd (Add -E cmake_llvm_rc to preprocess files for
llvm-rc, 2020-01-14, v3.17.0-rc1~24^2) with llvm-rc we explicitly
preprocess RC source files and then compile separately without -I flags.
This broke cases where the RC source references data files adjacent to
itself or in the include path.

This change adds the expansion of the include paths when calling the
llvm-rc in order for the resource files to be picked up correctly by
llvm-rc.  Since the RC compiled file is first preprocessed, the file
being compiled by llvm-rc resides in the build directory. In order for
llvm-rc to find the resource data specified relative to the .rc file
being compiled, the source file path is preppended in the include list
so that the original source path takes priority over all the other
includes paths specified.

A space was added in the CMAKE_INCLUDE_FLAG_RC to make the include
directive work properly for llvm-rc. Checks on the rc.exe showed that
the syntax change doesn't affect it's proper operation.

Fixes: #20529
2020-04-06 21:19:12 +02:00
Alexey Karndshev
4559eb490a UseJava: clean class files from previous builds
If java_class_filelist exists, remove previous class files before building the
new ones. If java_sources content has changed, clean and rebuild the class
files of the target.

Fixes: #20377
2020-04-06 16:58:10 +02:00
Brad King
c18c781cb5 Merge topic 'externalproject-patch-update-order'
7249ba9677 ExternalProject: Enforce that patch depends on update

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !4565
2020-04-06 08:30:04 -04:00
Craig Scott
7249ba9677 ExternalProject: Enforce that patch depends on update
Fixes: #17229
2020-04-03 22:48:44 +11:00
Craig Scott
0331092ce6 FetchContent: Add support for DOWNLOAD_NO_EXTRACT
Fixes: #20526
2020-04-03 22:05:55 +11:00
Brad King
11998c63fd Merge topic 'ExternalProject-no-extract-bool' into release-3.17
2c4bb705e8 ExternalProject: allow `DOWNLOAD_NO_EXTRACT OFF`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4562
2020-04-03 06:58:22 -04:00
Brad King
e141c9dc15 Merge topic 'ExternalProject-no-extract-bool'
2c4bb705e8 ExternalProject: allow `DOWNLOAD_NO_EXTRACT OFF`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4562
2020-04-03 06:58:22 -04:00
Brad King
d26f15dfce Merge topic 'FindPython-fix-VIRTUALENV-eq-FIRST' into release-3.17
81beb28752 FindPython: fix handling when FIND_VIRTUALENV == FIRST

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4557
2020-04-02 11:12:54 -04:00
Brad King
35d9ca268b Merge topic 'FindPython-fix-VIRTUALENV-eq-FIRST'
81beb28752 FindPython: fix handling when FIND_VIRTUALENV == FIRST

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4557
2020-04-02 11:12:54 -04:00
Ben Boeckel
2c4bb705e8 ExternalProject: allow DOWNLOAD_NO_EXTRACT OFF
Fixes: #20531
2020-04-02 08:55:04 -04:00
Brad King
f9be12707f Merge topic 'relax_compiler_prefix_detection'
c5dd2ca538 DetermineCompiler: Relax _CMAKE_TOOLCHAIN_PREFIX detection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4547
2020-04-01 10:53:46 -04:00
Brad King
85f87c9d40 Merge topic 'xl-cxx14'
46d9006efa XL: Add comment clarifying why we pretend it has full C++11/14 support
4aaa9ea96c XL: C++14 language level flags are only available on Linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4551
2020-04-01 10:42:19 -04:00
Brad King
9b32801859 Merge topic 'xl-cxx14' into release-3.17
46d9006efa XL: Add comment clarifying why we pretend it has full C++11/14 support
4aaa9ea96c XL: C++14 language level flags are only available on Linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4551
2020-04-01 10:42:18 -04:00
Brad King
3f1cd55180 Merge branch 'FindPython-fix-VIRTUALENV-eq-FIRST' into release-3.16
Merge-request: !4557
2020-04-01 10:38:31 -04:00
Marc Chevrier
81beb28752 FindPython: fix handling when FIND_VIRTUALENV == FIRST
Fixes: #20525
2020-04-01 10:36:46 -04:00
Brad King
46d9006efa XL: Add comment clarifying why we pretend it has full C++11/14 support
Since commit b0f46c48f6 (CompileFeatures: Now able to presume full
language level support, 2019-03-06, v3.15.0-rc1~265^2~1) we pretend that
the XL compiler has full C++11 and C++14 support so that projects
specifying granular features will at least get the corresponding
compiler mode.  This is a work around for our lack of a full feature
check table for this compiler that works in common cases.  Add a comment
explaining this.

Issue: #20521
2020-03-31 10:35:56 -04:00
Brad King
4aaa9ea96c XL: C++14 language level flags are only available on Linux
Since commit 458ea9d76c (XL: Add C++14 language level flags, 2019-04-15,
v3.15.0-rc1~226^2) we use `-qlanglvl=extended1y` for C++14 with XL 16.1.
However, that flag is only supported on a Linux host.

Issue: #20521
2020-03-31 10:35:56 -04:00
Brad King
0f66cb6b22 Merge topic 'FindBoost-lib-prefix-override'
ff71612d02 FindBoost: Allow Boost_LIB_PREFIX to be set externally

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4531
2020-03-31 09:23:13 -04:00
Robert Maynard
c5dd2ca538 DetermineCompiler: Relax _CMAKE_TOOLCHAIN_PREFIX detection
Now detect _CMAKE_TOOLCHAIN_PREFIX whenever a compilers
name matches the heuristics, instead of only doing it
when cross compiling
2020-03-30 17:08:01 -04:00
Brad King
615950dfb6 Merge topic 'cuda_support_bin_util_overrides'
79b6e928c3 CUDA: Support compiler specific FindBinUtils overrides

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !4539
2020-03-30 13:29:36 -04:00
Brad King
cfa3a2342f Merge topic 'gtest_discover_tests_cross_compile_support'
3b4838b57f GoogleTest: Add tests for MultiConfig discovery in PRE_TEST mode
1ba4cb565e GoogleTest: Parameterize tests to check PRE_TEST/POST_BUILD discovery mode
75e82a13db GoogleTest: Add new DISCOVERY_MODE option to gtest_discover_tests
889a7146ff GoogleTestAddTests: Refactor into callable method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4078
2020-03-30 13:26:49 -04:00
Brad King
e20146b429 Merge topic 'FindBoost-lib-prefix-clarify'
040f503d83 FindBoost: Clarify logic selecting Boost_LIB_PREFIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4537
2020-03-30 13:24:38 -04:00
Brad King
42cefc6bc1 Merge topic 'llvm_rc_pp' into release-3.17
4bef0e6450 llvm-rc: Enable preprocessing if CMAKE_RC_COMPILER_INIT is an absolute path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4535
2020-03-30 13:22:02 -04:00
Brad King
0188df97e8 Merge topic 'llvm_rc_pp'
4bef0e6450 llvm-rc: Enable preprocessing if CMAKE_RC_COMPILER_INIT is an absolute path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4535
2020-03-30 13:22:02 -04:00
Marc Chevrier
dd0664415a FindPython: use 'sysconfig' as alternate to 'distutils.sysconfig'
To support any python installation, if package 'distutils.sysconfig'
is not available, try to use package 'sysconfig'.

Fixes: #20502
2020-03-28 10:51:47 +01:00
Robert Maynard
79b6e928c3 CUDA: Support compiler specific FindBinUtils overrides 2020-03-27 12:58:01 -04:00
Bartlomiej Cieszkowski
ff71612d02 FindBoost: Allow Boost_LIB_PREFIX to be set externally
On platforms where our default Boost static library prefix is incorrect,
make it possible for users to set it explicitly to work around the problem
until FindBoost can be updated.

Fixes: #20372
2020-03-27 09:48:22 -04:00
Brad King
040f503d83 FindBoost: Clarify logic selecting Boost_LIB_PREFIX
Also add a comment explaining its purpose.
2020-03-27 09:32:47 -04:00
Lucas Wang
4bef0e6450 llvm-rc: Enable preprocessing if CMAKE_RC_COMPILER_INIT is an absolute path
`CMAKE_RC_COMPILER_INIT` and `CMAKE_RC_COMPILER` can be set by user,
for example `llvm-rc-10` and `D:\LLVM\bin\llvm-rc.exe`.
2020-03-27 08:54:58 -04:00
Brad King
f670435715 Merge topic 'pch-warn-invalid'
2ce08e5489 PCH: add an option to disable `-Winvalid-pch`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4499
2020-03-27 08:03:30 -04:00
Brad King
efb2a9f093 Merge topic 'vs-clangcl' into release-3.17
f3d7a15010 VS: Fix ClangCL toolset compiler path detection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4523
2020-03-27 07:45:15 -04:00
Brad King
112cb248ae Merge topic 'vs-clangcl'
f3d7a15010 VS: Fix ClangCL toolset compiler path detection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4523
2020-03-27 07:45:15 -04:00
Brad King
311848f790 Merge topic 'FindPython-variable-spelling-error' into release-3.17
63580668a8 FindPython: fix variable spelling error

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4529
2020-03-27 07:44:12 -04:00
Brad King
83f5ba06df Merge topic 'FindPython-variable-spelling-error'
63580668a8 FindPython: fix variable spelling error

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4529
2020-03-27 07:44:12 -04:00
Brad King
9df587168a Merge topic 'CheckIPOSupported-cleanup-cache'
4b8297721f CheckIPOSupported: Avoid polluting cache with common name 'result'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !4528
2020-03-27 07:43:03 -04:00
Brad King
f6c3820549 Merge topic 'CheckIPOSupported-cleanup-cache' into release-3.17
4b8297721f CheckIPOSupported: Avoid polluting cache with common name 'result'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !4528
2020-03-27 07:43:02 -04:00
Brad King
184dd23d2e Merge topic 'nmc-cl-showincludes'
6c7e6b1e49 Ninja Multi-Config: Fix MSVC showincludes prefix detection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !4526
2020-03-27 07:41:58 -04:00
Brad King
1915a09884 Merge topic 'nmc-cl-showincludes' into release-3.17
6c7e6b1e49 Ninja Multi-Config: Fix MSVC showincludes prefix detection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !4526
2020-03-27 07:41:57 -04:00
Brad King
032df7ae7b Merge topic 'llvm-rc-depfile' into release-3.17
2c724c3aea llvm-rc: Write depfile to location specified by the generator
4cc876540e llvm-rc: Select preprocessor from active languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4524
2020-03-27 07:38:22 -04:00
Brad King
ab96bbff2c Merge topic 'llvm-rc-depfile'
2c724c3aea llvm-rc: Write depfile to location specified by the generator
4cc876540e llvm-rc: Select preprocessor from active languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4524
2020-03-27 07:38:22 -04:00
Marc Chevrier
63580668a8 FindPython: fix variable spelling error 2020-03-26 18:08:25 +01:00
Brad King
4b8297721f CheckIPOSupported: Avoid polluting cache with common name 'result'
Fixes: #20508
2020-03-26 12:57:07 -04:00
Cristian Adam
2ce08e5489 PCH: add an option to disable -Winvalid-pch
Fixes: #20295
2020-03-26 14:24:46 +01:00
Brad King
6257d43ffd Merge topic 'compile-commands-collapse-whitespace'
e565053bce Ninja: Remove unnecessary newlines in compile commands
5d4bab500e Avoid consecutive whitespace in rules
d8622fbd0f Modules: Collapse consecutive whitespace in strings

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4512
2020-03-26 09:13:45 -04:00
Brad King
545875bebe Merge topic 'mingw-windres-cross-compile'
af4adf6aa9 MinGW: Fix default windres selection when cross-compiling
0251ddadab MinGW: Drop unnecessary windres selection code with Unix Makefiles

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4520
2020-03-26 09:06:13 -04:00
Brad King
6c7e6b1e49 Ninja Multi-Config: Fix MSVC showincludes prefix detection
Activate the detection logic for this generator too.

Fixes: #20506
2020-03-26 08:47:36 -04:00
Brad King
f3d7a15010 VS: Fix ClangCL toolset compiler path detection
Prior to commit 3c125c6de0 (VS: Support Visual Studio Clang Toolkit
identification, 2019-12-03, v3.17.0-rc1~341^2) using `-T ClangCL`
would work but `CMAKE_{C,CXX}_COMPILER` would be detected as `cl.exe`
even though `clang-cl.exe` is the actual compiler.  That commit
attempted to fix the detection by using `$(ClangClExecutable)`
as we do for LLVM-distributed toolsets, but that is not actually
defined.  Instead, look for `$(CLToolExe)` in the `PATH`.

Fixes: #20504
2020-03-26 08:18:25 -04:00
Thomas Bernard
2c724c3aea llvm-rc: Write depfile to location specified by the generator
Move the depfile flags to `CMAKE_DEPFILE_FLAGS_RC` so that they
are only usedwith generators that use depfiles.  Also switch to
using the `<DEPFILE>` placeholder for the location of the depfile
so that it goes where the generator expects.

Fixes: #20493
2020-03-26 07:26:21 -04:00
Thomas Bernard
4cc876540e llvm-rc: Select preprocessor from active languages
The llvm-rc preprocessor is selected according to the
CMAKE_C_COMPILER_ID / CMAKE_CXX_COMPILER_ID which are only defined when
the C or CXX language is active.
2020-03-26 07:25:33 -04:00
Brad King
79415fa6d3 Merge topic 'FindRuby-rvm'
905d5667e8 FindRuby: Add support for RVM installations
e6699b9b59 FindRuby: Validate Ruby_EXECUTABLE before accepting it

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4386
2020-03-25 08:16:38 -04:00
Brad King
f2b4576373 Merge topic 'FindPython-polish'
bf1ecfef7f FindPython: misc. fixes

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4519
2020-03-25 08:13:07 -04:00
Brad King
af4adf6aa9 MinGW: Fix default windres selection when cross-compiling
When cross-compiling to MinGW, select the `windres` tool named with the
toolchain's prefix.

Fixes: #20500
2020-03-25 07:21:01 -04:00
Brad King
0251ddadab MinGW: Drop unnecessary windres selection code with Unix Makefiles
Since commit 957c2aac7f (RC: Simplify selection of resource compiler
based on C/C++ toolchain, 2015-05-07, v3.3.0-rc1~93^2~5) we select
windres as the RC compiler on MinGW via `CMAKE_RC_COMPILER_INIT`.  Drop
the special case from commit be9afbf453 (Find mingw's windres also when
Unix Makefiles are used, 2012-08-27, v2.8.10~152^2).
2020-03-25 07:21:01 -04:00
Marc Chevrier
bf1ecfef7f FindPython: misc. fixes
Help: Fix errors regardings HINTS.
Code: Optimize Python signature cache variable to avoid unecessary searchs.
2020-03-24 18:26:16 +01:00
Daan De Meyer
d8622fbd0f Modules: Collapse consecutive whitespace in strings 2020-03-23 21:34:17 +01:00
Julien Marrec
905d5667e8 FindRuby: Add support for RVM installations 2020-03-23 13:22:23 +01:00
Julien Marrec
e6699b9b59 FindRuby: Validate Ruby_EXECUTABLE before accepting it 2020-03-23 13:21:40 +01:00
Ryan Thornton
75e82a13db GoogleTest: Add new DISCOVERY_MODE option to gtest_discover_tests
Introducing a new DISCOVERY_MODE mode option, which provides greater control
over when gtest_discover_tests perforsm test discovery.

It has two supported modes:
* POST_BUILD
* PRE_TEST

POST_BUILD is the default behavior, which adds a POST_BUILD command
to perform test discovery after the test has been built.

PRE_TEST is a new mode, which delays test discovery until test execution.

DISCOVERY_MODE can be controlled in two ways:
1. Setting the DISCOVERY_MODE when calling gtest_discover_tests
2. Setting the global CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE
   prior to calling gtest_discover_tests

By delaying test discovery until ctest runtime,
we can provide better cross compile support,
because we're more likely to be in an environment that can run the test executable.

This was achieved by moving the command for test discovery
into the generated ctest include file.

In PRE_TEST mode, the generated include file now has the form:

if(EXISTS "path/to/test.exe")
  if("path/to/test.exe" IS_NEWER_THAN "path/to/ctest_file")
    // command to discover tests
    // and generate ctest_file
  endif()
  include("path/to/ctest_file")
endif()
elseif()
  // test not built
endif()

Which generates the appropriate CTest files at runtime
and regenerates the CTest files when the executable is updated.

In the old approach, test discovery was always added as POST_BUILD step
and the executable was ran in order to scan for tests.

If the test executable failed to run for any reason,
this resulted in a link failure.

This failure could more commonly occur when cross compiling,
because your build environment might not have
the appropriate runtime environment dlls required to run the test executable.

I also ran into the issue when compiling a Qt application using Qt Creator.
Qt Creator manages its build and runtime environments separately
and only adds the Qt dlls to the environment during runtime -- not during build.

So when gtest_discover_tests ran my test executable,
it promptly crashed because the environment wasn't correct,
which resulted in a build failure.

Setting the DISCOVERY_MODE to PRE_TEST fixed my build failure
by delaying test discovery until runtime,
because this allowed the test exe to run in the proper environment.

A few non-trivial implementation details worth noting:

1. bracket_arguments

In the PRE_TEST side, parameters whose contents might contain special characters,
need to be handled with great care.

To aid in escaping these list arguments, backslashes, and other special characters,
and ensuring that they are preserved in the generated file,
bracket arguments (i.e. [== <...> ==]) are used.

For example:

    gtest_discover_tests(
      ...
      EXTRA_ARGS how now "\"brown\" cow"
    )

Generates a file with the following call:

    gtest_discover_tests_impl(
      ...
      TEST_EXTRA_ARGS [==[how;now;"brown" cow]==]
    )

This way the arguments are forwarded correctly.

2. multi-config generators

Multi-Config generators (e.g. MSBuild) now work more correctly in
PRE_TEST than POST_BUILD.

PRE_TEST is more correct because it will generate a unique CTest file for each configuration.

It generates a per config file responsible for test discovery:
    foo[1]_include-Debug.cmake
    foo[1]_include-MinSizeRel.cmake
    foo[1]_include-Release.cmake
    foo[1]_include-RelWithDebInfo.cmake

A per config file for containing the google tests:
    foo[1]_tests-Debug.cmake

And an outer ctest file:
    foo[1]_include-Debug.cmake

That is generically written to include the correct configuration file
by looking at the value of ${CTEST_CONFIGURATION_TYPE} when CTest runs.

POST_BUILD, in contrast, preserves the existing functionality.

Tests are disocvered based on the last configuration that was chosen
and only a single file is produced:
    foo[1]_include.cmake
    foo[1]_tests.cmake

But it runs with whatever executable requested by ctest --config,
which means it's possible to run the wrong tests
if some tests were enabled in one configuration but not another.
2020-03-20 10:14:39 -05:00
Brad King
dfca1887b0 Merge topic 'FindMatlab-r2020' into release-3.17
75331a4578 FindMatlab: Add R2020a=9.8

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4507
2020-03-20 06:22:48 -04:00
Brad King
a2bbc34ace Merge topic 'FindMatlab-r2020'
75331a4578 FindMatlab: Add R2020a=9.8

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4507
2020-03-20 06:22:48 -04:00
Brad King
3ab89b5475 Merge topic 'GetPrerequisites-vcruntime-is-system' into release-3.17
417b765f5a GetPrerequisites: Classify vcruntime libraries as system

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4506
2020-03-20 06:17:49 -04:00