1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00
Commit Graph

5234 Commits

Author SHA1 Message Date
Craig Scott
445c73d3fa Merge topic 'cpack-install-opts'
26e36111d3 CPack: Implement new variable CPACK_CUSTOM_INSTALL_VARIABLES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6141
2021-05-26 18:53:40 -04:00
Brad King
c564a3e3ff Ninja: Always compile sources using absolute paths
The Ninja generator traditionally referenced source files and include
directories using paths relative to the build directory if they could be
expressed without a `../` sequence that leaves the build and source
directories.  For example, when using a `build/` directory inside the
source tree, sources would be compiled as `-c ../src.c` and include
directories would be referenced as `-I ../include`.  This approach
matches the traditional Ninja convention of using relative paths
whenever possible, but has undesirable side effects such as:

* Compiler diagnostic messages may not use absolute paths, making it
  harder for IDEs/editors to find the referenced sources or headers.

* Debug symbols may not use absolute paths, making it harder for
  debuggers to find the referenced sources or headers.

* Different results depending on the path to the build tree relative
  to the source tree.

* Inconsistent with the Makefile generators, which use absolute paths.

Switch to always using absolute paths to reference source files and
include directories on compiler command lines.  While alternative
solutions for diagnostic messages and debug symbols may exist with
specific tooling, this is the simplest and most consistent approach.

Note that a previous attempt to do this in commit 955c2a630a (Ninja: Use
full path for all source files, 2016-08-05, v3.7.0-rc1~275^2) was
reverted by commit 666ad1df2d (Revert "Ninja: Use full path for all
source files", 2017-02-24, v3.8.0-rc2~9^2) due to problems hooking up
depfile dependencies on generated files.  This time, the changes in
commit 2725ecff38 (Ninja: Handle depfiles with absolute paths to
generated files, 2021-05-19) should avoid those problems.

Fixes: #13894, #17450
2021-05-25 10:48:26 -04:00
Brad King
52b0795d1a Merge topic 'FindVulkan-add-Headers-glslangValidator-targets'
668ba68a7a FindVulkan: add Vulkan::Headers and Vulkan::glslangValidator targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6154
2021-05-25 10:04:52 -04:00
Brad King
bf2717e436 Merge topic 'set-cache-keep-normal-variable'
d96eb55282 set(CACHE): do not remove normal variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6146
2021-05-25 10:03:03 -04:00
PCJohn
668ba68a7a FindVulkan: add Vulkan::Headers and Vulkan::glslangValidator targets
The `Vulkan::Headers` target complements existing Vulkan::Vulkan target.
It is the same except it omits the Vulkan library which supports
applications that loads the Vulkan library in at runtime.

The `Vulkan::glslangValidator` target provides the glslangValidator
executable which is the tool for converting between shader languages
(GLSL, SPIR-V, etc.).
2021-05-24 12:53:15 -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
Brad King
96995d38cd Merge topic 'message-color'
0a0a0f8a74 cmMessenger: Color messages to terminal by type
bceb8e2ed2 cmMessenger: Pass title inside a metadata structure

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6105
2021-05-21 10:38:50 -04:00
Marc Chevrier
d96eb55282 set(CACHE): do not remove normal variable
Fixes: #22038
2021-05-20 17:50:13 +02:00
Marius Messerschmidt
0a0a0f8a74 cmMessenger: Color messages to terminal by type
Fixes: #16183
2021-05-20 07:38:45 -04:00
Nils Gladitz
99ff75455e install: Implement new install(CODE|SCRIPT) option ALL_COMPONENTS
In a per-component installation the generated installation scripts
are invoked once for each component.

Per default custom installation script code added by install(CODE|SCRIPT)
only runs for one specific component in this context.

The new ALL_COMPONENTS option allows custom script code to be run once
for each component being installed.
2021-05-19 19:17:58 +02:00
Brad King
62b0eba266 Merge topic 'doc-link-compile-options'
2eba7d7524 Help: Add SHELL, LINKER and host/device discussions to property docs
b20c1f4880 Help: Make SHELL option examples more generic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6130
2021-05-18 09:30:44 -04:00
Craig Scott
2eba7d7524 Help: Add SHELL, LINKER and host/device discussions to property docs
Section headings are also added for each common block to help guide
the reader and improve navigation.

Fixes: #21640
2021-05-15 16:31:16 +10:00
Craig Scott
b20c1f4880 Help: Make SHELL option examples more generic
Comments at the bottom of the docs for add_compile_options() and
target_compile_options() recommend using other commands if setting
compiler definitions. Change the examples we use for the SHELL:
functionality to use -option instead of -D so that we don't violate our
own recommendations. This also makes the examples more
appropriate for use with link options as well.

Tweak the wording to not specify the type of option being discussed.
This will already be clear from the page the text is included into and
it avoids naming unrelated option types for the given page.
2021-05-15 16:30:46 +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
bd12b97d05 cmScanDepFormat: Drop unused "outputs", "inputs", and "depends" fields
These fields are specified by our `P1689r3` paper, but are not actually
needed.  The dependencies of the scanning results themselves can be
captured via normal depfile logic.  Avoid saving this possibly-large
information in the scanning results.  It is not needed by later steps.
2021-05-13 08:33:00 -04:00
Brad King
96011ab06d Merge topic 'find_item-consistent-behavior-cache-variables'
08db1341a6 find_*: ensure consistent behavior for cache variables
f5fa6d53b0 class cmake: Store working directory at cmake launch
b1729200c3 find_*: refactor cache variable handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6110
2021-05-13 08:12:36 -04:00
Brad King
f89c1a559d UseJava: Avoid non-word "compilability" in documentation
Also fix spelling in the release note from commit 3e03f359a7 (UseJava:
Add RESOURCES with NAMESPACE to add_jar(), 2021-04-27).
2021-05-12 07:35:16 -04:00
Marc Chevrier
08db1341a6 find_*: ensure consistent behavior for cache variables
Fixes: #22121
2021-05-12 11:11:56 +02: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
Brad King
9b2b91abe7 Merge topic 'UseJava-add_jar-resource-namespace'
3e03f359a7 UseJava: Add RESOURCES with NAMESPACE to add_jar()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Smit-tay <damnedyankee@gmail.com>
Merge-request: !6071
2021-05-11 09:24:20 -04:00
Brad King
d0b6eb8ec7 Merge topic 'capabilties-generator-platforms'
66be34853c cmake: add supported platforms to cmake -E capabilties report

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6102
2021-05-11 09:22:47 -04:00
Michael Hirsch
140fe8c3c6 Help: Document CTEST_SCRIPT_DIRECTORY variable 2021-05-10 10:55:59 -04:00
Smit tay
3e03f359a7 UseJava: Add RESOURCES with NAMESPACE to add_jar()
add_jar() currently requires (undocumented) that resources be supplied
as relative paths.  The resources *may* then end up in a path which does
not reflect the original path particularly when performing out-of-source
builds.  This change adds a RESOURCE (and NAMESPACE) parameter and a
function to add the names resources into the named namespace within the
jar- and thus address both of these problems.

Fixes: #22101
2021-05-10 10:48:46 -04:00
scheffle
66be34853c cmake: add supported platforms to cmake -E capabilties report 2021-05-10 10:28:28 -04:00
Josef Angstenberger
7072d83772 Help: Fix typos and spelling in documentation 2021-05-07 17:00:17 +02:00
Brad King
e0b4a22ca6 Merge topic 'nmake-utf8'
f3f57cc4ed NMake: Use UTF-8 with BOM if supported by nmake
186c9bff53 NMake: Check nmake version for support of UTF-8
8a4f536be6 NMake: Detect nmake version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6041
2021-05-06 10:13:11 -04:00
Amine Najahi
f3f57cc4ed NMake: Use UTF-8 with BOM if supported by nmake
Fixes: #21792
2021-05-05 10:56:49 -04:00
Brad King
41f9486e61 Merge topic 'generate-cmake-build-command-parallel'
d2b856bc92 ctest_build: Add the PARALLEL_LEVEL argument
fc2ac46043 build_command: Add the PARALLEL_LEVEL argument
4dd4e9dd6c cmGlobalGenerator: Add parallel parameter to GenerateCMakeBuildCommand

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !6069
2021-05-05 10:11:46 -04:00
Brad King
7973f97828 Merge topic 'doc-tls'
7398993f5b Help: Document CMAKE_TLS_VERIFY variable explicitly

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6064
2021-05-05 10:08:45 -04:00
friendlyanon
d2b856bc92 ctest_build: Add the PARALLEL_LEVEL argument
Fixes: #19712
2021-05-04 20:30:18 +02:00
friendlyanon
fc2ac46043 build_command: Add the PARALLEL_LEVEL argument
Issue: #19712
2021-05-04 20:17:17 +02:00
Brad King
d4529b7e6e Merge topic 'doc-review'
b82052feb8 Help/dev/review: Clarify instructions to update existing merge requests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6073
2021-05-04 12:31:57 -04: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
Brad King
09f2f5df89 Merge topic 'extend_toolchain_flag_to_cmake_preset'
a9b968bb98 cmake-presets: Introduce `toolchainFile` preset option

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6045
2021-05-04 11:54:49 -04:00
Brad King
d31b6657a6 Merge topic 'doc-preset-schema-relative'
75dadc4558 Help: Use relative path for IDE Integration guide link to preset schema

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !6083
2021-05-04 11:15:21 -04:00
Brad King
75dadc4558 Help: Use relative path for IDE Integration guide link to preset schema
This allows the integration guide to build as part of a larger set of
documentation.
2021-05-03 15:36:45 -04:00
Smit tay
b82052feb8 Help/dev/review: Clarify instructions to update existing merge requests 2021-05-03 12:15:27 -04:00
Brad King
4df3f5300a Merge topic 'foreach-loop-variable'
46896d98bb foreach(): loop variables are only available in the loop scope

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Merge-request: !6044
2021-05-03 09:59:35 -04:00
Brad King
9edff7f43e Merge topic 'remove_bad_install_dir_schema_docs'
306db0fdb8 cmake-presets: Remove incorrect documentation for `installDir`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6051
2021-04-29 09:23:24 -04:00
Brad King
d94f8516ab Merge topic 'find-msys'
990b370401 FindMsys: Add a module to find MSYS and some bundled packages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6057
2021-04-29 09:22:27 -04:00
Brad King
3147f541f7 Merge topic 'intel-2021'
9c479c7c40 IntelLLVM: Add special case for ifx 2021.1 version extraction
b7193ab18f Intel: Update Classic compiler version detection for 2021

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6052
2021-04-29 09:15:32 -04:00
Robert Maynard
a9b968bb98 cmake-presets: Introduce toolchainFile preset option
In v3 of the presets, the `--toolchain` command line argument now
has a preset mapping.
2021-04-28 17:22:25 -04:00
Marc Chevrier
46896d98bb foreach(): loop variables are only available in the loop scope
Fixes: #20553
2021-04-28 19:44:25 +02:00
Orgad Shaneh
990b370401 FindMsys: Add a module to find MSYS and some bundled packages 2021-04-28 10:41:17 -04:00
Brad King
9c479c7c40 IntelLLVM: Add special case for ifx 2021.1 version extraction
The ifx beta versions forgot to define `__INTEL_LLVM_COMPILER`, and
instead define `__INTEL_COMPILER == 201900`.  Add a special case.

Issue: #22120
2021-04-28 10:21:27 -04:00
Brad King
b7193ab18f Intel: Update Classic compiler version detection for 2021
The value of the `__INTEL_COMPILER` macro changed convention starting
in version 2021.

Fixes: #22120
2021-04-28 10:20:59 -04:00
Brad King
49c6d0f261 Merge topic 'ctest_test_measurements_docs'
b60789a758 Help: Document CTest custom test measurements
63b5ddcce2 Tests: Add cases for CTest extra measurements from tests
52eac4573d Help: Fix link to cdash.org from CTest manual

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Zack Galbreath <zack.galbreath@kitware.com>
Merge-request: !6029
2021-04-28 09:53:04 -04:00
Brad King
11530e5504 Merge topic 'ARMClang-cpu-arch-flags'
c4941b7e66 ARMClang: Do not automatically add cpu/arch compile or link options
0078db3888 ARMClang: Separate cpu/arch flags from preceding flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jaeden Amero <kitware@patater.com>
Merge-request: !6035
2021-04-28 09:49:41 -04:00
Craig Scott
9f2c3928cd Help: Convert CMAKE_LINK_DEPENDS_NO_SHARED to cross-reference link 2021-04-28 09:26:31 +10:00
Zack Galbreath
b60789a758 Help: Document CTest custom test measurements 2021-04-27 15:00:26 -04:00