Commit Graph

9680 Commits

Author SHA1 Message Date
Brad King
fb9da8e6f4 Ninja: Pass preprocessor definitions when compiling with Intel Fortran
The Intel Fortran compiler supports an extension that allows conditional
compilation based on preprocessor definitions specified on the command
line even when not preprocessing.

Fixes: #19664
2019-09-03 14:20:26 -04:00
Brad King
72b7629956 Merge topic 'FindPython-specify-artifacts-directly'
06d9e67fbd FindPython: Add capability to specify directly artifacts
cea2010b5c FindPython: Enhance python cache variables management.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3690
2019-09-03 09:49:00 -04:00
Brad King
4684e64c84 Merge topic 'clang-ipo-support'
dca9c33abc Tests: Remove old IPO test
c856d4556b bindexplib: supporting llvm bitcode formats using llvm-nm
079b8e2916 Clang: prefer lld-link over link.exe
6e3655db2c Clang: add LTO support for GNU-command line clang on windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3527
2019-09-03 09:39:03 -04:00
Brad King
54b69bd642 Merge topic 'gtest-1.8.1'
aaf2435780 FindGTest: Add support for googletest 1.8.1 folder structure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3756
2019-09-03 09:36:59 -04:00
Brad King
cee20ad537 Merge topic 'vs-cuda-custom-dir'
25f29b9741 cuda: Adapted tests to work with modified cuda toolset
ee86770a3f cuda: Added docs for extended cuda toolset
0ad180d712 cuda: Extend cuda compiler detection to work with custom cuda path
55b0532128 cuda: Extend vs10 target generator to use custom cuda path
df0247a371 cuda: Extend toolset argument to accept path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3713
2019-09-03 09:34:46 -04:00
Brad King
d8e3237611 Merge topic 'FindPkgConfig-module-name'
fe68387695 FindPkgConfig: return the module found by pkg_search_module

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3749
2019-09-03 09:33:02 -04:00
Brad King
2e6effd2e0 Merge topic 'cpack-install-multiple-configurations'
da5ac4bb60 cpack: Add `CPACK_INSTALL_CMAKE_CONFIGURATIONS` variable
d4e6b2ae25 Refactor: Use `unique_ptr` instead of raw pointer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3533
2019-09-03 09:30:15 -04:00
Brad King
d615ce4386 Merge topic 'xcode11-swift'
5c028c27eb Xcode: Relax swift compiler detection regex for Xcode 11

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3758
2019-09-03 09:27:39 -04:00
Brad King
ea63df139e Merge topic 'FindBoost-1.71'
7828577065 FindBoost: Add support for Boost 1.71
cf29fa18c8 FindBoost: Unwrap compatibility INTERFACE targets for legacy variables
d7df3cd73f FindBoost: Remove incorrect 1.70 timer dependency
8ff43de1a5 FindBoost: Simplify conditional block for last known version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dennis Klein <d.klein@gsi.de>
Merge-request: !3763
2019-09-03 09:23:48 -04:00
Marc Chevrier
06d9e67fbd FindPython: Add capability to specify directly artifacts
Fixes: #19492
2019-09-02 17:20:53 +02:00
Marc Chevrier
cea2010b5c FindPython: Enhance python cache variables management.
Ensure multiple cmake runs without cache clean-up will preserve artifacts selected on first run.

This change address the issue #19492.
2019-09-02 13:19:01 +02:00
Brad King
7828577065 FindBoost: Add support for Boost 1.71
Run `Utilities/Scripts/BoostScanDeps.cmake` with the Boost 1.71.0
sources to compute dependencies.  They are the same as Boost 1.70.

Fixes: #19658
2019-08-30 14:51:20 -04:00
Brad King
cf29fa18c8 FindBoost: Unwrap compatibility INTERFACE targets for legacy variables
Since commit 0dd6772a89 (FindBoost: Add legacy variables and targets for
compatibility, 2019-06-14, v3.15.0-rc2~3^2~1) we extract information
from imported targets provided by upstream `BoostConfig.cmake` files.
However, upstream Boost 1.71 provides some imported targets only for
compatibility.  They are just INTERFACE libraries that wrap around the
real target named by `INTERFACE_LINK_LIBRARIES`.  Unwrap this layer so
we can extract the real imported location.

Fixes: #19656
2019-08-30 14:51:03 -04:00
Brad King
d7df3cd73f FindBoost: Remove incorrect 1.70 timer dependency
Running `Utilities/Scripts/BoostScanDeps.cmake` with the Boost 1.70.0
sources shows that the `timer` component no longer depends on `system`.
This is consistent with upstream Boost Timer commit `43eecbd071`.
2019-08-30 14:51:03 -04:00
Brad King
8ff43de1a5 FindBoost: Simplify conditional block for last known version
A version newer than we know about will be large enough to enter the
block for the last known version so we can put the warning there.
2019-08-30 14:51:03 -04:00
Kelby Faessler
aaf2435780 FindGTest: Add support for googletest 1.8.1 folder structure 2019-08-30 11:24:27 -04:00
Alex Turbov
da5ac4bb60 cpack: Add CPACK_INSTALL_CMAKE_CONFIGURATIONS variable
For the multi-configuration generators one can specify the list
of configurations to include in the package.

E.g. having a project, where debug libraries have a suffix to
distinct them from the release builds, one can build the package
containing both `Debug` and `Release` binaries.
2019-08-30 11:02:43 -04:00
Gregor Jasny
5c028c27eb Xcode: Relax swift compiler detection regex for Xcode 11
The Xcode 11 output:

```
  CompileSwift normal x86_64
  /Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift/CompilerId/main.swift
  (in target 'CompilerIdSwift' from project 'CompilerIdSwift')

      cd /Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift
      /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/gregorj/Git/cmake/_build_xcode/Tests/SwiftOnly/CMakeFiles/3.15.20190826-g89479bd/CompilerIdSwift/CompilerId/main.swift ...
```

The Xcode 10 output:

```
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
    cd /Users/gjasny/src/cmake/Tests/SwiftOnly
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name SwiftOnly -O -enable-batch-mode -enforce-exclusivity=checked -swift-version 5.0 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -target x86_64-apple-macosx10.14 -g -Xfrontend -serialize-debugging-options -swift-version 5 -Xlinker -rpath -Xlinker /usr/lib/swift -I /Users/gjasny/src/cmake/_build_xcode/Tests/SwiftOnly/Debug -F /Users/gjasny/src/cmake/_build_xcode/Tests/SwiftOnly/Debug -c -j24 /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift ...

CompileSwift normal x86_64 /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift
    cd /Users/gjasny/src/cmake/Tests/SwiftOnly
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/gjasny/src/cmake/Tests/SwiftOnly/main.swift ...

```

The Xcode 11 output lacks the CompileSwiftSources action but the
CompileSwift action is present for both and also look suitable.
2019-08-30 10:53:58 +02:00
Benjamin Wozniak
0ad180d712 cuda: Extend cuda compiler detection to work with custom cuda path 2019-08-30 08:14:00 +02:00
Christophe Giboudeaux
fe68387695 FindPkgConfig: return the module found by pkg_search_module
When running `pkg_search_module`, it may be useful to get the matching
module name in order to run `pkg_get_variable`.

`pkg_search_module` now defines `<prefix>_MODULE_NAME` which contains
the first matching module name.

Fixes: #19648
2019-08-29 21:50:49 +02:00
Brad King
ee945a590b Merge topic 'CMakeParseImplicitLinkInfo-comma-separated'
b5f20da94d CMakeParseImplicitLinkInfo supports comma separated link lines
2200bc068b Introduce a ParseImplicitLinkInfo test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3730
2019-08-29 09:40:12 -04:00
Brad King
fa36e2151d Merge topic 'precompile-headers'
8da78d4efe Precompile headers: Update documentation
5772930164 Precompile headers: Add unit tests
519606704e Precompile headers: Add support for Visual Studio generators
28be170fbc Precompile headers: Add support for Xcode generator
b8626261e9 Precompile headers: Add methods to generate PCH sources
375d01c680 PCH: add example/test
9b6797e71d PCH: add target_precompile_headers command
0467a2f91b PCH: add PRECOMPILE_HEADERS to special properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Acked-by: Ivan171 <heavenandhell171@gmail.com>
Acked-by: Stanislav Ershov <digital.stream.of.mind@gmail.com>
Acked-by: Steve Mokris <smokris@softpixel.com>
Acked-by: Evgeniy Dushistov <dushistov@mail.ru>
Acked-by: Danila Malyutin <flashmozzg@gmail.com>
Acked-by: Viktor Kirilov <vik.kirilov@gmail.com>
Acked-by: Lucas Zhao <zhaopf6@163.com>
Merge-request: !3553
2019-08-29 09:38:21 -04:00
Cristian Adam
b8626261e9 Precompile headers: Add methods to generate PCH sources
Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
2019-08-28 11:47:40 -04:00
Robert Maynard
b5f20da94d CMakeParseImplicitLinkInfo supports comma separated link lines
It is currently presumed that the linker will generate
a space separated line. This is not the case for some
compilers such as IBM XL where it can output space or
comma separated. This is particularly apparent when IBM XL
is used as the host compiler for CUDA as it generates a comma
separated link line.
2019-08-28 10:39:53 -04:00
Zsolt Parragi
079b8e2916 Clang: prefer lld-link over link.exe
Objects compiled with -flto can only be linked with the llvm linker.
Before this change, clang-cl only supperted IPO with manual linker
selection.
2019-08-27 20:19:29 +02:00
Zsolt Parragi
6e3655db2c Clang: add LTO support for GNU-command line clang on windows 2019-08-27 20:19:29 +02:00
Brad King
bd4d52f7de Merge topic 'GNUInstallDirs-arch-linux'
18365587c8 GNUInstallDirs: Keep 'lib' as default LIBDIR on Arch Linux based systems

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3735
2019-08-27 10:58:28 -04:00
Antonio Rojas
18365587c8 GNUInstallDirs: Keep 'lib' as default LIBDIR on Arch Linux based systems
Fixes: #15373
2019-08-26 11:14:13 -04:00
Brad King
7290cea75b Merge topic 'FindLibLZMA-windows-debug'
232f5bd644 FindLibLZMA: Find debug/release variants on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3714
2019-08-26 10:45:28 -04:00
Brad King
1811f2b371 Merge topic 'cpack-stgz-license-prompt'
4c8741eb86 CPack/STGZ: Require explicit acceptance or refusal of license

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3717
2019-08-26 10:37:18 -04:00
Braden McDaniel
232f5bd644 FindLibLZMA: Find debug/release variants on Windows 2019-08-23 11:19:21 -04:00
sidju
4c8741eb86 CPack/STGZ: Require explicit acceptance or refusal of license
To make using the generated STGZ easier, require a specific answer to
accepting the license terms.  Since more moves down one line when '\n'
is entered a user may hold enter to paginate through the document. This
change prevents the user from accidentally refusing the license terms by
holding enter for too long and having to start over.
2019-08-23 11:04:26 -04:00
Brad King
19612dffd2 Merge topic 'solaris-ldd'
3bb7453436 GetPrerequisites: match ldd output on Solaris

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3695
2019-08-23 10:11:47 -04:00
Brad King
76891a4a7a Merge topic 'CrayPrgEnv-update-link-type-detection'
971c778213 CrayPrgEnv: Change default linking mode based on PE version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3716
2019-08-23 10:05:52 -04:00
Chuck Atkins
971c778213 CrayPrgEnv: Change default linking mode based on PE version
Beginning with the 19.06 release of the Cray Programming Environment, the
default linking mode on XC Cray systems is dynamic instead of static.
This updates the CrayPrgEnv compiler wrappers to detect the PE version
being used and behave accordingly.
2019-08-22 12:26:06 -04:00
Brad King
6e1ff50efb Merge topic 'FindBoost-clarify-header-only'
0148f1a867 FindBoost: Add note about header-only libs in warning msg

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3712
2019-08-22 10:16:10 -04:00
Brad King
bce0d4c27d Merge topic 'FindBZip2-windows-lib-names'
5edceff308 FindBZip2: Add Windows library names emitted from bzip2 1.0.6 makefile

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3711
2019-08-21 12:01:32 -04:00
Braden McDaniel
5edceff308 FindBZip2: Add Windows library names emitted from bzip2 1.0.6 makefile
As of release 1.0.6, the bzip2 distribution includs a makefile for nmake
on Windows that emits library names of the form `libbz2.lib`.
2019-08-21 12:00:11 -04:00
Brad King
2ad09c5ddd Merge topic 'ProcessorCount-solaris'
1c87bc60ee ProcessorCount: Fix virtual processor count on Solaris

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3694
2019-08-21 10:51:48 -04:00
Brad King
e15a9187b0 Merge topic 'FindCUDA-nvcc-include-dir-backslash'
76b76a7f9b FindCUDA: Fix support for backslashes in CUDA_NVCC_INCLUDE_DIRS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3679
2019-08-21 10:49:50 -04:00
Brad King
01c7c4236a Merge topic 'FindMPI-restore-flag-vars'
31b8b28fed FindMPI: Restore MPI_<LANG>_COMPILE_FLAGS and MPI_<LANG>_COMPILE_OPTIONS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3710
2019-08-21 10:28:33 -04:00
Robert Maynard
31b8b28fed FindMPI: Restore MPI_<LANG>_COMPILE_FLAGS and MPI_<LANG>_COMPILE_OPTIONS
In commit e374b9f1eb (FindMPI: Restore MPI_<LANG>_COMPILE_FLAGS as a
command-line string, 2018-09-10, v3.12.3~6^2) we tried to restore the
compile flags but accidentally inverted the arguments to `list(JOIN)`
causing both `MPI_<LANG>_COMPILE_FLAGS` and `MPI_<LANG>_COMPILE_OPTIONS`
to be empty.

Issue: #18349
2019-08-21 10:08:12 -04:00
Jon Chronopoulos
3bb7453436 GetPrerequisites: match ldd output on Solaris
Solaris output is the following:

```
$ ldd /lib/libxml2.so
libz.so.1 =>     /lib/libz.so.1
libm.so.2 =>     /lib/libm.so.2
libc.so.1 =>     /lib/libc.so.1
```

While on Linux

```
$ ldd /usr/lib/libxml2.so
linux-vdso.so.1 (0x00007ffe02bbe000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f03ab852000)
libicuuc.so.64 => /usr/lib/libicuuc.so.64 (0x00007f03ab67a000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007f03ab463000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f03ab23d000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f03ab0f7000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f03aaf34000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f03ab9fd000)
libicudata.so.64 => /usr/lib/libicudata.so.64 (0x00007f03a94ee000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f03a94cd000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f03a92e5000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f03a92cb000)
```
2019-08-21 17:25:28 +10:00
Dennis Klein
0148f1a867 FindBoost: Add note about header-only libs in warning msg 2019-08-21 01:55:47 +02:00
Jon Chronopoulos
1c87bc60ee ProcessorCount: Fix virtual processor count on Solaris
The previous code did not count the number of virtual processors across
physical processors on SunOS.

Can handle the following situations:

```
$ uname -a
SunOS solaris 5.11 11.4.0.15.0 i86pc i386 i86pc
$ psrinfo -p -v
The physical processor has 1 virtual processor (0)
  x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
        Intel Core Processor (Broadwell)
The physical processor has 1 virtual processor (1)
  x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
        Intel Core Processor (Broadwell)
The physical processor has 1 virtual processor (2)
  x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
        Intel Core Processor (Broadwell)
The physical processor has 1 virtual processor (3)
  x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
        Intel Core Processor (Broadwell)
```

```
$ uname -a
SunOS sol11x86 5.11 11.0 i86pc i386 i86pc
$ psrinfo -p -v
The physical processor has 2 virtual processors (0 1)
  x86 (GenuineIntel 50650 family 6 model 85 step 0 clock 2000 MHz)
        Intel(r) Xeon(r) Gold 6138 CPU @ 2.00GHz
```

```
$ uname -a
SunOS sol11 5.11 11.0 sun4v sparc sun4v
$ psrinfo -p -v
The physical processor has 2 cores and 16 virtual processors (0-15)
  The core has 8 virtual processors (0-7)
  The core has 8 virtual processors (8-15)
    SPARC-T4 (chipid 0, clock 2848 MHz)
```
2019-08-20 10:26:06 -04:00
Hong Xu
76b76a7f9b FindCUDA: Fix support for backslashes in CUDA_NVCC_INCLUDE_DIRS
Backslashes in `CUDA_NVCC_INCLUDE_DIRS` cause syntax errors because it
is written to a generated `.cmake` script as a string literal.  Use a
bracket argument to hold the expanded value as we already do for
`CUDA_NVCC_COMPILE_DEFINITIONS`.  Then explicitly convert backslashes to
forward slashes.
2019-08-20 09:47:29 -04:00
Brad King
8c1d3e3b79 Merge topic 'find_openacc_targets'
f4fc0667ae FindOpenACC: Provide import targets and OpenACC_<lang>_OPTIONS variable
9460501ad7 FindOpenACC: Provide a Fortran snippet that compiles with gfortran

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3670
2019-08-20 09:17:18 -04:00
Robert Maynard
f4fc0667ae FindOpenACC: Provide import targets and OpenACC_<lang>_OPTIONS variable
Previously the FindOpenACC module had issues where the contents of
OpenACC_<lang>_FLAGS could not be used with target_compile_options
when it contained multiple compiler flags.
2019-08-19 15:20:38 -04:00
Brad King
e3746821df Merge topic 'swift-mode-flags'
4d83e47c05 Swift: define `CMAKE_Swift_FLAGS` correctly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !3684
2019-08-19 15:08:22 -04:00
Brad King
e977867a12 Merge topic 'solaris_clang'
47937219ee Solaris: Add support for Clang compiler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3672
2019-08-19 14:56:14 -04:00