Commit Graph

3377 Commits

Author SHA1 Message Date
Brad King
abf9f25d6f Merge topic 'tests-for-xctest_add_bundle'
74eda8ab1f Tests: Add XCTest cases to cover output directory selection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5888
2021-03-16 10:52:28 -04:00
Kyle Edwards
0d497e159b CMakePresets.json: Add ${hostSystemName} macro 2021-03-15 14:41:42 -04:00
Yauheni Khnykin
74eda8ab1f Tests: Add XCTest cases to cover output directory selection
Fixes: #21800
2021-03-13 00:54:25 +01:00
Brad King
9a80ce6d24 Merge topic 'add_prefix_cmake_option'
400536c317 cmCommandLineArgument: trim leading empty spaces
b227a9565e cmake: configure preset add support for --install-prefix mapping
38140713ad cmake: add support for --install-prefix command argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5843
2021-03-11 08:16:03 -05:00
Brad King
0d7389c04e Merge topic 'cpack-source-dir-symlink-test'
f42b048b9c Tests: Check symlinks to directories in RunCMake.CPackSymlinks

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5887
2021-03-11 08:14:19 -05:00
Brad King
00eb4df37e Merge topic 'file-COPY_FILE-subcommand'
088444211e file: add `COPY_FILE` subcommand
100016e9cb cmSystemTools: add utilities to copy a file with error handling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5885
2021-03-11 08:13:29 -05:00
Olivier Iffrig
f42b048b9c Tests: Check symlinks to directories in RunCMake.CPackSymlinks
Regression test for issue #21886
2021-03-10 17:39:55 +00:00
Brad King
03193a9e9a Merge topic 'ep-fc-revert-refactoring'
57d442e182 Revert ExternalProject and FetchContent refactoring

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5898
2021-03-10 11:37:15 -05:00
Ben Boeckel
088444211e file: add COPY_FILE subcommand
The `file(COPY)` subcommand is overloaded and busy for such a simple
operation. Instead, make a simpler subcommand with error handling
support.
2021-03-10 10:43:18 -05:00
Craig Scott
57d442e182 Revert ExternalProject and FetchContent refactoring
Refactoring of the ExternalProject and FetchContent modules moved
the commands into CMake scripts. This broke custom commands that
used shell redirection or special build tool variables of the form
$(MakeVar). Undo the sequence of commits that performed this
refactoring and follow-up fixes associated with it.

The following commits are reverted by this change:

4f3d1abbb4 (ExternalProject: Refactor pre-configure steps to support
no-target uses, 2021-02-05)

17e5516e60 (FetchContent: Invoke steps directly and avoid a separate
sub-build, 2021-01-29)

bd876f3849 (FetchContent: Restore patch command support,
2021-02-18)

404cddb7bb (ExternalProject: Fix misuse of IS_NEWER_THAN in
timestamp checks, 2021-02-21)

b0da671243 (FetchContent: Don't update timestamps if files don't
change, 2021-02-18)

Fixes: #21892
2021-03-10 09:07:44 +11:00
Robert Maynard
b227a9565e cmake: configure preset add support for --install-prefix mapping 2021-03-09 13:53:16 -05:00
Brad King
e8065554a8 Tests: Teach RunCMake to always print the command on failure
Previously we only printed explicit `RunCMake_TEST_COMMAND` cases on
failure.  Refactor the RunCMake infrastructure so that we always define
`RunCMake_TEST_COMMAND` internally, and print it on failure.
2021-03-09 07:43:29 -05:00
Brad King
5f03744e36 Tests: Move RunCMake option construction closer to use 2021-03-09 07:35:18 -05:00
Brad King
f4d154755a Tests: Reverse RunCMake code path order 2021-03-09 07:35:18 -05:00
Brad King
6fd7e8c53f Tests: Make RunCMake.Generator{Platform,Toolset} two-flag cases explicit
Do not rely on the RunCMake infrastructure to pass `-T` or `-A`.
2021-03-09 07:35:18 -05:00
Robert Maynard
38140713ad cmake: add support for --install-prefix command argument
Fixes: #21781
2021-03-04 10:50:24 -05:00
Brad King
9bf40d8027 file(RENAME): Add option to not replace existing path
Add a `NO_REPLACE` option that prevents overwriting `<newname>`
if it exists.
2021-03-04 08:49:48 -05:00
Brad King
c61292726c file(RENAME): Add option to capture error message on failure 2021-03-04 08:44:06 -05:00
Brad King
adc351db8f Tests: Add RunCMake helper to run a plain script
Many tests covering CMake scripting commands can work without
initializing a full generator.
2021-03-03 16:41:30 -05:00
Brad King
957a117c70 Merge topic 'android-r22'
005e2cdfb0 Android: Do not use gold for ndk >= r22
ed7a87f270 Tests: Update RunCMake.Android for NDK r22
4950d35733 Help: Document CMAKE_ANDROID_NDK_VERSION variable
746906242d Android: Detect NDK version number

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5862
2021-03-03 11:11:58 -05:00
Brad King
ed7a87f270 Tests: Update RunCMake.Android for NDK r22
Use `CMAKE_ANDROID_NDK_VERSION` to check for files expected based
on the version of the NDK.
2021-03-03 10:27:50 -05:00
Raul Tambre
82239d43f8 Clang: C17 default version
Switched in LLVM commit 91cdbd521a38495c66e30636943563ca70d3c022, released in
Clang 11.

Issue: #17755
2021-02-25 18:22:29 +02:00
Raul Tambre
7596d8b951 CMakeCCompilerId: Fix C standard detection in Clang MSVC mode
Clang doesn't define __STDC__ if in MSVC compatibility mode, but does define
__STDC_VERSION__.
Avoid the fallback for this combination.
2021-02-25 18:22:07 +02:00
Kyle Edwards
f31e8d33ef Genex: Fix grammatical error in TARGET_OBJECTS error message 2021-02-24 14:55:17 -05:00
Kyle Edwards
d34d28e688 Genex: Add TARGET_RUNTIME_DLLS genex
Co-Authored-by: Brad King <brad.king@kitware.com>
2021-02-24 14:55:17 -05:00
Brad King
e95f7aa0ed Merge topic 'preset-flag-consistency' into release-3.20
6fa3647023 ctest: Add support for '--prefix=<prefix>' form of the argument
3357d37761 cmake: Add support for '--build --prefix=<prefix>' form of the argument
2f13fdef0a cmake: Document '--preset <preset>' form of the argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5849
2021-02-24 09:46:52 -05:00
Brad King
414cfc6ecb Merge topic 'preset-flag-consistency'
6fa3647023 ctest: Add support for '--prefix=<prefix>' form of the argument
3357d37761 cmake: Add support for '--build --prefix=<prefix>' form of the argument
2f13fdef0a cmake: Document '--preset <preset>' form of the argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5849
2021-02-24 09:46:52 -05:00
Brad King
d4ce3d65f3 Merge topic 'LINK_LANGUAGE-genex-respects-LINKER_LANGUAGE-property'
b722eea925 Genex: LINK_LANGUAGE respects LINKER_LANGUAGE property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5841
2021-02-24 09:45:51 -05:00
Brad King
14c6a88db6 Merge topic 'LINK_LANGUAGE-genex-respects-LINKER_LANGUAGE-property' into release-3.20
b722eea925 Genex: LINK_LANGUAGE respects LINKER_LANGUAGE property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5841
2021-02-24 09:45:50 -05:00
Brad King
261ba00668 Merge topic 'autogen-cmp0116-fix' into release-3.20
339dbc901f Help: Note that CMP0116 is recorded at the time of CC creation
e3740e020e Tests: Test Qt autogen target with CMP0116 set to WARN
cf34011ce7 Tests: Test per-CC behavior of CMP0116
3a95503512 Ninja: Use CMP0116 status recorded at time of custom command's creation
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5848
2021-02-24 09:44:59 -05:00
Brad King
ab3485d15b Merge topic 'autogen-cmp0116-fix'
339dbc901f Help: Note that CMP0116 is recorded at the time of CC creation
e3740e020e Tests: Test Qt autogen target with CMP0116 set to WARN
cf34011ce7 Tests: Test per-CC behavior of CMP0116
3a95503512 Ninja: Use CMP0116 status recorded at time of custom command's creation
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5848
2021-02-24 09:44:59 -05:00
Brad King
75d7329adb Merge topic 'preset-no-comments' into release-3.20
06e16ea008 Merge branch 'backport-3.19-preset-no-comments' into preset-no-comments
afaa69f5b3 Tests: Remove comments from CMakePresetsTest/Good.json.in
4a92277f45 Revert "Help: Document JSON comment support in cmake-presets(7)"
431dd59b5e CMakePresets.json: Remove undocumented support for comments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5853
2021-02-24 09:42:00 -05:00
Brad King
bf0fd71ad1 Merge topic 'preset-no-comments'
06e16ea008 Merge branch 'backport-3.19-preset-no-comments' into preset-no-comments
afaa69f5b3 Tests: Remove comments from CMakePresetsTest/Good.json.in
4a92277f45 Revert "Help: Document JSON comment support in cmake-presets(7)"
431dd59b5e CMakePresets.json: Remove undocumented support for comments

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5853
2021-02-24 09:42:00 -05:00
Brad King
cf21ea2ce6 Merge topic 'ninja-status-stderr' into release-3.20
d33c2c93d8 Tests: Update for upstream ninja change to write status on stderr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5850
2021-02-24 09:41:03 -05:00
Brad King
46607d561a Merge topic 'ninja-status-stderr'
d33c2c93d8 Tests: Update for upstream ninja change to write status on stderr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5850
2021-02-24 09:41:03 -05:00
Brad King
06e16ea008 Merge branch 'backport-3.19-preset-no-comments' into preset-no-comments 2021-02-24 09:33:59 -05:00
Kyle Edwards
afaa69f5b3 Tests: Remove comments from CMakePresetsTest/Good.json.in 2021-02-24 09:33:50 -05:00
Kyle Edwards
431dd59b5e CMakePresets.json: Remove undocumented support for comments
Fixes: #21858
2021-02-24 09:28:36 -05:00
Brad King
d33c2c93d8 Tests: Update for upstream ninja change to write status on stderr
Upstream ninja commit `ad3d29fb53` (Put builder output through status
interface) from ninja PR 1899 changed the status output from stdout to
stderr.  In particular, `ninja: no work to do` is now printed on stderr.
Update our RunCMake tests to accept this difference.

A few RunCMake test cases check for `ninja: no work to do`.  For those,
move the message to stdout using `RunCMake_TEST_OUTPUT_MERGE`.  The rest
of the test cases do not care about the message, so remove it from the
actual stderr content before comparing against that expected.
2021-02-23 10:55:12 -05:00
Brad King
6fa3647023 ctest: Add support for '--prefix=<prefix>' form of the argument
The main `cmake --preset` argument for configure presets supports both
forms, so support it for `ctest --preset` too.

Fixes: #21855
2021-02-23 09:22:00 -05:00
Kyle Edwards
e3740e020e Tests: Test Qt autogen target with CMP0116 set to WARN 2021-02-23 09:17:12 -05:00
Kyle Edwards
cf34011ce7 Tests: Test per-CC behavior of CMP0116 2021-02-23 09:17:12 -05:00
Brad King
3357d37761 cmake: Add support for '--build --prefix=<prefix>' form of the argument
The main `cmake --preset` argument for configure presets supports both
forms, so support it for `cmake --build --preset` too.

Issue: #21855
2021-02-23 09:11:44 -05:00
Brad King
2f13fdef0a cmake: Document '--preset <preset>' form of the argument
This form already works.  Document it and add tests.

Issue: #21855
2021-02-23 09:11:32 -05:00
Marc Chevrier
b722eea925 Genex: LINK_LANGUAGE respects LINKER_LANGUAGE property
If target property LINKER_LANGUAGE is set, LINK_LANGUAGE generator
expression evaluation must be always successful.

This fix can be helpful to elaborate a solution for issue #21818.
2021-02-23 08:14:14 -05:00
Brad King
c2c31ae896 Merge topic 'test-ExternalProject-CONFIGURE_HANDLED_BY_BUILD' into release-3.20
74fe16a292 Tests: Fix ExternalProject CONFIGURE_HANDLED_BY_BUILD on 1s filesystems

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5838
2021-02-23 08:09:59 -05:00
Brad King
97f7a08ff9 Merge topic 'test-ExternalProject-CONFIGURE_HANDLED_BY_BUILD'
74fe16a292 Tests: Fix ExternalProject CONFIGURE_HANDLED_BY_BUILD on 1s filesystems

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5838
2021-02-23 08:09:59 -05:00
Brad King
b9b72384e0 Merge topic 'test-macos-arm64'
1c15eb39d2 Tests: Suppress failures on macOS arm64 due to separate Xcode signing phase
92418ac0ef Tests: Fix CTestTestCrash expected output on macOS arm64
8b22d9b3c3 Tests: Remove explicit no-signing marks from BundleTest
483db3de56 Tests: Clarify internal project name in RunCMake.GoogleTest cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5846
2021-02-23 08:09:10 -05:00
Brad King
1c15eb39d2 Tests: Suppress failures on macOS arm64 due to separate Xcode signing phase
Some tests fail because Xcode runs `POST_BUILD` commands before signing
the binaries they run.  Tell the linker to perform ad-hoc codesign even
though Xcode normally tells it not to.

Other tests fail because `install_name_tool` does not revise ad-hoc
signatures without the codesign `linker-signed` flag.  Add that flag
ourselves where needed by our tests.

For now these changes help our test suite pass so we can use it to cover
everything else.  Both of these cases may need further investigation to
update CMake to help projects in general.

Issue: #21845, #21854
2021-02-22 15:47:13 -08:00
Brad King
483db3de56 Tests: Clarify internal project name in RunCMake.GoogleTest cases 2021-02-22 13:30:19 -05:00