Commit Graph

10212 Commits

Author SHA1 Message Date
Brad King
f32d41d295 Merge topic 'CheckTypeSize-ppc64'
a09d646b7c CheckTypeSize: Fix '..._CODE' result for ppc and ppc64

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4413
2020-03-02 10:48:41 -05:00
Brad King
178a166ae1 Merge topic 'xl-fortran-module-dir-use'
92785ed746 Tests: Enable Fortran submodule tests on XL compilers
210b0b99a9 XL: Fix using Fortran modules from their output directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4405
2020-03-02 10:48:05 -05:00
Brad King
813b505c67 Merge topic 'CheckFortranSource-def'
1bc521416f CheckFortranSource*: Avoid passing -DVAR to linker

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4406
2020-03-02 10:47:11 -05:00
Brad King
a09d646b7c CheckTypeSize: Fix '..._CODE' result for ppc and ppc64
Check for ppc64 macros before plain ppc.  Consider both upper and lower
case variants because some compilers have only one of them.

Fixes: #20368
2020-02-28 13:57:31 -05:00
Brad King
fb377ab5ef Merge topic 'FortranCInterface-cross-compile'
8e2683cf6d FortranCInterface: Fix broken search for test exe when cross-compiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4404
2020-02-28 11:36:10 -05:00
Brad King
e46f579637 Merge topic 'q_namespace_export'
426941c433 Autogen: Recognize the new Q_NAMESPACE_EXPORT macro in AUTOMOC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4398
2020-02-28 11:14:34 -05:00
Brad King
1bc521416f CheckFortranSource*: Avoid passing -DVAR to linker
The test project is compiled with a `-DVAR` compiler flag where `VAR` is
the result variable.  Tell `try_compile` to add the flag through
`add_definitions` instead of `CMAKE_Fortran_FLAGS` so that it is not
used for linking.  Otherwise some Fortran compilers (e.g. XL 15) do not
like the flag when used to drive linking.
2020-02-28 10:57:45 -05:00
Brad King
210b0b99a9 XL: Fix using Fortran modules from their output directory
The XL Fortran compiler's `-qmoddir=` flag sets the module output
directory but does not add the directory to the search path for using
modules.  This is inconsistent with other compilers like the GNU Fortran
compiler's `-J` flag that does both.  In order to make these consistent,
add the module output directory with a `-I` flag on the XL Fortran
compiler so that it will be searched when using modules too.

This fixes our `FortranModules` test's coverage of submodules on
Ninja + XL.  That test places module files in a subdirectory that with
Ninja is not the current working directory when the compiler runs.

Fixes: #20400
2020-02-28 10:37:11 -05:00
Brad King
8e2683cf6d FortranCInterface: Fix broken search for test exe when cross-compiling
Previously the `find_program` call we used to locate the test executable
but that can be broken by `CMAKE_FIND_ROOT_PATH_MODE_PROGRAM`.  Instead
teach the test project to write a file with the location of the
executable it builds.  Load that file to get the exact location.

Fixes: #20390
2020-02-27 11:09:25 -05:00
Brad King
ac23cfdee7 Merge topic 'FindPython-cache-cleanup'
42c6a1bfee FindPython: Do not cache computed result variables
a7b4516e1a FindPython: Mark non-public cache entries INTERNAL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4393
2020-02-27 08:31:46 -05:00
Marc Chevrier
1679a60a6e Merge topic 'FindSWIG-components'
e131d9f974 FindSWIG: Add COMPONENTS support for SWIG target languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4384
2020-02-27 04:53:02 -05:00
Seth R Johnson
e131d9f974 FindSWIG: Add COMPONENTS support for SWIG target languages
Newer versions of SWIG drop support for some target languages, and some
forks of SWIG (such as for Fortran and MATLAB) aren't supported by the
mainline version of SWIG.

Swig versions as old as 1.3.6 (circa 2001) and possibly older use the
same format for listing available wrappers "%-15s - Generate %s
wrappers", so component detection should be quite reliable.
2020-02-26 10:12:30 -05:00
Brad King
ab2d170c74 Merge topic 'CPackRPM-trans-scripts'
c0534c4a68 CPackRPM: Add PRE_/POST_TRANS scripts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4387
2020-02-26 08:52:09 -05:00
Marc Chevrier
42c6a1bfee FindPython: Do not cache computed result variables
Since commit 06d9e67fbd (FindPython: Add capability to specify directly
artifacts, 2019-08-15, v3.16.0-rc1~157^2) we accidentally add the result
variables `Python*_LIBRARY_RELEASE` and `Python*_LIBRARY_DEBUG` to the
cache.  They are always computed from other results and so should not be
presented to users in cmake-gui and ccmake to edit.

Issue: #20362
2020-02-26 08:08:26 -05:00
Marc Chevrier
a7b4516e1a FindPython: Mark non-public cache entries INTERNAL
Since commit 06d9e67fbd (FindPython: Add capability to specify directly
artifacts, 2019-08-15, v3.16.0-rc1~157^2) we accidentally expose cache
entries named `_Python...` to users in cmake-gui and ccmake.  Mark those
entries as `INTERNAL` to hide them.

Issue: #20362
2020-02-26 08:08:03 -05:00
Richard
426941c433 Autogen: Recognize the new Q_NAMESPACE_EXPORT macro in AUTOMOC
Qt 5.14 introduced a new moc keyword `Q_NAMESPACE_EXPORT`.

Qt-Issue: https://bugreports.qt.io/browse/QTBUG-68014
2020-02-26 07:18:44 -05:00
Marc Chevrier
facadf6c30 Merge topic 'swig-fortran'
a1909e26ac UseSWIG: Enable SWIG Fortran target language

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4380
2020-02-25 17:19:51 -05:00
Brad King
693a1d7fcb Merge topic 'GoogleTest-optimize'
dac201442d GoogleTest: Optimize gtest_discover_tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4371
2020-02-25 09:10:03 -05:00
Steffen Seckler
dac201442d GoogleTest: Optimize gtest_discover_tests
Prior to this, `gtest_discover_tests` could take multiple minutes if
many tests are present.  This behavior was caused by a repeated addition
to the variable `script` in the `add_command` function using:

    set(script "${script}${NAME}(${_args})\n" PARENT_SCOPE)

This takes very long for large variables.

This commit flushes the contents of the variable to ${CTEST_FILE} after
a certain size of the variable is reached.

In addition:

- cmake_minimum_required(VERSION ${CMAKE_VERSION}) is set to allow usage
  of new policies.  In particular, CMP0053 speeds up variable expansion.
- No longer appends strings using set(), but instead uses string(APPEND).
- An additional buffer for the tests variable is set.
2020-02-25 09:03:56 -05:00
Brad King
c66dccb6a3 Merge topic 'FindOpenCL-cuda-paths'
9078101d75 FindOpenCL: Add more paths on 64-bit Linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4336
2020-02-25 09:02:15 -05:00
Brad King
4d339831b0 Merge topic 'FindCUDA-no-threads-target'
b9d67447c3 FindCUDA: Only depend on Threads::Threads on platforms that need it

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4377
2020-02-25 08:58:17 -05:00
Brad King
2b615e6f5e Merge topic 'FindPkgConfig-scope'
c3e0d1ffe9 FindPkgConfig: set policies CMP0054 and CMP0057 to new

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4388
2020-02-25 08:55:50 -05:00
Brad King
64ed4f6f99 Merge topic 'cuda-non-device-link'
7da2c8c543 Merge branch 'backport-cuda-non-device-link'
738f3f23aa Ninja: Do not use nvcc response files with non-nvcc tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !4376
2020-02-25 08:54:45 -05:00
Sarang Joshi
c0534c4a68 CPackRPM: Add PRE_/POST_TRANS scripts
Add variables for PRE_TRANS and POST_TRANS scripts.

Fixes: #18917
2020-02-24 14:31:38 -05:00
Robert Maynard
b9d67447c3 FindCUDA: Only depend on Threads::Threads on platforms that need it
In commit 46371132b3 (FindCUDA: CUDA_LIBRARIES doesn't contain raw
`-pthread`, 2019-11-11, v3.17.0-rc1~455^2) we introduced use of the
`Threads::Threads` target, but we do not `find_package(Threads)` on all
platforms.  Use the target only if it exists.
2020-02-24 14:14:38 -05:00
Matthäus G. Chajdas
9078101d75 FindOpenCL: Add more paths on 64-bit Linux
Add additional search paths for OpenCL on 64-bit Linux.

Fixes: #20084
2020-02-24 14:07:28 -05:00
Brad King
7da2c8c543 Merge branch 'backport-cuda-non-device-link' 2020-02-24 13:34:13 -05:00
Francisco Facioni
738f3f23aa Ninja: Do not use nvcc response files with non-nvcc tools
Since commit d91b5a72cd (Ninja: Add support for CUDA nvcc response
files, 2019-05-30, v3.15.0-rc1~8^2) we use NVCC's `--options-file`
option to avoid long link command lines via a response file.  However,
for non-device linking the host tools are used and the option does not
make sense.  Update the logic to use `--options-file` only for device
linking.  Linking with the host tools already has its own logic for
response files.

Fixes: #19954
2020-02-24 13:31:33 -05:00
Brad King
8d6ea4401c Merge topic 'pch-create-via-include' into release-3.17
5c6d6ec27c PCH: Clang: Update PCH usage flags to include original header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4360
2020-02-24 13:12:08 -05:00
Brad King
41a12d3df0 Merge topic 'pch-create-via-include'
5c6d6ec27c PCH: Clang: Update PCH usage flags to include original header

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4360
2020-02-24 13:12:08 -05:00
Seth R Johnson
a1909e26ac UseSWIG: Enable SWIG Fortran target language 2020-02-24 12:15:48 -05:00
Sergey Larin
5c6d6ec27c PCH: Clang: Update PCH usage flags to include original header
Add an additional include flag to PCH usage command line to fix programs
that rely on `compile_commands.json` file. Pass it to the preprocessor
directly to avoid compiler driver to change it to '-include-pch'.

When preprocessor is requested to preprocess a file, it tries to get
the original filename from '.pch' and uses that file for preprocessing.
CMake generates a '.pch' file from the '.hxx' file by passing an empty
'.cxx' source file to the compiler as a compilation unit and the header
file with the '-include' flag. After that, compiler puts compilation
unit filename in the '.pch' as the original filename.

However, CMake build system uses empty file as the source file and
passes the header file using '-include-pch' flag. As a result, Clang
uses the wrong file for preprocessing and produces the corrupted
preprocessed file.

Fixes: #20355
Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
2020-02-24 10:53:39 -05:00
Rolf Eike Beer
c3e0d1ffe9 FindPkgConfig: set policies CMP0054 and CMP0057 to new
One may encounter warnings if FindPkgConfig is used in any project, even
indirectly, that has set any of these policies to old explicitely or requires
an older version.
2020-02-24 16:42:34 +01:00
Brad King
084c14d952 Merge topic 'doc-sections'
22aac6669b Help: install: use bullet lists to sort out target kinds
b3f4d50348 Help: ifw.rst: Add toc; mv "Hints" section -> subsection of "Variables"
c671966c20 Help: CPackComponent: Sectioning and rewording
05e56b1897 Help: FetchContent, ExternalProject: Command sections -> subsections

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4367
2020-02-18 11:26:27 -05:00
Brad King
b841fdcb9e Merge topic 'CPackNuGet-granular-errors'
e6c470997f CPack/NuGet: Provide more granular errors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !4132
2020-02-18 11:23:31 -05:00
Brad King
b4971d086f Merge topic 'swift-exe-rpath'
321df5783d Swift: support `-rpath` for executables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4365
2020-02-18 11:21:47 -05:00
Brad King
77b537cc35 Merge topic 'swift-exe-rpath' into release-3.17
321df5783d Swift: support `-rpath` for executables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4365
2020-02-18 11:21:46 -05:00
Saleem Abdulrasool
321df5783d Swift: support -rpath for executables
This adjusts the flags to enable setting the RPATH for executables.
2020-02-17 11:07:40 -05:00
Yacoub Hossain
e6c470997f CPack/NuGet: Provide more granular errors
Address the problem of not knowing when cpack fails to create a nuget
package which occurs when creating multiple nupkgs.

Fixes: #20094
2020-02-17 11:01:08 -05:00
Brad King
bf718ccd60 Merge topic 'git-config-with-spaces' into release-3.17
ef3194a6f8 ExternalProject: Quote each git --config option to handle spaces
40d1d29cfa Tests: Add missing ExternalProject smoke tests
afc8956765 Tests: Fix test_clean target missing some test directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4364
2020-02-17 10:39:46 -05:00
Brad King
0557e0b866 Merge topic 'git-config-with-spaces'
ef3194a6f8 ExternalProject: Quote each git --config option to handle spaces
40d1d29cfa Tests: Add missing ExternalProject smoke tests
afc8956765 Tests: Fix test_clean target missing some test directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4364
2020-02-17 10:39:46 -05:00
Joachim Wuttke (o)
c671966c20 Help: CPackComponent: Sectioning and rewording
* Insert section and subsection headers (because this is a very long
    doc page)
* In the Introduction, first say that module is included automatically
* Then start with operational definition of components
* Remove duplications
* Also reword the description of the command cpack_add_component
2020-02-17 16:12:15 +01:00
Joachim Wuttke (o)
05e56b1897 Help: FetchContent, ExternalProject: Command sections -> subsections 2020-02-17 12:15:57 +01:00
Craig Scott
ef3194a6f8 ExternalProject: Quote each git --config option to handle spaces
Fixes: #20354
2020-02-15 13:23:56 +11:00
Joachim Wuttke (o)
0ea52ece71 Help: module CPack: improve summary and Introduction
* In summary:
  * we configure generators, not the generated installers
  * we generate installers or source packages, not source package installers

* In Introduction:
  * Make paragraph on binary installers more concise
  * Remove example that refered to CMake source tree
  * Add paragraph on source packages
  * omit the parenthesis on graphical installers
2020-02-14 21:49:47 +11:00
Joachim Wuttke (o)
5c4d730dd4 Help: CPackComponent: improve summary and introduction
Also:
* provide some hyperlinks
* update parenthesis on graphical installers (no longer restricted
  to Win and macOS)
2020-02-14 21:49:22 +11:00
Brad King
d8daaf0bc3 Merge topic 'doc-ascii'
c5d7c29137 Help: Replace UTF-8 apostrophe with ascii apostrophe

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !4358
2020-02-12 15:04:41 -05:00
Brad King
c5d7c29137 Help: Replace UTF-8 apostrophe with ascii apostrophe
Also replace UTF-8 graphical characters with simple dashes.

Fixes: #20349
2020-02-12 14:37:41 -05:00
Brad King
6f2464b2ed Merge topic 'doc-cpack' into release-3.17
3af0b33ec6 Help: module CPack: Make internal hyperlink target more unique

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4353
2020-02-12 10:32:05 -05:00
Brad King
1214e830ea Merge topic 'doc-cpack'
3af0b33ec6 Help: module CPack: Make internal hyperlink target more unique

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4353
2020-02-12 10:32:05 -05:00