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

2095 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
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
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
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
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
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
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
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
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
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
Lingkai Dong
c4941b7e66 ARMClang: Do not automatically add cpu/arch compile or link options
The compile options `--march=<arch>` and `--mcpu=<cpu>` and the
link option `--cpu=<cpu>` are automatically added by CMake based
on `CMAKE_SYSTEM_PROCESSOR` or `CMAKE_SYSTEM_ARCH`. But this is not
sufficient, because armclang also supports enabling or disabling
features using `+<feature>`:

    -mcpu=<name>[+[no]<feature>+...]

For example:

    -mcpu=cortex-a57+nocrypto+nofp+nosimd+crc

(Reference: https://developer.arm.com/documentation/dui0774/k/Compiler-Command-line-Options/-mcpu?lang=en)

The problem is, even if a project adds a flag with features it needs,
CMake still adds flags, resulting in code that is compiled with wrong
CPU features and unable to run.

Add policy `CMP0123` to not automatically add compile or link options,
and let projects set them instead.

Co-Author: Brad King <brad.king@kitware.com>
Fixes: #21173
2021-04-27 14:03:15 -04:00
Brad King
970f175d88 Merge topic 'ctest_junit'
25bf514447 ctest: Add support for writing test results in JUnit XML format

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Zack Galbreath <zack.galbreath@kitware.com>
Acked-by: Michael Hirsch <michael@scivision.dev>
Acked-by: MvdHurk <maikelvandenhurk@hotmail.com>
Acked-by: Alexander Richardson <arichardson.kde@gmail.com>
Merge-request: !6020
2021-04-27 13:53:55 -04:00
Brad King
231df230d5 Help: Add release note for MSYS runtime support 2021-04-26 14:27:34 -04:00
Brad King
9d4a0f12fb Merge topic 'SWIG'
e3e005dbd8 UseSWIG: use swig dependencies for Xcode generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6042
2021-04-26 11:35:22 -04:00
Brad King
395e1d458e Merge topic 'xcode_app_extensions'
eb5e33ba47 Xcode: Add support for embedding app extensions
f62a2bf44f Tests: Factor out XcodeProject-Embed check function findAttribute()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5934
2021-04-26 11:34:38 -04:00
Brad King
3c1655936f Merge topic 'lzma-threads'
c5c130e675 cmArchiveWrite: Consolidate multiple ways to set thread count
5380d858ff liblzma: Enable multi threaded stream encoding support
e9065e96dc Merge branch 'upstream-liblzma' into lzma-threads
ee909a8e8b liblzma 2020-03-17 (2327a461)
741b85b42b liblzma: Revise update script to get version 5.2.5

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6014
2021-04-26 11:33:49 -04:00
Zack Galbreath
25bf514447 ctest: Add support for writing test results in JUnit XML format
Addresses #18654
2021-04-26 08:55:22 -04:00
Marc Chevrier
e3e005dbd8 UseSWIG: use swig dependencies for Xcode generator 2021-04-23 17:09:12 +02:00
Nils Gladitz
5380d858ff liblzma: Enable multi threaded stream encoding support 2021-04-22 15:40:06 -04:00
Alexander Akhundzhanov
eb5e33ba47 Xcode: Add support for embedding app extensions
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2021-04-22 15:17:02 +10:00
Marc Chevrier
e4b793c614 file(REAL_PATH): add option EXPAND_TILDE
This option enables the replacement of any leading tilde with the path
to the user's home directory.
2021-04-22 08:08:47 +10:00
Brad King
acace43852 Merge topic 'Xcode-add_custom_command-DEPFILE'
d67cc4882d Xcode: Add support of DEPFILE for add_custom_command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6006
2021-04-16 11:42:23 -04: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
Marc Chevrier
d67cc4882d Xcode: Add support of DEPFILE for add_custom_command
Issue: #20286
2021-04-15 12:17:31 -04:00
Robert Maynard
d5c3e4ac32 cmake: add support for --toolchain command argument 2021-04-15 10:13:49 -04:00
Marc Chevrier
0c47b91fcc Genex: add_custom_command: DEPFILE supports genex
This facility is very useful for 'Ninja Multi-Config' and required
as well for future support of DEPFILE in 'Xcode' and 'Visual Studio'
generators (#20286).
2021-04-12 13:06:49 +02:00
friendlyanon
06e6981336 cmake-presets: Make generator and binaryDir fields optional
In v3 of the presets, generator and buildDir can be omitted to fall
back to regular cmake behavior when these values are not explicitly
provided by the user.

Fixes: #21987
2021-04-07 01:24:44 +02: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
Chuck Atkins
8ef55dec29 Help: Add release notes for Fujitsu compiler support 2021-03-31 09:16:42 -04:00
Brad King
d9b8acd238 Merge topic 'ifw-depends-name-version-parsing'
a43783a08d CPackIFW: Fix parsing of name and version in component DEPENDS
f536e6f3fb CPackIFW: Remove redundant variable assignment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5929
2021-03-30 09:56:31 -04:00
Craig Scott
a43783a08d CPackIFW: Fix parsing of name and version in component DEPENDS
The DEPENDS or DEPENDENCIES arguments in a call to
cpack_ifw_configure_component() or cpack_ifw_configure_component_group()
specify a name and optionally a version constraint as a single string.
QtIFW also allows a colon (requires QtIFW 3.1 or later) or a hyphen to
separate the name and version. The version may optionally contain a
leading operator, with = being assumed when no operator is present.

The previous code was not handling : as a separator at all and was
erroneously dropping the version part when no operator was given.
Fix both of those non-conforming behaviors and also warn if trying
to use a hyphen in a name with a QtIFW version that isn't recent enough
to support it.

Fixes: #21697
2021-03-27 07:44:00 +11:00
Marc Chevrier
1d8e3a1e77 UseSWIG: Use standard library name conventions for csharp language
Fixes: #21542
2021-03-26 16:27:18 +01: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
928f4bda30 Merge topic 'cmake-presets-condition'
8bc5c8961e CMakePresets.json: Add the ability to conditionally disable presets
ce6ea7c927 Refactor: Move some common code into separate file
ebbd475e54 Refactor: Move cmCMakePresetsFile::ReadJSON into a separate file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5919
2021-03-23 10:33:59 -04:00