Commit Graph

9159 Commits

Author SHA1 Message Date
Brad King
30159fe751 Merge branch 'implicit-includes' into release-3.14
Merge-request: !3157
2019-03-29 08:49:34 -04:00
Brad King
dad86f1873 ParseImplicitIncludeInfo: Canonicalize implicit include dirs
The implicit include directory extraction added by commit 5990ecb741
(Compute implicit include directories from compiler output, 2018-12-07,
v3.14.0-rc1~108^2) leaves paths like `/usr/lib/../include` unchanged.
Fix the logic to canonicalize such paths (e.g. to `/usr/include`)
as we do for implicit link directories already.  This is important
to ensure the set of implicit directories is represented in the same
form as the include directories that will be compared to them.

Issue: #19095
2019-03-29 08:48:56 -04:00
Brad King
bd00090e2a Merge branch 'ifw_group_option_parsing' into release-3.14
Merge-request: !3160
2019-03-29 08:48:28 -04:00
Clément Rezvoy
6f6e0966a7 CPackIFW: Add missing cpack_ifw_configure_component_group option processing
Both commit 88ecfd8ba1 (CPackIFW: Add some options, 2016-11-11,
v3.8.0-rc1~248^2) and commit e5089c562c (CPackIFW: Add some options,
2017-01-24, v3.8.0-rc1~53^2) added some options to this macro's
documentation and implementation, but the actual processing of the
parsed options was never added.  Add it now.

Reviewed-by: Konstantin Podsvirov <konstantin@podsvirov.pro>
2019-03-28 14:59:08 -04:00
Brad King
97c163f5f7 Merge branch 'FindFontconfig-var-case' into release-3.14
Merge-request: !3153
2019-03-27 14:20:53 -04:00
Brad King
a3a1e69f8a FindFontconfig: Convert module variables to camel case
Our documented standard for find module variable names is to match the
case of the find module package name.  This was overlooked when the
module was added by commit 84e7920b3a (FindFontconfig: Add module to
find Fontconfig, 2018-09-27, v3.14.0-rc1~523^2).

The module was released with the upper case names in CMake 3.14.0, so
fix it to have camel case names in 3.14.1.  This is incompatible but
anyone using a given release series should be using the latest patch on
it and we've made breaking fixups on newly released features like this
before.

Reported-by: Christophe Giboudeaux <christophe@krop.fr>
Fixes: #19094
2019-03-26 14:14:09 -04:00
Brad King
505bdd3d29 Merge branch 'cuda-bracket-output' into release-3.14
Merge-request: !3151
2019-03-26 10:58:08 -04:00
Brad King
b127e0c561 CUDA: Tolerate square brackets in PROMPT environment variable
The `PROMPT` environment variable affects nvcc's output.  Fix
our parsing of that output to tolerate square brackets.

Fixes: #19089
2019-03-26 10:43:51 -04:00
Brad King
c22a2b49af Merge branch 'toolchain-include_directories' into release-3.14
Merge-request: !3140
2019-03-25 11:50:06 -04:00
Brad King
588fa1bb9e Restore support for include_directories() in toolchain files
Any `include_directories()` calls in toolchain files are used during our
ABI detection step even though it does not include any system headers.
Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07, v3.14.0-rc1~108^2), that check is also used
to detect implicit include directories.  Any `include_directories()` in
a toolchain file are detected as implicit and later excluded from
explicit specification on compiler command lines, thus breaking the
purpose of the calls in the first place.

Fix the implicit include directory detection step to avoid using paths
from `include_directories()` calls in the toolchain file.

Fixes: #19079
2019-03-25 11:48:17 -04:00
Brad King
8cc16c9420 Merge branch 'armcc-compiler-id' into release-3.14
Merge-request: !3127
2019-03-20 11:22:02 -04:00
Brad King
8f8d056051 ARMCC: Fix identification of ARM compiler when it defines GNU macros
According to ARMCC 5.06 documentation:

    http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0472m/chr1359125007083.html

the compiler may define `__GNUC__` in addition to `__ARMCC_VERSION`.
Re-order our preprocessor checks to consider the ARM-specific macro
first so that the ARM compiler is not mistaken for a GNU compiler.

Fixes: #19065
2019-03-20 11:20:39 -04:00
Marc Chevrier
9a84cb1663 FindPython*: ensure correct architecture is selected.
Ensure interpreter and libraries architecture matches CMake build
configuration.
Update documentation about interpreter constraints.

Fixes: #19024
2019-03-14 18:53:57 +01:00
Brad King
509a9409c3 Merge branch 'ios-variable' into release-3.14
Merge-request: !3051
2019-03-05 09:42:58 -05:00
Ruslan Baratov
e427c7c1d8 iOS: Add IOS variable
Since commit 11da882a12 (Apple: Introduce separate system name for iOS,
tvOS, and watchOS, 2018-01-15, v3.14.0-rc1~14^2~1) we support setting
`CMAKE_SYSTEM_NAME` to `iOS`.  Existing iOS toolchain files already
set `IOS` as a short-hand variable, so do the same here.
2019-03-05 09:42:41 -05:00
Marc Chevrier
8e3358336d FindPython: Fix NumPy component include directory
Update the component added by commit 513e77550d (FindPython: Introduce
NumPy component, 2018-12-12, v3.14.0-rc1~95^2).  The `numpy/`
sub-directory should not be part of the include directory.  It should be
part of the `#include` line.
2019-03-04 08:28:21 -05:00
Brad King
8d9cf29074 Merge branch 'findjni-paths' into release-3.14
Merge-request: !3042
2019-03-01 09:05:57 -05:00
Christian Pfeiffer
77cede0977 FindJNI: Unify path search, fix support for Java 9
Java 9 restructured the standard location of the AWT libraries due to
the removal of the JRE/JDK separation. We should check all possible
combinations of subdirectories to the Java root directories to ensure
that the libraries will be found after an upgrade.

Furthermore, a root directory would contain both, include and library
paths, so the search should be unified to ease maintenance on the
module.
2019-03-01 08:53:26 -05:00
Brad King
9a54159f53 Merge branch 'ExternalProject-fix-log-in-custom-stamp' into release-3.14
Merge-request: !3045
2019-03-01 08:02:26 -05:00
Brad King
a6d3fee77c ExternalProject: Restore default log dir with custom stamp dir
In commit b6f6cac378 (ExternalProject: add LOG_DIR option that allows
overriding of log location, 2018-10-12, v3.14.0-rc1~515^2~1) the log
directory got its own option.  The intention was to fall back to the
stamp directory by default.  However, the implementation actually only
falls back to the same default as the stamp directory and does not
consider a custom stamp dir.

Update the default log dir computation to fall back to whatever is the
final selection for the stamp dir.

Fixes: #19000
2019-03-01 07:54:17 -05:00
Brad King
e0d7078f6f Merge branch 'FindThreads-revert-libc-check' into release-3.14
Merge-request: !3022
2019-02-27 09:04:11 -05:00
Brad King
e994e1f9cd Merge branch 'FindOctave-remove' into release-3.14
Merge-request: !3027
2019-02-27 07:57:03 -05:00
Brad King
5833739c4a Merge branch 'vs-llvm-extension' into release-3.14
Merge-request: !3024
2019-02-27 07:55:28 -05:00
Brad King
18320230ec FindThreads: Revert libc symbol check to pthread_create
Since commit e9a1ddc594 (FindThreads: Replace the pthread symbol
checking in libc., 2018-11-18, v3.14.0-rc1~292^2) we check libc for
`pthread_kill` instead of `pthread_create`.  However, on FreeBSD
`pthread_kill` is in libc but not `pthread_create`.  Discussion in the
original merge request for the above commit also considered
`pthread_key_create`, `pthread_self`, and `pthread_attr_init`.  Every
symbol seems to have some reason it is not an appropriate choice.

Revert to the pre-3.14 behavior of using `pthread_create` pending
further investigation.
2019-02-27 07:33:31 -05:00
Brad King
7a1f3fe041 FindOctave: Remove module pending further work
The `FindOctave` module added by commit 170bcb6fdc (FindOctave: Add
module to find GNU octave, 2018-11-17, v3.14.0-rc1~283^2) has a few
problems in its implementation that need to be worked out before the
module can be included in a CMake release.  These were missed during
review.  Remove the module for now.  It can be restored later with a
fresh review.

Issue: #18991
2019-02-26 14:12:34 -05:00
Brad King
8375c303e2 VS: Fix detection of clang-cl with -T llvm
When using a VS generator with `-T llvm`, MSBuild relies on the "LLVM
Compiler Toolchain" VS Extension.  This does not put `clang-cl` in the
`PATH` inside the build, and LLVM no longer provides a `cl` replacement
either.  Therefore we need another way to extract the path to the
`CMAKE_{C,CXX}_COMPILER`.  Fortunately the LLVM VS integration provides
a `$(ClangClExecutable)` macro we can reference to get the path.

Fixes: #18983
2019-02-26 09:58:51 -05:00
Brad King
e0267eb1d3 FindThreads: Fix libc check to use proper header for pthread_kill
In commit e9a1ddc594 (FindThreads: Replace the pthread symbol checking
in libc., 2018-11-18, v3.14.0-rc1~292^2) we switched to checking for
`pthread_kill` in libc but did not update the symbol check's header file
to match.  Add `signal.h` to get `pthread_kill`.  Keep `pthread.h`
anyway since the purpose of the check is to verify that the pthread API
works.

Fixes: #18984
2019-02-26 07:51:52 -05:00
Brad King
4d337be994 Merge branch 'qcc-asm-detection' into release-3.14
Merge-request: !3016
2019-02-25 09:33:25 -05:00
Brad King
b3b081ccec Merge branch 'check_lang_source_runs_output' into release-3.14
Merge-request: !3011
2019-02-25 07:53:49 -05:00
Maikel van den Hurk
be87ce43f0 Add ASM Compiler detection for QCC 2019-02-25 08:28:47 +01:00
Craig Scott
92d9ec9bfb CheckLangSourceRuns: Capture run output to log files
Fixes: #18973
2019-02-23 21:16:03 +11:00
Brad King
da84643988 Merge branch 'asm-no-slash-question' into release-3.14
Merge-request: !2984
2019-02-19 07:58:13 -05:00
Brad King
13f020198f Merge branch 'fix-legacy-implicit-includes' into release-3.14
Merge-request: !2981
2019-02-19 07:50:07 -05:00
Brad King
7814796e07 Merge branch 'FindBoost-layout-tagged' into release-3.14
Merge-request: !2961
2019-02-19 07:49:26 -05:00
Brad King
b186329d3d Use -? instead of /? to test compiler for MSVC-like command-line support
MS-style command-line tools accept either `/` or `-` for command-line
options.  Prefer `-` over `/` so that non-MS tools do not treat it as a
path.

Fixes: #18941
2019-02-19 07:29:27 -05:00
Brad King
890bae524c Do not explicitly report "standard" include directories as implicit
In commit 1293ed8507 (ParseImplicitIncludeInfo: keep implicit incl.
consistent when rerunning cmake, 2019-01-30, v3.14.0-rc1~26^2) we did
not account for `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES`.  This
variable lets platform modules or toolchain files specify directories
that are to be explicitly passed as standard include directories.  These
include directories are used by the test project from which we extract
implicit include directories so they appear in the parsed results
whether or not the compiler really considers them implicit.  Exclude
these entries from the computed implicit include directories since they
are not actually implied by the compiler when we invoke it with
"standard" include directories passed explicitly.

Instead teach the build system generators to treat the "standard"
directories as implicit for purposes of excluding them from appearing
earlier in the compiler command line due to `include_directories` and
`target_include_directories` calls.

Issue: #18936, #18944
2019-02-18 17:12:14 -05:00
Brad King
9502276f82 Prefix implicit include directories with sysroot on construction
Since commit 7cd65c97fa (Add CMAKE_SYSROOT variable to set --sysroot
when cross compiling., 2013-04-13, v3.0.0-rc1~342^2) we have prefixed
the value of `CMAKE_SYSROOT` to implicit include directories.  This was
done because we hard-coded `/usr/include` as an implicit include
directory without accounting for the sysroot.  Instead we should prefix
the hard-coded paths when they are constructed.  Update the
`Platform/UnixPaths` module to do this as `Platform/Darwin` already
does.

Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07, v3.14.0-rc1~108^2) the values of the
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variables are computed from
a real compiler invocation so they already account for the sysroot
prefix.  In commit 6fc3382944 (Update logic for sysroot in detected
implicit include directories, 2019-02-13, v3.14.0-rc2~6^2) we attempted
to apply the prefix conditionally, but that is incorrect because the
compiler's real implicit include directories are not all under the
sysroot.  Instead assume that all implicit include directories in
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` already have the sysroot
prefix if needed.  Code that constructs the value must be responsible
for that because it is the only place that knows.
2019-02-18 17:09:26 -05:00
Yves Frederix
bee6597ac5 FindBoost: Find boost libraries built with --layout=tagged
Pick up libraries of the form `boost_system-mt-x64`, which do not have
the version suffix.

Fixes: #18908
2019-02-18 10:53:42 -05:00
Craig Scott
f2072a6554 Help: Clarify ExternalProject_Add()'s LOG_MERGED_STDOUTERR behavior
The output is only merged for a step if it is logging to file. This
option is ignored for steps that are logging normally.

A minor grammatical error has also been fixed as part of this change.
2019-02-17 13:30:07 +11:00
Brad King
113a395ee7 Merge branch 'try_compile-expand-compile-defs' into release-3.14
Merge-request: !2965
2019-02-15 06:47:59 -05:00
Brad King
dac6cf1b99 Merge branch 'FindLibXml2' into release-3.14
Merge-request: !2970
2019-02-15 06:47:22 -05:00
Saleem Abdulrasool
fd86a4de04 FindLibXml2: Document LibXml2_FOUND as preferred case
Both `LIBXML2_FOUND` and `LibXml2_FOUND` are provided but the modern
convention is to use the case that matches the module name.
2019-02-15 06:41:32 -05:00
Brad King
cde2596a19 try_compile: Restore expansion of ;-list in COMPILE_DEFINITIONS
The quoting added by commit 8c5221fb1f (try_compile: Preserve special
characters in COMPILE_DEFINITIONS, 2019-01-21, v3.14.0-rc1~108^2~3)
broke the case that the `COMPILE_DEFINITIONS` value contains a `;`.
Without the quoting the `;` would be generated literally in an unquoted
argument in the test `CMakeLists.txt` file and would then be expanded.
With quoting the `;` is preserved, which is not the old behavior.

Fix this by expanding the `;`-list ahead of time.  Add test cases for
behavior with both `#` and `;`.

This was noticed with the PGI compiler where we set
`CMAKE_CXX*_STANDARD_COMPILE_OPTION` to values like `--c++17;-A`.  The
symptom had also been observed while preparing commit ef8f237686
(ParseImplicitIncludeInfo: add SunPro Fortran and PGI compiler, Cray
fix, 2019-01-29, v3.14.0-rc1~26^2~2) but was not recognized at the time
as a regression.  Revert the workaround added by that commit.

Fixes: #18919
2019-02-15 06:21:19 -05:00
Brad King
2f51f281a8 Merge branch 'fortran-submodule-names' into release-3.14
Merge-request: !2958
2019-02-14 10:24:43 -05:00
Brad King
d80ecba5c2 Fortran: Fix submodule file names across compilers
The naming convention for submodule files varies across compilers.  Add
a table to the compiler information modules and thread the information
through to the Fortran module dependency parser.  Fill out the table for
compiler ids known to support Fortran submodules.

Fixes: #18746
2019-02-14 10:23:02 -05:00
Brad King
30783addc1 Merge branch 'fix-legacy-implicit-includes' into release-3.14
Merge-request: !2957
2019-02-13 10:05:48 -05:00
Brad King
557b2d6e65 Fix regression in -I/usr/include exclusion logic
The change in commit 15ad830062 (Refactor exclusion of -I/usr/include to
avoid per-language values, 2019-01-21, v3.14.0-rc1~108^2~4) caused the
exclusion to apply to Fortran, but it was only meant for C, CXX, and
CUDA.  The purpose of the change was to prepare for the value of
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` to be computed from the
actual compiler instead of hard-coded.  We need to preserve exclusion of
`-I/usr/include` if the compiler has any implicit include directory that
looks intended to replace it, e.g. `<sdk>/usr/include` on macOS.

Fixes: #18914
2019-02-13 09:52:20 -05:00
Brad King
017598a444 macOS: Fix addition of <sdk>/usr/include to default implicit include dirs
In commit 1293ed8507 (ParseImplicitIncludeInfo: keep implicit incl.
consistent when rerunning cmake, 2019-01-30, v3.14.0-rc1~26^2) the
`Platform/UnixPaths` module was updated to add `/usr/include` to
`CMAKE_{C,CXX,CUDA}_IMPLICIT_INCLUDE_DIRECTORIES` through an
initialization variable used by `CMakeDetermineCompilerABI` instead of
directly.  This approach makes it only a default that can be overridden
by detection of the implicit include directories really used by the
compiler.

The addition of `<sdk>/usr/include` to default implicit include
directories by the `Platform/Darwin` module needs the same update but
was accidentally left out of the original commit.
2019-02-13 09:52:19 -05:00
Brad King
3ff5a43c49 Merge branch 'FindMatlab-version-empty' into release-3.14
Merge-request: !2949
2019-02-11 13:21:41 -05:00
Sebastian Nagel
40176749bc FindMatlab: Tolerate empty version log file 2019-02-11 13:20:55 -05:00