Commit Graph

8325 Commits

Author SHA1 Message Date
Marc Chevrier de7f0aa6c0 UseSWIG: avoid spurious policy warnings 2021-02-11 17:17:10 +01:00
Brad King 58ea0d1255 Add deprecation warnings for policies CMP0081 and below
The OLD behaviors of all policies are deprecated, but only by
documentation.  Add an explicit deprecation diagnostic for policies
introduced in CMake 3.13 and below to encourage projects to port
away from setting policies to OLD.
2021-02-10 09:25:32 -05:00
Brad King bb68658e98 Merge topic 'findcudatoolkit_handle_cuda_compiler_without_enabled_lang'
cd89d1c328 FindCUDAToolkit: Robust version checks when CUDA lang is not enabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Tested-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5787
2021-02-10 07:48:50 -05:00
Robert Maynard cd89d1c328 FindCUDAToolkit: Robust version checks when CUDA lang is not enabled
Previously if you set `CMAKE_CUDA_COMPILER` but hadn't enabled
the CUDA language, FindCUDAToolkit would not correctly compute
the version information.
2021-02-09 09:39:20 -05:00
Brad King cab99f7dba Merge topic 'xcode12-ios_install_combined'
0110aa018d IOS_INSTALL_COMBINED: Support Xcode 12 (command line only)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5785
2021-02-09 08:23:30 -05:00
Brad King 40f4147224 Merge topic 'object-lib-multiarch'
4d46b1401f add_library(): Allow imported object libraries with multi-arch
1a915e8953 Tests: TargetObjects does not need any languages enabled

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5771
2021-02-09 08:22:06 -05:00
Brad King 18fa819e26 Merge topic '21479-branding-name-cpack-nsis'
0aabeb0c30 CPack/NSIS: Add option for setting branding text

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5784
2021-02-09 08:20:17 -05:00
Brad King 326cceaafc Merge topic 'cmake_library_architecture_better_multiarch_support'
657fc3a9a7 CMakeDetermineCompilerABI: Parse library arch from versioned paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5773
2021-02-08 12:05:07 -05:00
Craig Scott 0110aa018d IOS_INSTALL_COMBINED: Support Xcode 12 (command line only)
Xcode 12 doesn't allow nested builds within the same build directory.
That means we can no longer do an install by building the install target
when IOS_INSTALL_COMBINED is true. We can, however, still do an install
by running the cmake_install.cmake script or executing cmake --install,
since there is no outer build and therefore the associated SDK can be
built as a sub-build.

The non-build methods previously didn't work when
IOS_INSTALL_COMBINED was true because the generated install script
and the CMakeIOSInstallCombined script both made certain assumptions
that relied on being part of a build. Those assumptions are now
removed. A side-effect of this work is that cpack now also works from the
command line when IOS_INSTALL_COMBINED is true.

Relates: #21282
Fixes: #20023
2021-02-08 18:02:46 +11:00
Johnny Jazeix 0aabeb0c30 CPack/NSIS: Add option for setting branding text
See https://nsis.sourceforge.io/Reference/BrandingText
for more information.

Fixes: #21479
2021-02-07 16:10:57 +01:00
Craig Scott 4d46b1401f add_library(): Allow imported object libraries with multi-arch
Fixes: #21276
2021-02-06 11:34:28 +11:00
Craig Scott 1a915e8953 Tests: TargetObjects does not need any languages enabled 2021-02-05 23:22:56 +11:00
Brad King acb33d0904 Merge topic 'fetchcontent-performance'
17e5516e60 FetchContent: Invoke steps directly and avoid a separate sub-build
4f3d1abbb4 ExternalProject: Refactor pre-configure steps to support no-target uses
23aab9ecce ExternalProject: Avoid scanning docs for keywords, use include_guard()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Acked-by: Michael Hirsch, Ph.D. <michael@scivision.dev>
Acked-by: Lars Melchior <lars.melchior@gmail.com>
Merge-request: !5749
2021-02-05 07:01:05 -05:00
Brad King 2c2eb777f4 Merge topic 'build-test-presets'
9b5289ebd8 Help: Add release note for build and test presets
c8a5cd6871 Tests: Update RunCMake/CMakePresets --list-presets
69a5cf23a2 Tests: Update RunCMake/CommandLine BuildDir
b500935b94 Tests: Add test preset tests
74a86566f0 Tests: Add build preset tests
56751c83aa Tests: Factor out RunCMake.CMakePresets schema validation
676ecf0d37 cmake-presets: Add build and test presets
4f4f2028b8 Help: Add documentation for buildPresets and testPresets
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5681
2021-02-05 06:57:28 -05:00
Craig Scott 17e5516e60 FetchContent: Invoke steps directly and avoid a separate sub-build
The cost of setting up and executing a separate sub-build to do the
download, update and patch steps required for FetchContent population
can be significant with some platforms and CMake generators. Avoid the
sub-build altogether by invoking the step scripts directly.

Previously, if no generator was set (e.g. population was being done in
script mode), a generator needed to be available on the default PATH.
Since we no longer use a sub-build, this restriction is also now gone.

Fixes: #21703
2021-02-05 07:33:38 +11:00
Craig Scott 4f3d1abbb4 ExternalProject: Refactor pre-configure steps to support no-target uses
The mkdir, download, update and patch steps are used by
FetchContent during the configure phase of the main build. Because
these steps need a target, this has so far required a sub-build to be
set up. The changes here factor out the preparation of the scripts
from the creation of the targets, allowing future work to leverage these
steps without a sub-build (see #21703).

As part of the refactoring, some rationalisation of the stamp files,
repository info files and script names was done to make things more
consistent between download methods and step implementations.
Every download method now records its own specific repository info
in a file and that file is a dependency of the download step. The source
directory is also written to that file, so if the SOURCE_DIR changes, the
download will be retriggered (the existing implementation fails in this
scenario). Each download method now also has just one driver script
that implements the whole step (it may pull in other scripts to do its
task though). The patch step gained support for USES_TERMINAL as
a result of generalising the implementation for custom commands.

Fixes: #21748
2021-02-05 07:33:38 +11:00
Robert Maynard 657fc3a9a7 CMakeDetermineCompilerABI: Parse library arch from versioned paths
Teach CMake how to extract `CMAKE_<LANG>_LIBRARY_ARCHITECTURE` from
versioned paths such as `/usr/lib/gcc/x86_64-linux-gnu/9`. These kind of
paths are generated by NVHPC compilers.
2021-02-04 15:17:49 -05:00
Sam Freed c8a5cd6871 Tests: Update RunCMake/CMakePresets --list-presets 2021-02-04 11:39:55 -05:00
Sam Freed 69a5cf23a2 Tests: Update RunCMake/CommandLine BuildDir 2021-02-04 11:39:55 -05:00
Sam Freed b500935b94 Tests: Add test preset tests 2021-02-04 11:39:52 -05:00
Sam Freed 74a86566f0 Tests: Add build preset tests 2021-02-04 11:39:19 -05:00
Sam Freed 56751c83aa Tests: Factor out RunCMake.CMakePresets schema validation
Make it available to similar tests.  Also fix whitespace
in generated error message.
2021-02-04 11:00:42 -05:00
Brad King 67cb006732 Merge topic 'aix-xcoff-edit'
e017ba046c AIX: Enable XCOFF editing to replace RPATH on installation
56fc4a325f cmXCOFF: Add helper to parse and edit the XCOFF binary format
ddaaee907d CMakeDetermineCompilerId: Recognize XCOFF executable format
69e1d95a8a Tests: Add sample XCOFF binaries
f79d991dfd Tests: Convert CMake.ELF to RunCMake.file-RPATH ELF case
d8f3e68ca9 Ninja Multi-Config: Enable relink diagnostic message
cdcfe3eb99 Rename CMAKE_USE_MACH_PARSER to CMake_USE_MACH_PARSER
b6071c93f5 Rename CMAKE_USE_ELF_PARSER to CMake_USE_ELF_PARSER

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5769
2021-02-04 08:29:57 -05:00
Brad King 4cd23c5e0d Merge topic 'issue-17634'
5af38a11ce try_run: Allow to set working directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5757
2021-02-04 08:22:19 -05:00
Brad King e017ba046c AIX: Enable XCOFF editing to replace RPATH on installation
Avoid relinking before installation.
2021-02-03 12:26:58 -05:00
Brad King 69e1d95a8a Tests: Add sample XCOFF binaries
Generate the binaries as follows:

    $ cat main.c
    int main(void) { return 0; }
    $ xlc -q64 -o xcoff64.bin -Wl,-blibpath:/sample/rpath:/usr/lib:/lib main.c
    $ strip -X 64 xcoff64.bin
    $ xlc -q32 -o xcoff32.bin -Wl,-blibpath:/sample/rpath:/usr/lib:/lib main.c
    $ strip -X 32 xcoff32.bin
2021-02-03 12:26:23 -05:00
Brad King f79d991dfd Tests: Convert CMake.ELF to RunCMake.file-RPATH ELF case 2021-02-03 12:26:02 -05:00
Brad King a24679e9f3 Merge topic 'pch-reuse-from-obj-msvc'
c450d66daa PCH: Remove restrictions for REUSE_FROM signature for MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5765
2021-02-03 10:47:38 -05:00
Asit Dhal 5af38a11ce try_run: Allow to set working directory
Fixes: #17634
2021-02-03 08:42:05 +01:00
Brad King 375b307bae Apple: Fix linking to frameworks that do not exist until build time
Fixes: #21621
2021-02-03 10:08:48 +11:00
Cristian Adam c450d66daa PCH: Remove restrictions for REUSE_FROM signature for MSVC
Fixes: #20201
2021-02-02 15:03:55 -05:00
Brad King 8d379e7406 Revert "PCH: Remove restrictions for REUSE_FROM signature for MSVC"
This reverts commit 9f06097141.
It was merged accidentally.
2021-02-02 15:02:08 -05:00
Brad King 7cbaf6d87a Merge topic 'pch-reuse-from-obj-msvc'
9f06097141 PCH: Remove restrictions for REUSE_FROM signature for MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Rejected-by: Cristian Adam <cristian.adam@gmail.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !5728
2021-02-02 15:00:25 -05:00
Cristian Adam 9f06097141 PCH: Remove restrictions for REUSE_FROM signature for MSVC
Fixes: #20201
2021-02-02 19:11:44 +01:00
Cristian Adam 05f16ca7ee file(CONFIGURE): Use text mode for default OUTPUT content
This affects only Windows where \n will be translated as \r\n

Fixes: #21769
2021-02-02 15:18:48 +01:00
Brad King 8387aa20f2 Merge topic 'issue-19198'
255df8622b file(GENERATE): Support new line style

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !5649
2021-02-02 08:53:07 -05:00
Brad King 7b38688e22 Merge topic 'fix21727_for_FindOpenSSL'
bc00cf9300 FindOpenSSL: Add support for version-range

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5750
2021-02-02 08:49:44 -05:00
Brad King 932b45ceb9 Merge topic 'shlibdeps-fixup'
1aefa86c31 Tests: Accept line breaks in more places in dpkg-shlibdeps error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5751
2021-02-02 08:49:00 -05:00
Brad King 1b5f4a615b Merge topic 'tests-setgid'
8213390a3e Added `SETUID` and `SETGID` to the list of accepted file permissions
f41d0e0c77 Tests: Explicitly set permissions in CPack tests to avoid perimssions errors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5754
2021-02-02 08:47:55 -05:00
Brad King b8e3c821fe Merge topic 'bad-dns-no_proxy'
c0b1f5f30c Tests: Add host to ENV{no_proxy} when DNS lookup failure is expected

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5752
2021-02-02 08:47:01 -05:00
william.r.dieter 1aefa86c31 Tests: Accept line breaks in more places in dpkg-shlibdeps error message
The RunCPackVerifyResult-shlibdeps-with-private-lib-failure test failed
intermittently due to sometimes breaking lines in its output in different
places.  This change accepts line breaks in more places in the command
output.

Signed-off-by: william.r.dieter <william.r.dieter@intel.com>
2021-02-01 10:32:51 -05:00
Brad King a28bb8de23 Merge topic 'file-configure-newline'
6e225efd8c file(CONFIGURE): Fix newlines in CONTENT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5747
2021-02-01 10:06:27 -05:00
Deniz Bahadir bc00cf9300 FindOpenSSL: Add support for version-range 2021-02-01 12:27:05 +01:00
Asit Dhal 255df8622b file(GENERATE): Support new line style
Fixes: #19198
2021-02-01 01:38:19 +01:00
william.r.dieter f41d0e0c77 Tests: Explicitly set permissions in CPack tests to avoid perimssions errors
When the user has the setgid bit is set on the parent directory of
the build directory, the setgid bit will be propagated throughout the
build tree.  Most tests do not care about permissions as long as they
can read and write the files the need.  The CPack tests, however, validate
that permissions match an expected set, and fail with the setgid bit set.

Explicitly set permissions on directories created in the CPackTestHelpers
to clear the setgid bit.

Signed-off-by: william.r.dieter <william.r.dieter@intel.com>
2021-01-29 16:29:09 -05:00
william.r.dieter c0b1f5f30c Tests: Add host to ENV{no_proxy} when DNS lookup failure is expected
DNS lookup of an invalid host name fails with a different error in a proxy
environment than it does in an environment without proxy.  Many tools,
including curl, use the `no_proxy` environment variable to provid a list
of hosts for which proxy should not be used.

To make lookup failure consistent, add invalid host names to the
`no_proxy` environment variable in tests that attempt to look up invalid
host names.  This way the lookup will fail consistently regardless of
whether proxy is generally used or not.

Signed-off-by: william.r.dieter <william.r.dieter@intel.com>
2021-01-29 16:22:15 -05:00
Craig Scott 525363447f Merge topic 'cmake_path-stabilization'
76cea3dfe2 cmake_path: rename 'GET ... RELATIVE_PATH' to 'GET ... RELATIVE_PART'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5743
2021-01-29 08:57:33 -05:00
Cristian Adam 6e225efd8c file(CONFIGURE): Fix newlines in CONTENT
Fixes: #21749
2021-01-29 14:25:33 +01:00
Craig Scott 23aab9ecce ExternalProject: Avoid scanning docs for keywords, use include_guard()
The previous implementation was scanning the documentation in
the file at runtime to determine the set of supported keywords for
each public function. This was fragile, made it difficult to restructure
the documentation and was sometimes observable in runtime
performance measurements. Change to a more conventional
approach where supported keywords are explicitly listed in the
code.

The internal _ExternalProject_SELF variable is no longer needed.
CMake now provides CMAKE_CURRENT_FUNCTION_LIST_DIR which
can be used for the same purpose and avoids having to set a
variable when the module is read. This also removes the
requirement that the module must be included by the current or a
parent scope. It is now enough that the module has been included
once somewhere before calling any of its functions. 

The above changes combined mean that the module can now use
include_guard() and avoid having to re-parse the very long file every
time.
2021-01-30 00:12:23 +11:00
Brad King 36bb0e32d7 Merge topic 'externalproject-update-refactor'
ac6a4d4884 ExternalProject: Improve robustness of update step
17c4c8b92b Tests: Prevent the noisy CMP0114 warnings in ExternalProjectUpdate test
1cb65e680d ExternalProject: Prevent the noisy detached head messages on checkout

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5389
2021-01-29 08:10:21 -05:00