summaryrefslogtreecommitdiffstats
path: root/Tests
Commit message (Collapse)AuthorAgeFilesLines
* define_property(): Change constraints of INITIALIZE_FROM_VARIABLEKyle Edwards2022-03-2311-23/+23
| | | | | | | Remove the requirement that the variable name have a prefix while keeping the suffix requirement. Require that the property name contains an underscore. Update docs and tests accordingly. Fixes: #23340
* Revert INTERFACE_LINK_LIBRARIES_DIRECT feature for 3.23 branchBrad King2022-03-2163-773/+2
| | | | | | | | | | | | | | | Revert commit f3ad061858 (Add usage requirements to update direct link dependencies, 2022-01-12, v3.23.0-rc1~44^2) and the property storage updates in its predecessor commit 193a999cd5 (cmTarget: Add INTERFACE_LINK_LIBRARIES_DIRECT{,_EXCLUDE} backtrace storage, 2022-01-06, v3.23.0-rc1~44^2~1) from the 3.23 release branch. After initial experience using the feature in practice, additional design considerations have been raised for discussion in the original issue. To avoid rushing this for the 3.23 series, we've decided to revert the feature for now so it can be revised for a future release. Issue: #22496
* Merge topic 'always_prefer_last_source_dir' into release-3.23Brad King2022-03-181-1/+1
|\ | | | | | | | | | | | | | | b44ad7992a cmake: Always prefer the last source directory provided Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7084
| * cmake: Always prefer the last source directory providedRobert Maynard2022-03-171-1/+1
| | | | | | | | Fixes: #23334
* | target_link_libraries: Restore LINK_ONLY for multiple static lib dependenciesBrad King2022-03-163-0/+28
|/ | | | | | | | | | | | | | | | | Since commit c1e812ad4f (target_link_libraries: Improve tolerance of unquoted generator expressions, 2022-02-15, v3.23.0-rc2~11^2) we accumulate consecutive non-keyword arguments to recover an unquoted generator expression as a single entry. When given multiple consecutive non-genex library names, the grouping breaks our logic that expects each entry is either a raw target name or a genex. Revise the logic to only accumulate multiple arguments when they end inside a partial genex. This bug caused `target_link_libraries` to stop wrapping static library private dependencies in `$<LINK_ONLY:...>` for `INTERFACE_LINK_LIBRARIES` when multiple consecutive library names are given. Add a test case covering that behavior. Fixes: #23302
* Tests: Fix testing CMAKE_CUDA_ARCHITECTURES=OFF with ClangBrad King2022-03-102-0/+18
| | | | | | Clang does not automatically choose an architecture supported by the SDK. The `OFF` value is meant for users to provide their own architecture flags, so provide one as part of the test.
* CUDA: Restore support for CMAKE_CUDA_ARCHITECTURES=OFFRobert Maynard2022-03-093-0/+6
| | | | Fixes: #23309
* Tests: Disable CMAKE_SYSTEM_PROGRAM_PATH in IgnorePrefixPath testKyle Edwards2022-03-081-0/+1
| | | | | | | | Some systems set CMAKE_SYSTEM_PROGRAM_PATH, which pollutes the environment for this test. Erase it before executing the test to get a clean environment. Fixes: #23300
* Merge topic 'cmake-presets-file-dir' into release-3.23Brad King2022-03-087-1/+49
|\ | | | | | | | | | | | | | | | | f54507c2f6 CMakePresets.json: Add ${fileDir} macro Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Acked-by: Gerhard Olsson <gerhard.nospam@gmail.com> Merge-request: !7051
| * CMakePresets.json: Add ${fileDir} macroKyle Edwards2022-03-077-1/+49
| | | | | | | | Fixes: #23214
* | Tests: Make RunCMake.CMP0125 robust to external filesystem contentBrad King2022-03-074-56/+56
|/ | | | | | | | Revise the test from commit 08db1341a6 (find_*: ensure consistent behavior for cache variables, 2021-05-03, v3.21.0-rc1~177^2) to avoid searching outside the test directories. Fixes: #23299
* Merge topic 'file-set-name-requirements' into release-3.23Brad King2022-03-044-0/+12
|\ | | | | | | | | | | | | | | b357d334fc target_sources(): Enforce stricter requirements for FILE_SET name Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7037
| * target_sources(): Enforce stricter requirements for FILE_SET nameKyle Edwards2022-03-034-0/+12
| | | | | | | | Fixes: #23286
* | Merge topic 'file-set-multiple-names' into release-3.23Brad King2022-03-041-5/+9
|\ \ | | | | | | | | | | | | | | | | | | 8c23ecbd93 target_sources(): Process multiple FILE_SET arguments per block Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7040
| * | target_sources(): Process multiple FILE_SET arguments per blockKyle Edwards2022-03-031-5/+9
| |/ | | | | | | Fixes: #23287
* | Merge topic 'while-bug-compatibility' into release-3.23Brad King2022-03-046-24/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | da2361ffb3 while: Restore tolerance of condition error 47d197745a Tests: Simplify RunCMake.{if,while} unbalanced parenthesis cases Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7041
| * | while: Restore tolerance of condition errorAlex Turbov2022-03-034-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 880ca66b51 (Fix: `while()` can silently ignore incorrect condition, 2021-08-09, v3.22.0-rc1~238^2~4) we correctly reject the code set(paren "(") while(${paren}) endwhile() However, rejecting it breaks compatibility with projects that used such code accidentally. In CMake 3.21 and below, any error in the condition was ignored because the `false` result exited the loop first. Restore tolerance of the error for now. A policy will be needed to make it an error later. Note that the same condition with `if` was always correctly rejected. Fixes: #22524 Issue: #23296 Co-authored-by: Brad King <brad.king@kitware.com>
| * | Tests: Simplify RunCMake.{if,while} unbalanced parenthesis casesBrad King2022-03-034-16/+11
| | |
* | | Merge topic 'cuda-arch-all' into release-3.23Brad King2022-03-035-0/+18
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | dae3ad08fa Tests: Add cases for CMAKE_CUDA_ARCHITECTURES={all,all-major} 5c1f5357b0 VS: Fix CUDA compiler id with CMAKE_CUDA_ARCHITECTURES={all,all-major} Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7035
| * | | Tests: Add cases for CMAKE_CUDA_ARCHITECTURES={all,all-major}Brad King2022-03-025-0/+18
| | |/ | |/| | | | | | | | | | | | | | | | The `CudaOnly.All` test only sets these in project code after CUDA is enabled. Add another case to test the values during compiler detection. Issue: #23161
* | | Merge topic 'cmake-dir-args' into release-3.23Brad King2022-03-0349-30/+84
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | d2e9478321 Tests: Add RunCMake.CommandLine ExplicitiDirs explicit work directory 78e8f11456 cmake: Correct regression in `-B <dir> <src_dir>` 4091d5c58c Tests: Verify RunCMake.CommandLine ExplicitDirs source/build dirs 1b97f8f35c Tests: Clarify RunCMake.CommandLine ExplicitDirs case names Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7030
| * | Tests: Add RunCMake.CommandLine ExplicitiDirs explicit work directoryBrad King2022-03-021-0/+6
| | | | | | | | | | | | | | | | | | | | | Verify that the work directory is not selected as the source or build tree. Issue: #23285
| * | cmake: Correct regression in `-B <dir> <src_dir>`Robert Maynard2022-03-021-0/+1
| | | | | | | | | | | | Fixes: #23285
| * | Tests: Verify RunCMake.CommandLine ExplicitDirs source/build dirsBrad King2022-03-0223-0/+47
| | |
| * | Tests: Clarify RunCMake.CommandLine ExplicitDirs case namesBrad King2022-03-0227-30/+30
| | |
* | | Merge topic 'doc-presets-v4' into release-3.23Brad King2022-03-023-0/+11
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 6404751176 Help: Improve wording and structure related to preset includes Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7028
| * | | Help: Improve wording and structure related to preset includesCraig Scott2022-03-023-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Encourage placing preset includes near the beginning of a preset file and ensure the example shows that usage. Move the prose discussing includes to its own section to improve discoverability and break up paragraphs to make each main point harder to miss. Also clarify ${sourceDir} to remove any ambiguity with regard to its meaning in included files. Issue: #23214
* | | | target_sources(): Prohibit FILE_SET on custom targetsKyle Edwards2022-02-284-0/+8
|/ / / | | | | | | | | | Fixes: #23262
* | | Ninja: Avoid preprocessing twice with explicit Fortran_PREPROCESSPeter Hill2022-02-242-1/+9
|/ / | | | | | | | | | | Fix spurious warnings from gfortran+Ninja for preprocessing. Fixes: #23248
* | Merge topic 'correct_multiple_source_warnings' into release-3.23Brad King2022-02-187-0/+46
|\ \ | | | | | | | | | | | | | | | | | | | | | 7083b19498 cmake: When given multiple source paths use last instead of first Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7001
| * | cmake: When given multiple source paths use last instead of firstRobert Maynard2022-02-177-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | When given two source paths via `-S` or just directory paths prefer the last one. When the paths are mixed always prefer the last `-S` entry. Fixes: #23238
* | | Merge topic 'file-set-no-exist' into release-3.23Brad King2022-02-182-0/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 058b8a0bfb install(): Properly ignore FILE_SETs that don't exist Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !7000
| * | | install(): Properly ignore FILE_SETs that don't existKyle Edwards2022-02-172-0/+5
| |/ / | | | | | | | | | Fixes: #22960
* | | Merge topic 'test-qt-disable' into release-3.23Brad King2022-02-181-4/+8
|\ \ \ | |/ / |/| / | |/ | | | | | | 5bfff3c750 Tests: Add missing guards on Qt4 and Qt5 tests Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6998
| * Tests: Add missing guards on Qt4 and Qt5 testsBrad King2022-02-171-4/+8
| | | | | | | | | | | | | | | | Add missing `CMake_TEST_Qt{4,5}` conditions on Qt4 an Qt5 tests. Configuring CMake with `-DCMake_TEST_Qt5=OFF` should prevent any attempt to search for Qt5. Fixes: #23239
* | Merge topic 'cmake-empty-cmd-line-arg' into release-3.23Brad King2022-02-1714-4/+38
|\ \ | | | | | | | | | | | | | | | | | | | | | f73457ca2e cmake: Ignore any empty "" command line arguments 67f97f5478 Tests: Add RunCMake helper to run cmake with raw execute_process args Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6980
| * | cmake: Ignore any empty "" command line argumentsRobert Maynard2022-02-1613-2/+23
| | | | | | | | | | | | | | | | | | | | | Don't treat empty quote arguments("") as the current working directory but instead ignore them. Fixes #23217
| * | Tests: Add RunCMake helper to run cmake with raw execute_process argsBrad King2022-02-161-2/+15
| | |
* | | Merge topic 'test-cuda-sepcomp-ptx' into release-3.23Brad King2022-02-171-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | a7ef59c9c4 Tests: Fix CudaOnly.SeparateCompilationPTX test project name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6991
| * | | Tests: Fix CudaOnly.SeparateCompilationPTX test project nameBrad King2022-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the test added by commit 61b9764b03 (CUDA: Allow both CUDA_SEPARABLE_COMPILATION and CUDA_PTX_COMPILATION, 2021-09-17, v3.23.0-rc1~516^2) to have a `project()` name matching what is passed to CTest's `--build-project` option. Otherwise, on VS builds, MSBuild warns: MSBUILD : error MSB1009: Project file does not exist. Other CUDA tests use a matching project name already.
* | | | target_link_libraries: Improve tolerance of unquoted generator expressionsBrad King2022-02-151-0/+10
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to commit 1d709ea2f5 (cmGeneratorTarget: Propagate backtraces from INTERFACE_LINK_LIBRARIES, 2021-12-15, v3.23.0-rc1~228^2), the value of `INTERFACE_LINK_LIBRARIES` was a single string. If an unquoted generator expression passed to `target_link_libraries` contained `;` and became multiple arguments, they would all accumulate as a single `;`-separated list in the value of `INTERFACE_LINK_LIBRARIES`. Since that commit, each argument to `target_link_libraries` is placed in `INTERFACE_LINK_LIBRARIES` as a separate entry, as has long been the case for `LINK_LIBRARIES`. That behavior change broke projects that were accidentally relying on accumulation in `INTERFACE_LINK_LIBRARIES` to produce complete generator expressions containing `;`. Teach `target_link_libraries` to accumulate consecutive non-keyword arguments into a single entry before placing them in `LINK_LIBRARIES` or `INTERFACE_LINK_LIBRARIES`. For example, treat `a b c` as if they were written as `"a;b;c"`. This restores the previously accidental support for unquoted generator expressions in `INTERFACE_LINK_LIBRARIES`, and also enables it for `LINK_LIBRARIES`. For now, do not drop the `target_link_libraries` documentation that recommends quoting generator expressions. Quoting is still important to populate `LINK_LIBRARIES` in CMake 3.22 and below, and is also good practice to keep generator expressions whole. Fixes: #23203
* | | Merge topic 'GoogleTest-discovery-fix-escaping' into release-3.23Brad King2022-02-147-0/+130
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 61929f936f GoogleTest: Fix escaping in test names Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6965
| * | | GoogleTest: Fix escaping in test namesEvgeniy Shcherbina2022-02-117-0/+130
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to add_command() being a macro it introduced excessive and nonobvious escaping in different parts of the script. Because of one of such places the resulting script would have an erroneous ${TEST_LIST} if the user data (in test parameters) had a semicolon. To eliminate this non-obvious escaping, add_command() was converted to function. Updated the escaping accordingly. Fixes: #23059
* | | find_package: Improve --debug-find-pkg= when using a find moduleBrad King2022-02-105-0/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the feature added by commit d7b18895bc (cmake: Add filtered debug-find options, 2021-12-07, v3.23.0-rc1~217^2) to enable debug output for `find_*` calls within a find module or cmake package configuration file. Fixes: #23211
* | | find_package: Avoid printing debug output header multiple timesBrad King2022-02-102-8/+0
| | |
* | | find_package: Mention package name in Config mode debug outputBrad King2022-02-103-3/+6
| | | | | | | | | | | | | | | Otherwise, if there are no paths considered then the output does not specify the name of the package.
* | | find_package: Fix find module name in --debug-find outputBrad King2022-02-102-2/+2
| | |
* | | find_package: Improve formatting of --debug-find outputBrad King2022-02-104-41/+176
| | | | | | | | | | | | Also spell out more complete content in the test's expect output.
* | | Tests: Improve order of RunCMake.find_package casesBrad King2022-02-101-3/+2
| | | | | | | | | | | | Sort recently added cases among similar-named cases.
* | | Merge topic 'doc-if-AND-OR' into release-3.23Brad King2022-02-103-0/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 41adfc6b04 Help: Clarify precedence of AND and OR in 'if' conditions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6970