Commit Graph

645 Commits

Author SHA1 Message Date
jonathan molinatto
ba497111f6 VS: Add option for custom Win10 SDK version maximum
Since commit 83ddc4d289 (VS: Do not select a Windows SDK too high for
current VS version, 2017-08-07, v3.13.0-rc1~72^2~2) we enforce a maximum
SDK version for the VS 2015 generator.  The blog post linked in the
original commit is no longer available, but it can be seen here:

* https://web.archive.org/web/20190108032520/https://blogs.msdn.microsoft.com/chuckw/2018/10/02/windows-10-october-2018-update/

In particular, it states:

> VS 2015 Users: The Windows 10 SDK (15063, 16299, 17134, 17763)
> is officially only supported for VS 2017.

However, in some circumstances a higher version can be used.

Add a `CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` to override the
generator's default maximum SDK version.

Fixes: #20633
2020-08-25 15:27:38 -04:00
Kyle Edwards
2e42651dff Add option to optimize link dependencies for static libraries
Add an `OPTIMIZE_DEPENDENCIES` target property and supporting
`CMAKE_OPTIMIZE_DEPENDENCIES` variable to optionally enable pruning and
flattening of outgoing dependencies from static libraries.  Since they
do not actually link, they only depend on side effects of their
dependencies.  Therefore we can drop dependencies that contribute no
side effects.
2020-08-12 11:31:07 -04:00
Brad King
121c3717ee Merge topic 'automoc-path-prefix-off'
5b5be34811 Help: Add 3.18.2 release note about AUTOMOC_PATH_PREFIX default change
db659e18bc Merge branch 'backport-3.17-automoc-path-prefix-off'
e503fbe38a Merge branch 'backport-3.16-automoc-path-prefix-off'
4c33b305a0 Autogen: Turn off moc path prefix generation by default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5105
2020-08-11 08:51:02 -04:00
Brad King
0953c0051e Merge topic 'clang-cl-vfs'
20ebaed972 Clang: Add support for passing VFS arguments
d993ebd4ca clang-cl: Add '--' before source file
a94672b919 cmake: Change cmake_llvm_rc separator from -- to ++ to avoid conflict

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5087
2020-08-10 11:33:19 -04:00
Brad King
db659e18bc Merge branch 'backport-3.17-automoc-path-prefix-off' 2020-08-10 10:49:18 -04:00
Brad King
e503fbe38a Merge branch 'backport-3.16-automoc-path-prefix-off' 2020-08-10 10:41:06 -04:00
Joerg Bornemann
4c33b305a0 Autogen: Turn off moc path prefix generation by default
Change the default value of `CMAKE_AUTOMOC_PATH_PREFIX` to `OFF` to
restore compatibility with behavior of CMake 3.15 and below.

C++ source files that are generated by Qt's meta object compiler (moc)
include the header file that was passed as input argument to moc. This
is usually a path relative to the source directory, for example

    #include "../../source/dir/myobject.h"

That is problematic for reproducible builds as described in #18815.
To cope with that, the target property AUTOMOC_PATH_PREFIX was
introduced in CMake 3.16 by commit d018d27c10 (Autogen: Add moc path
prefix generation (AUTOMOC_PATH_PREFIX), 2019-09-13, v3.16.0-rc1~94^2~4).
The property is default-initialized from the variable
`CMAKE_AUTOMOC_PATH_PREFIX`, which defaults to `ON`.

If this property is ON, and myobject.h is located in an include
directory of the target, moc-generated C++ files include the file
without the "path prefix":

    #include "myobject.h"

This behavior, however, can break projects that have equally named
header files in different include directories.  As "not breaking
existing projects" trumps "have reproducible builds by default" we
change the default of `CMAKE_AUTOMOC_PATH_PREFIX` to `OFF`.

Also, it is now possible to pass `-DCMAKE_AUTOMOC_PATH_PREFIX=ON` on the
CMake command line.  Before, it was overridden in `CMakeGenericSystem`.

Fixes: #20598
Issue: #18815
2020-08-10 10:36:17 -04:00
Thomas Bernard
20ebaed972 Clang: Add support for passing VFS arguments 2020-08-07 11:52:45 -04:00
Fred Baksik
db486da265 Toolchain: Update documentation for initial compiler flags 2020-08-03 12:34:46 -04:00
Brad King
7968d9d442 Help: Document CMAKE_CUDA_HOST_COMPILER as specific to NVIDIA nvcc
Explain the purpose of this variable and the conditions under which
it can be set.  Point out that it should not be set explicitly without
also setting `CMAKE_CUDA_COMPILER` explicitly.

Issue: #20826
2020-07-14 15:22:54 -04:00
Craig Scott
32e13e5291 Merge topic 'ctest-resource-spec-file-doc'
c57695a2f4 Help: Clarify search order for resource spec file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4983
2020-07-08 09:06:54 -04:00
Kyle Edwards
c57695a2f4 Help: Clarify search order for resource spec file
Clarify the order in which --resource-spec-file, RESOURCE_SPEC_FILE,
and CTEST_RESOURCE_SPEC_FILE are searched, and add tests to
enforce this.

Fixes: #20914
2020-07-07 12:21:58 -04:00
Kitware Robot
496ec6036f Help: Add Sphinx 'versionadded' directives to each top-level document
Run the `Utilities/Sphinx/update_versions.py` script to add initial
markup to every top-level document and find module.

Issue: #19715
2020-07-06 10:23:20 -04:00
Craig Scott
00c0c27303 Help: Clarify how env vars and ..._INIT variables interact
Fixes: #20358
2020-05-24 19:10:14 +10:00
Brad King
62816ff88c Merge topic 'fortran-preprocess-property'
3888de23da Ninja: Skip Fortran preprocessing if Fortran_PREPROCESS is OFF
66c4e87282 Ninja: Add helper functions to generate Fortran build
5cca1ec893 Ninja: Add helper functions to generate Fortran preprocess rule
b0a6161190 Fortran: Add Fortran_PREPROCESS property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4659
2020-05-22 10:35:10 -04:00
Brad King
a7b3102e00 Merge topic 'support_conda_env'
50879ce412 Conda: Add CONDA_PREFIX as an acceptable system prefix path
cd9c3c000f Tests: Update QtAutogen codeeditor test only include headers needed
d806bd2e8c Tests: Update test suite to run in an Anaconda environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4773
2020-05-22 08:12:24 -04:00
Brad King
d8eee80e30 Merge branch 'backport-cuda-default-runtime' into cuda-default-runtime 2020-05-22 06:50:19 -04:00
Peter Hill
b0a6161190 Fortran: Add Fortran_PREPROCESS property
Issue: #18870
2020-05-21 11:44:14 -04:00
Robert Maynard
50879ce412 Conda: Add CONDA_PREFIX as an acceptable system prefix path 2020-05-21 11:32:36 -04:00
Robert Maynard
e55b21e24e CUDA: Compute CMAKE_CUDA_RUNTIME_LIBRARY default from toolchain
Since commit 0d0145138f (CUDA: Add abstraction for cuda runtime
selection, 2019-11-29, v3.17.0-rc1~83^2) we add CUDA runtime library
selection flags by default.

To maintain backwards compatibility the default CUDA runtime
library needs to be computed based on what libraries are found
on the initial compiler invocation. For example a toolchain
could establish initial flags that have all CUDA compilations
using the runtime version, and if we don't detect this we will
try to link to both the static and shared runtime.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #20708
2020-05-21 11:15:03 -04:00
Robert Maynard
a4ea293153 Help: Correct CMAKE_CUDA_RUNTIME_LIBRARY applicability 2020-05-20 14:36:55 -04:00
Robert Maynard
6b3d8f281e Document which environment variables effect CMAKE_SYSTEM_PREFIX_PATH 2020-05-19 10:57:09 -04:00
Brad King
d1d1d4134d Merge topic 'ctest-nightly-start-time'
4f2fa2459a Tests: Add tests to demonstrate when CTEST_NIGHTLY_START_TIME is needed
c1397ace1d Help: Clarify why CTEST_NIGHTLY_START_TIME is needed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4688
2020-05-01 08:26:29 -04:00
Kyle Edwards
c1397ace1d Help: Clarify why CTEST_NIGHTLY_START_TIME is needed 2020-04-29 14:49:19 -04:00
Nicolas Bock
bd6e437e3e Help: Clarify the use of PROJECT_SOURCE_DIR
The value of the PROJECT_SOURCE_DIR variable is not always the source
directory of the "most recent project command". If the project was
included via add_subdirectory, variable scoping will prevent this
value to change in the parent scope.

Signed-off-by: Nicolas Bock <nicolasbock@gmail.com>
2020-04-29 23:17:41 +10: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
Craig Scott
75e45f50e5 Merge topic 'docs-CMAKE_CURRENT_FUNCTION'
10ee9611f0 Help: Improve wording of CMAKE_CURRENT_FUNCTION_LIST_DIR docs
22fbc404a7 Help: Add cross-references for CMAKE_CURRENT_FUNCTION* docs
d2b139687a Help: Minor grammar cleanups of CMAKE_CURRENT_FUNCTION* docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !4595
2020-04-11 09:12:29 -04:00
Craig Scott
10ee9611f0 Help: Improve wording of CMAKE_CURRENT_FUNCTION_LIST_DIR docs
The original wording was somewhat confusing in talking about rendering of
templates. While technically correct, a less experienced user may not know
that terminology. The wording has been updated to more clearly describe the
example usage.

The old way of implementing the example is not "bad", it was the only way to do
things before the CMAKE_CURRENT_FUNCTION_LIST_DIR variable was added.
The example has been updated to remove the Bad/Good captions to reflect this.
Indentation of the examples was also fixed to make them conform to the guidelines.
2020-04-10 22:02:11 +10:00
Craig Scott
22fbc404a7 Help: Add cross-references for CMAKE_CURRENT_FUNCTION* docs 2020-04-10 21:56:07 +10:00
Craig Scott
d2b139687a Help: Minor grammar cleanups of CMAKE_CURRENT_FUNCTION* docs 2020-04-10 21:55:38 +10:00
Brad King
2b9e3abcb5 Merge topic 'ctest-resource-file-cache'
060d2ce269 CTest: Add CTEST_RESOURCE_SPEC_FILE variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4564
2020-04-06 08:26:40 -04:00
Craig Scott
49b78e93a7 Merge topic 'docs-CMAKE_FIND_DEBUG_MODE'
477b8b5dfe Help: Improve discoverability of CMAKE_FIND_DEBUG_MODE
218bda9671 Help: Fix CMAKE_FIND_DEBUG_MODE list formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4569
2020-04-06 06:34:15 -04:00
Craig Scott
218bda9671 Help: Fix CMAKE_FIND_DEBUG_MODE list formatting 2020-04-04 19:59:26 +11:00
Kyle Edwards
060d2ce269 CTest: Add CTEST_RESOURCE_SPEC_FILE variable 2020-04-02 16:29:50 -04:00
Brad King
0055170b08 Merge topic 'docs-xcode-gen-scheme-workdir'
6905451e11 Help: Add missing XCODE_SCHEME_WORKING_DIRECTORY
6ff07dac76 Help: Minor typos and formatting for XCODE_SCHEME_WORKING_DIRECTORY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4543
2020-03-30 13:23:19 -04:00
Brad King
04d8ed643c Merge topic 'docs-xcode-gen-scheme-workdir' into release-3.17
6905451e11 Help: Add missing XCODE_SCHEME_WORKING_DIRECTORY
6ff07dac76 Help: Minor typos and formatting for XCODE_SCHEME_WORKING_DIRECTORY

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4543
2020-03-30 13:23:18 -04:00
Craig Scott
6ff07dac76 Help: Minor typos and formatting for XCODE_SCHEME_WORKING_DIRECTORY 2020-03-29 22:13:56 +11:00
Craig Scott
655b52af1d Merge topic 'ninja-multi-doc-variable-update'
c8fd26eb57 Help: Move Ninja Multi-Config variable details into their respective pages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4532
2020-03-28 03:05:10 -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
Kyle Edwards
c8fd26eb57 Help: Move Ninja Multi-Config variable details into their respective pages 2020-03-26 15:33:48 -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
1d9884fe7d Merge topic 'doc-typo'
356c7cec2c Help: Fixed typo in CMAKE_INSTALL_RPATH_USE_LINK_PATH.rst

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4516
2020-03-23 10:54:42 -04:00
Jaak Ristioja
356c7cec2c Help: Fixed typo in CMAKE_INSTALL_RPATH_USE_LINK_PATH.rst
Signed-off-by: Jaak Ristioja <jaak@ristioja.ee>
2020-03-23 09:46:08 -04:00
Alexandru Croitor
ad3f69c86e Add support for FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG> 2020-03-04 14:30:54 +01:00
Kyle Edwards
7a63dafafb Ninja Multi-Config: Remove "NMC" from variable names
Also rename `..._DEFAULT_BUILD_FILE_CONFIG` to `..._DEFAULT_BUILD_TYPE`.
These name changes make the variables meaningful for future use by other
generators.
2020-02-27 09:22:08 -05:00
Kyle Edwards
853c3eac6d Help: Note that CMAKE_CFG_INTDIR is not fully supported on Ninja Multi-Config 2020-02-25 14:00:43 -05:00
Brad King
5f04dfe57e Merge topic 'ninja-multi-variable-shuffle'
b966f86d86 Ninja Multi-Config: Shuffle variables around

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4305
2020-02-03 14:00:03 -05:00
Kyle Edwards
b966f86d86 Ninja Multi-Config: Shuffle variables around
Remove redundant variable CMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE.
Rename other variables. Document and improve handling of error
conditions.
2020-02-03 13:27:51 -05:00
Brad King
afcd9fe669 AIX: Add an option to disable automatic exports from shared libraries
Since commit 0f150b69d3 (AIX: Explicitly compute shared object exports
for both XL and GNU, 2019-07-11, v3.16.0-rc1~418^2~2) we always export
all symbols from shared libraries by default.  Add a new target property
called `AIX_EXPORT_ALL_SYMBOLS` that can be explicitly set to OFF to
suppress this behavior and export no symbols by default.

Fixes: #20290
2020-01-31 09:34:06 -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