Commit Graph

2232 Commits

Author SHA1 Message Date
Robert Maynard
90dead024c CheckCompilerFlag: unified way to check compiler flags per language 2020-09-28 09:07:54 -04:00
Brad King
7b38161ca1 Merge topic 'check-source-modules'
357e2ef429 CheckSoureRuns: Add a unified way to check if a source runs
10ae907de0 CheckSoureCompiles: Add a unified way to check if a source compiles
f5c928f73c Add a test to verify '\' handling in CHECK_CXX_SOURCE_COMPILES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Hirsch, Ph.D. <michael@scivision.dev>
Merge-request: !5223
2020-09-24 15:12:59 -04:00
Craig Scott
ac5195c408 Merge topic 'find_package-version-range'
5b3356263c CMakePackageConfigHelpers: Add version range support
6bfc442fde FPHSA: add support of version range
d7df81067b find_package: Add support of version range
09095dbcd2 cmFindPackageCommand: Refactoring

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Hirsch, Ph.D. <michael@scivision.dev>
Merge-request: !5226
2020-09-24 07:29:03 -04:00
Robert Maynard
357e2ef429 CheckSoureRuns: Add a unified way to check if a source runs 2020-09-23 12:28:37 -04:00
Robert Maynard
10ae907de0 CheckSoureCompiles: Add a unified way to check if a source compiles 2020-09-23 12:28:37 -04:00
Brad King
d827fdb6f9 Merge topic 'separate_arguments-program'
d832c1cc7d separate_arguments: add option PROGRAM
f4c21d4953 separate_arguments: refactoring

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5253
2020-09-23 12:05:26 -04:00
Brad King
f2daa025e3 {get,set}_property: Add support for referencing binary directories
Index directories by their binary directory path in addition to their
source directory path.

Fixes: #19262
2020-09-23 09:25:42 -04:00
Marc Chevrier
5b3356263c CMakePackageConfigHelpers: Add version range support 2020-09-23 12:52:25 +02:00
Marc Chevier
6bfc442fde FPHSA: add support of version range 2020-09-23 12:52:25 +02:00
Marc Chevier
d7df81067b find_package: Add support of version range
This enhancement is the first step for solving issue #21107
2020-09-23 12:52:25 +02:00
Marc Chevrier
d832c1cc7d separate_arguments: add option PROGRAM
Fixes: #21217
2020-09-22 16:32:34 +02:00
Brad King
966c3263c2 Merge topic 'file-ARCHIVE-compression-level'
195d14e781 file(ARCHIVE_CREATE): Add option to control compression level

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !5242
2020-09-22 07:43:31 -04:00
Brad King
cedc0a0329 Merge topic 'findcudatoolkit_cross_scattered'
9d3f7872e1 FindCUDAToolkit: Support scattered installations when crosscompiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5247
2020-09-22 07:40:34 -04:00
Asit Dhal
195d14e781 file(ARCHIVE_CREATE): Add option to control compression level
Fixes: #21125
2020-09-21 13:08:11 -04:00
Brad King
64901e053b Merge topic 'xcode-12-new-build-system'
b8ecd4df5f ExternalProject: Use CMP0114 NEW behavior with Xcode "new build system"
fe258f6382 Tests: Skip RunCMake.XcodeProject device cases for Xcode "new build system"
1c3d2d0951 Tests: Skip Qt*Autogen.MocSkipSource case for Xcode "new build system"
542884e527 Tests: Update RunCMake.XcodeProject cases for Xcode "new build system"
832a78be2d Tests: Update BuildDepends test for Xcode "new build system"
ff76c51ec3 Tests: Update RunCMake.file case with workaround for Xcode "new build system"
1806cdd17c Tests: Avoid duplicate custom commands for Xcode "new build system"
8d5f4c4db9 Xcode: Switch to the "new build system" for Xcode 12 and above
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5229
2020-09-21 09:10:48 -04:00
Raul Tambre
9d3f7872e1 FindCUDAToolkit: Support scattered installations when crosscompiling
Previously when CMAKE_CROSSCOMPILING was ON we'd end up not setting the target
directory if the non-scattered one didn't exist.
Fix this by assuming a scattered installation if the target directory isn't set
after the crosscompiling logic.

This is the same fix as commit 2c0d5d01ee (CUDA: Support scattered
installations when crosscompiling with Clang, 2020-09-14).
2020-09-20 17:35:12 +03:00
Brad King
8d5f4c4db9 Xcode: Switch to the "new build system" for Xcode 12 and above
Provide an option to switch back to the original build system via
`-T buildsystem=1`.

Fixes: #18088
2020-09-18 13:02:14 -04:00
Brad King
bb8afa0020 Merge topic 'string-json-support'
8eab76eb84 string(JSON): Adds JSON parsing support to the string command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Acked-by: Michael Hirsch, Ph.D. <michael@scivision.dev>
Merge-request: !5159
2020-09-17 09:47:43 -04:00
Brad King
56c80c8c6d Merge topic 'system-includes-for-clang-on-windows'
bb61c2d024 Clang: use -imsvc for system include dirs when running on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Acked-by: Thomas Bernard <thomas@famillebernardgouriou.fr>
Merge-request: !5231
2020-09-17 09:44:55 -04:00
Brad King
f9fd0a0ea2 Merge branch 'release-3.18' into master 2020-09-16 13:59:11 -04:00
Peter Steneteg
8eab76eb84 string(JSON): Adds JSON parsing support to the string command
Adds a set of sub commands to the string command for parsing JSON, the
JSON commands are: GET, TYPE, MEMBER, LENGTH, REMOVE, SET, and EQUAL.

Closes: #19501
2020-09-16 13:55:24 -04:00
Andrew Fuller
bb61c2d024 Clang: use -imsvc for system include dirs when running on Windows
Fixes #17808
2020-09-16 10:06:46 -07:00
Brad King
b7590b8845 Merge topic 'ExternalProject-steps-refinement'
b4fc4da903 ExternalProject: Add policy CMP0114 to refine step target dependencies
f5791e24c6 Tests: Match RunCMake.ExternalProject NO_DEPENDS output more strictly
b637ef494c ExternalProject: Factor out an internal helper to add a step target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5215
2020-09-15 14:38:45 -04:00
Brad King
bdcde7762c Merge branch 'release-3.17' into master 2020-09-15 10:00:40 -04:00
Brad King
314039ba45 Help: Update 3.18.2 release notes to mention 3.16.9 and 3.17.5
A change made in 3.18.2 was backported to the 3.16 and 3.17 branches.
Update the 3.18 release note to mention them.
2020-09-15 09:27:56 -04:00
Brad King
42edc1a0b4 Merge branch 'release-3.17' into release-3.18 2020-09-15 09:27:00 -04:00
Brad King
58b37ae201 Merge branch 'release-3.16' into release-3.18 2020-09-15 09:26:48 -04:00
Brad King
d90645b788 Merge branch 'release-3.16' into master 2020-09-15 08:52:12 -04:00
Joerg Bornemann
205d5431d7 Help: Add 3.17.5 release note about AUTOMOC_PATH_PREFIX default change 2020-09-15 08:31:35 -04:00
Brad King
b9bcec40c1 Merge branch 'backport-3.16-automoc-path-prefix-off' 2020-09-15 08:29:12 -04:00
Joerg Bornemann
52217c3440 Help: Add 3.16.9 release note about AUTOMOC_PATH_PREFIX default change 2020-09-15 08:10:31 -04:00
Brad King
b4fc4da903 ExternalProject: Add policy CMP0114 to refine step target dependencies
`ExternalProject_Add_StepTargets` and `INDEPENDENT_STEP_TARGETS` have
some limitations and lack some sanity checks.  They can cause confusing
build systems to be generated.  The basic problems are:

* The notion of step independence is attached to the step target
  rather than the step itself.

* The custom commands implementing the steps are duplicated in the
  step targets and the primary targets.  This can cause races.
  It is also incompatible with the Xcode "new build system".

Fix this by introducing policy CMP0114 to change the way step target
dependencies are handled.  Define independence from external
dependencies as a property of each individual step regardless of whether
there is a target for it.  Add dependencies among the primary target and
the step targets such that each custom command only appears in one
target.  When some steps are disconnected from the primary target, add
step targets for the steps commonly depended upon so that there is a
place to hold their custom commands uniquely.

Fixes: #18663
2020-09-14 10:48:16 -04:00
Raul Tambre
2c0d5d01ee CUDA: Support scattered installations when crosscompiling with Clang
Previously when CMAKE_CROSSCOMPILING was ON we'd end up not setting the target
directory if the non-scattered one didn't exist.
Fix this by assuming a scattered installation if the target directory isn't set
after the crosscompiling logic.
2020-09-14 14:40:32 +03:00
Brad King
48ed3bae58 Merge topic 'pch-instantiate-templates'
8c8f03422e PCH: Template instantiation support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Tested-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5168
2020-09-10 16:32:39 -04:00
Brad King
487c711230 Merge topic 'custom-command-dedup'
45fedf0e17 Makefile: Add policy CMP0113 to avoid duplication of custom commands
844779bdc1 cmMakefileTargetGenerator: Simplify custom command output collection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5204
2020-09-10 10:12:30 -04:00
Brad King
45fedf0e17 Makefile: Add policy CMP0113 to avoid duplication of custom commands
Do not attach a custom command to a target if it is already attached to one of
the target's dependencies.  The command's output will be available by the time
the target needs it because the dependency containing the command will have
already been built.

This may break existing projects that do not properly mark non-created
outputs with the `SYMBOLIC` property.  Previously a chain of two custom
commands whose intermediate dependency is not created would put both
commands in a dependent project's Makefile even if the first command is
also in its dependency's Makefile.  The first command would run twice
but the build would work.  Now the second command needs an explicit
`SYMBOLIC` mark on its input to tell CMake that it is not expected to
exist.  To maintain compatibility with projects that left out the mark,
add a policy activating the behavior.
2020-09-08 15:38:40 -04:00
Marc Chevrier
be36266dab file(): Add REAL_PATH sub-command 2020-09-08 18:33:57 +02:00
Marc Chevrier
eb583b0a66 cmake_path command: path management
Fixes: #19568, #20922
2020-09-06 10:52:25 +02:00
Tobias Hieta
8c8f03422e PCH: Template instantiation support
Adds PCH_INSTANTIATE_TEMPLATES target property for enabling template
instantiation in precompiled headers.
Enabled by default. Currently only supported for Clang 11 and newer.

Implements #21133.
2020-09-02 08:30:55 +02:00
Brad King
8f73ff0c37 Merge topic 'target_genex_dependency'
f14b390198 GenEx: Remove unneeded dependencies from target info queries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5127
2020-09-01 09:59:08 -04:00
Craig Scott
3001e8b5d9 Merge topic 'xcode-link-phase-all'
525464ed2a Xcode: Use "Link Binary With Libraries" build phase in some cases
dc0898205c Xcode: Add special case for file type extension map for .xcassets
7b3d8411a2 Xcode: Refactor build setting append code and attribute getter naming

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5036
2020-09-01 09:38:05 -04:00
Robert Maynard
f14b390198 GenEx: Remove unneeded dependencies from target info queries
Only generate a graph dependency between a custom command and
a target when the custom command queries for the file path
of an artifact of the target.

This makes generator expressions such as `TARGET_FILE_DIR`
behave the same way as `TARGET_PROPERTY` which never generated
a graph dependency.
2020-09-01 09:25:19 -04:00
Brad King
2d723e66f1 Merge topic 'cuda_host_compiler_fail'
01428c5560 CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work during detection
9f81aa0f69 CUDA: Fail if compiler detection using the host compiler fails

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5155
2020-09-01 09:20:23 -04:00
Brad King
f7fbe40513 Merge topic 'file_chmod'
7de60beddf file: Add CHMOD and CHMOD_RECURSE subcommands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Marc Chevrier <marc.chevrier@gmail.com>
Merge-request: !5122
2020-09-01 09:19:18 -04:00
Brad King
f10682b796 Merge topic 'ispc_lang_support'
5ece12b7e4 gitlab-ci: add ISPC to the Fedora CI image
8976817d6d ISPC: Update help documentation to include ISPC
2368f46ba4 ISPC: Support building with the MSVC toolchain
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds
34cc6acc81 Add ISPC compiler support to CMake
419d70d490 Refactor some swift only logic to be re-used by other languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5065
2020-09-01 09:15:39 -04:00
Gusts Kaksis
525464ed2a Xcode: Use "Link Binary With Libraries" build phase in some cases
OBJECT and STATIC libraries (framework or non-framework) do not use
this build phase. Not all items to be linked use this build phase either.

Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2020-09-01 07:38:48 +10:00
Raul Tambre
01428c5560 CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work during detection
Also re-ordered the code to avoid testing flags for other compilers, since
we know the vendor before full detection.
2020-08-29 13:06:45 +03:00
Raul Tambre
9f81aa0f69 CUDA: Fail if compiler detection using the host compiler fails
If an user specified a host compiler we should fail if we are unable to perform
compiler detection with it.
Previously we would try without and likely succeed and continue. Then we'd fail
during ABI detection and compiler testing since we'd still try to use it.

This is particularly problematic when crosscompiling since we extract the host
linker from the compiler detection link line. This would result in the wrong
host linker being used and a linking error due to architecture mismatch during
ABI detection where other necessary flags may already be present to make the
host compiler work. See #21076 for an example.

Fix this by adding CMAKE_<LANG>_COMPILER_ID_REQUIRE_SUCCESS to
CMakeDetermineCompilerId, which throws a fatal error if executing the compiler
results in a non-zero exit code.

Fixes #21120.
2020-08-29 13:06:44 +03:00
Robert Maynard
8976817d6d ISPC: Update help documentation to include ISPC 2020-08-28 11:21:31 -04:00
Sibi Siddharthan
7de60beddf file: Add CHMOD and CHMOD_RECURSE subcommands
Fixes: #21057

Signed-off-by: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
2020-08-26 21:22:50 +05:30