Commit Graph

766 Commits

Author SHA1 Message Date
Craig Scott
4e5d871e74 Merge topic 'doc-cleanups-3.21'
8d1944c675 Help: Expand details for file(COPY_FILE)
c8ea886123 Help: Re-order file() sub-commands in Filesystem section
b5a96716eb Help: Clarify which project() call PROJECT_IS_TOP_LEVEL is for
8be7694d97 Help: Fix trivial typo

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6361
2021-07-20 07:54:58 -04:00
Brad King
1f6e1a2d78 Merge topic 'vs2022'
0c7f918fb1 VS: Update Visual Studio 17 2022 generator for Preview 2
1ac1436b25 VS: Fix `/sourceDependencies` flag table entries for v143
919fc7fd5f VS: Remove broken EnableASAN entry from flag table for v143
3f19847b28 VS: Remove empty ExternalWarningLevel entry from flag table for v143
ccb6083cbe VS: Remove empty LanguageStandard entries from flag table for v143
c167de7e70 VS: Remove empty ConformanceMode entry from flag table for v143
993d706a17 VS: Populate `/JMC-` flag table entry for v143
a070d87e08 VS: Populate `-Qspectre-` flag table entry for v143
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Egor Pugin <egor.pugin@gmail.com>
Merge-request: !6350
2021-07-19 12:41:20 -04:00
Craig Scott
b5a96716eb Help: Clarify which project() call PROJECT_IS_TOP_LEVEL is for 2021-07-18 16:45:20 +10:00
Brad King
0c7f918fb1 VS: Update Visual Studio 17 2022 generator for Preview 2
In particular, update to toolset `v143`.

Fixes: #22339
2021-07-15 13:12:55 -04:00
Brad King
c9cd039e5f Merge topic 'LWYU-externalization'
14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration
9c5132a586 PGI: Fix "LINKER:" prefix generated separator
8a93de080c cmGeneratorTarget: Add method for LINKER: prefix translation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6306
2021-07-12 08:43:32 -04:00
Marc Chevrier
14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration
Currently, this feature is only supported on ELF platforms. So, the property
LINK_WHAT_YOU_USE will be ignored for other plateforms.
Moreover, flags and commands are now controled by CMake variables.

Fixes: #20174
2021-07-09 14:50:50 +02:00
Brad King
755f5194c6 Merge topic 'help_toplevel'
2df4badc5f Help: Note PROJECT_IS_TOP_LEVEL behavior w.r.t. ExternalProject

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6307
2021-07-08 09:44:08 -04:00
Michael Hirsch
2df4badc5f Help: Note PROJECT_IS_TOP_LEVEL behavior w.r.t. ExternalProject
Extend the documentation added by commit 96a7040107 (project: Define
variables indicating whether project is top level, 2021-03-24,
v3.21.0-rc1~443^2) to give some examples of how the variables are set in
each context.
2021-07-08 09:37:37 -04:00
Eugene Shalygin
a2e9fe38e4 find_package: Add variable to make package REQUIRED
Add a `CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` variable is complement
to `CMAKE_DISABLE_FIND_PACKAGE_<PackageName>` with just the opposite
behaviour: it turns non-required find_package call into the required one.

While optional package dependencies usually result in simple and clean
build logic, sometimes people want to be sure those optional
dependencies will be found and used. Examples are reproducible builds
and build instructions for 3rd parties. People choose to make
find_package calls REQUIRED and put them behind an option(). Such
workarounds blend build logic with build environment management and do
not look elegant.
2021-07-08 08:03:38 -04:00
Brad King
ef56eefc9b cmake: Allow CMAKE_CONFIGURATION_TYPES to be set by environment variable
When no `CMAKE_CONFIGURATION_TYPES` is explicitly specified while
creating a new build tree, check for an environment variable of the same
name.

Issue: #20983
2021-06-30 10:55:40 -04:00
Brad King
e216b9bbd3 cmake: Allow CMAKE_BUILD_TYPE to be set by environment variable
When no `CMAKE_BUILD_TYPE` is explicitly specified while creating a new
build tree, check for an environment variable of the same name.

Issue: #20983
2021-06-30 10:55:40 -04:00
Brad King
6986a382a9 Help: Document when CMAKE_BUILD_TYPE and CMAKE_CONFIGURATION_TYPES are set
Fixes: #19247
2021-06-30 10:55:40 -04:00
Brad King
e96169a3ec Help: Cross-reference CMAKE_CONFIGURATION_TYPES from CMAKE_BUILD_TYPE
The other direction is already linked.
2021-06-30 10:55:40 -04:00
Marc Chevrier
16208ac113 CMP0126: Add control for warnings
Fixes: #22353
2021-06-29 13:36:28 +02:00
Brad King
c46b265839 VS: Add Visual Studio 17 2022 generator
Fixes: #22339
2021-06-25 12:45:44 -04:00
Brad King
f119fbeec5 Help: Update Sphinx versionadded directives for 3.21 release
Run the script:

    Utilities/Sphinx/update_versions.py --since v3.20.0 --overwrite

Manually remove directives generated in documents for long-existing
features for which documentation was added.
2021-06-17 09:48:54 -04:00
Brad King
46686f077b Help: Document special "CTEST_FULL_OUTPUT" test output string 2021-06-09 08:23:06 -04:00
Brad King
7aad9e8685 Merge topic 'add_hip_language'
8514ee9b31 HIP: analyze output of `hipcc` to determine default GPU architecture
20d086f1a2 HIP: All HIP tests now run on CMake's current AMD hardware
2e86e50c2f HIP: Add HIP to all the Check* modules
947dbed0aa HIP: Automatically inject the `hip::device` runtime target
b50bfc8913 HIP: Add language to CMake
ff0d2858e1 HIP: Extract clang compiler details from hipcc
bd844387df ROCMClang: Add the ROCm toolkit derived clang compiler to CMake
590553f322 Compilers: protect use of  __has_include
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Zack Galbreath <zack.galbreath@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !6121
2021-06-09 07:53:32 -04:00
Brad King
d1517a4ef9 Merge topic 'compile-options-order'
8f68bcad8f Tests: Add cases verifying flag ordering rules
ccc83ce162 Help: Document order of flags from CMAKE_<LANG>_FLAGS and COMPILE_OPTIONS
df79fe055b Help: Remove incorrect "versionadded" for CMAKE_<LANG>_FLAGS_<CONFIG>
c48d2d8480 VS: Place per-source preprocessor definitions after target-wide ones

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6187
2021-06-08 08:04:16 -04:00
Zack Galbreath
8514ee9b31 HIP: analyze output of hipcc to determine default GPU architecture 2021-06-07 19:25:34 +00:00
Robert Maynard
b50bfc8913 HIP: Add language to CMake 2021-06-07 19:25:33 +00:00
Robert Maynard
bd844387df ROCMClang: Add the ROCm toolkit derived clang compiler to CMake 2021-06-07 19:25:28 +00:00
Craig Scott
41dea08423 Help: Remove recommendations for using CMAKE_CFG_INTDIR
Commit e71c4f7729 (CMAKE_CFG_INTDIR: Formally deprecate in favor of
$<CONFIG>, 2021-05-27) only updated the docs for CMAKE_CFG_INTDIR
itself, but other parts of the docs still used it. Update the other places
to avoid referring to the now-deprecated variable.
2021-06-06 17:14:29 +10:00
Brad King
ccc83ce162 Help: Document order of flags from CMAKE_<LANG>_FLAGS and COMPILE_OPTIONS 2021-06-03 11:02:27 -04:00
Brad King
df79fe055b Help: Remove incorrect "versionadded" for CMAKE_<LANG>_FLAGS_<CONFIG>
These variables have been around for a long time, but the current
form of the document was added later.
2021-06-03 11:02:27 -04:00
Brad King
6c34ed9b87 cmake: Allow CMAKE_TOOLCHAIN_FILE to be set by environment variable
When no `CMAKE_TOOLCHAIN_FILE` is explicitly specified while creating
a new build tree, check for an environment variable of the same name.
2021-06-03 08:32:44 -04:00
Bobby D Reynolds
ae108418ae Launchers: Support setting linker launchers
Fixes: #18316
2021-05-28 12:28:43 -04:00
Kyle Edwards
e71c4f7729 CMAKE_CFG_INTDIR: Formally deprecate in favor of $<CONFIG> 2021-05-27 10:26:11 -04:00
Nils Gladitz
26e36111d3 CPack: Implement new variable CPACK_CUSTOM_INSTALL_VARIABLES
The new variable allows projects to define custom key=value pairs of
variables to be set in CPack cmake_install.cmake script invocations.
This allows install(SCRIPT|CODE) to be parameterized at runtime.
2021-05-24 08:21:49 +10:00
Craig Scott
b00a171b2b Help: Clarify calling cmake_minimum_required() inside a function
Fixes: #21519
2021-05-15 15:26:01 +10:00
Brad King
6c5a2b2171 Merge topic 'helpctestscript'
140fe8c3c6 Help: Document CTEST_SCRIPT_DIRECTORY variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6111
2021-05-11 09:25:53 -04:00
Michael Hirsch
140fe8c3c6 Help: Document CTEST_SCRIPT_DIRECTORY variable 2021-05-10 10:55:59 -04:00
Josef Angstenberger
7072d83772 Help: Fix typos and spelling in documentation 2021-05-07 17:00:17 +02:00
Michael Hirsch
7398993f5b Help: Document CMAKE_TLS_VERIFY variable explicitly
Previously it was mentioned only in the `file` and `ExternalProject`
documentation.
2021-05-04 12:29:13 -04:00
unknown
625ef88a92 CUDA: Add CMAKE_CUDA_HOST_COMPILER support on Windows non-VS generators 2021-04-22 11:40:46 -04:00
Albrecht Schlosser
388c347a4b Help: Fix typo in CMAKE_TOOLCHAIN_FILE docs 2021-04-18 07:52:59 +10:00
Brad King
bb290fc7a4 Merge topic 'add_toolchain_cmake_option'
d5c3e4ac32 cmake: add support for --toolchain command argument
13838bbb36 CMAKE_TOOLCHAIN_FILE: Document relative path behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5991
2021-04-16 11:39:28 -04:00
Robert Maynard
13838bbb36 CMAKE_TOOLCHAIN_FILE: Document relative path behavior 2021-04-15 10:12:34 -04:00
Brad King
6968500352 Merge topic 'ios-rpath-linker-flag'
4aed96e230 Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG on non-macOS too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5980
2021-04-07 10:06:56 -04:00
Brad King
71e887d678 Merge topic 'add_q_namespace_export_docs'
3538f1c69b Help: Add Q_NAMESPACE_EXPORT to CMAKE_AUTOMOC_MACRO_NAMES default values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5982
2021-04-06 08:27:15 -04:00
Craig Scott
4aed96e230 Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG on non-macOS too
Since CMake 3.19, we no longer support macOS SDKs older than 10.5,
which corresponds to Xcode 3. Supporting older Xcode versions for
device platforms is also not realistic. We therefore expect the -rpath
linker option should always be supported now.

When targeting iOS, tvOS or watchOS, the previous disabling of -rpath
support meant that the install_name_dir of shared libraries and
frameworks was unable to use @rpath. This resulted in embedding
absolute paths for their install_name. When they were embedded in an
app bundle, this would cause the app to fail at runtime. By enabling the
-rpath linker option, the default install_name_dir is now @rpath for these platforms, which results in binaries that do work at runtime.

Fixes: #20036
2021-04-06 11:46:56 +10:00
Alexander Neumann
3538f1c69b Help: Add Q_NAMESPACE_EXPORT to CMAKE_AUTOMOC_MACRO_NAMES default values
This was accidentally left out of commit 426941c433 (Autogen: Recognize
the new Q_NAMESPACE_EXPORT macro in AUTOMOC, 2020-02-26,
v3.17.0-rc2~3^2).
2021-04-05 11:25:19 -04:00
Brad King
0fee2adf8c Merge topic 'fujitsu-compiler-4.0-support'
8ef55dec29 Help: Add release notes for Fujitsu compiler support
4c74c86f40 FindBLAS/LAPACK: Add support for the Fujitsu SSL2 library
376c300b25 FindOpenMP: Add support for Fujitsu compilers
9e0a1cf03e FindMPI: Add support for the Fujitsu compiler wrappers
a237450948 Tests: Update for the FujitsuClang compiler
27579e9cf1 FujitsuClang: Add support for the Fujitsu compiler in Clang mode
a55feff69c Tests: Update for the Fujitsu compiler
3c867cff4a Fujitsu: Add support for the Fujitsu compiler in Trad mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Acked-by: Gilles Gouaillardet <gilles@rist.or.jp>
Merge-request: !5954
2021-04-01 10:26:54 -04:00
Brad King
78ff963f74 Merge topic 'doc-CMAKE_APPLE_SILICON_PROCESSOR' into release-3.20
3f04f69733 Help: CMAKE_APPLE_SILICON_PROCESSOR cannot be set in a toolchain file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5965
2021-04-01 10:23:13 -04:00
Brad King
f4a778c2eb Merge topic 'doc-CMAKE_APPLE_SILICON_PROCESSOR'
3f04f69733 Help: CMAKE_APPLE_SILICON_PROCESSOR cannot be set in a toolchain file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5965
2021-04-01 10:23:13 -04:00
Brad King
3f04f69733 Help: CMAKE_APPLE_SILICON_PROCESSOR cannot be set in a toolchain file
`CMakeDetermineSystem` determines the host system information before
loading the toolchain file.

Issue: #22012
2021-04-01 10:04:05 -04:00
Chuck Atkins
27579e9cf1 FujitsuClang: Add support for the Fujitsu compiler in Clang mode
This should be front end compatible with vanilla clang but giving it a
unique identifier allows a project to pass additional options unique to
Fujitsu and outside the scope of a CMake builtin.
2021-03-31 09:14:45 -04:00
Chuck Atkins
3c867cff4a Fujitsu: Add support for the Fujitsu compiler in Trad mode
Co-Author: Yuichiro Utsumi <utsumi.yuichiro@jp.fujitsu.com>
2021-03-30 10:32:53 -04:00
friendlyanon
96a7040107 project: Define variables indicating whether project is top level
Define `PROJECT_IS_TOP_LEVEL` and `<PROJECT-NAME>_IS_TOP_LEVEL`.  The
latter is a STATIC cache entry just like other `<PROJECT-NAME>_*`
variables so that it is globally scoped.

Issue: #20310
Fixes: #21961
2021-03-26 09:35:34 -04:00
Brad King
0310097377 Merge topic 'vs-custom-flag-table'
608ef8a6fc VS: Add a mostly-undocumented hook to load custom JSON flag tables
8dd8d63665 Tests: Add RunCMake hook to describe test variants

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5895
2021-03-23 11:20:18 -04:00