summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* 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
* install(TARGETS): Restore per-export INCLUDES DESTINATIONEugene Shalygin2022-02-095-0/+47
| | | | | | | | | | | | | | | | In commit 55e4753bbb (Refactor cmTargetExport removing InterfaceIncludeDirecories, 2021-07-20, v3.22.0-rc1~337^2~1) the storage of `INCLUDES DESTINATION` was moved into each target. However, a target may be installed in multiple exports, and their `INCLUDES DESTINATION` should not be mixed. Convert the IncludeDirectoriesEntries vector to a map and modify access function to store the directories lists with respect to cmExportTarget object. This fixes error when the same target is exported more than once via different exports and each for consequent export its include directories list grows. Add a test for this case. Fixes: #23183
* CMP0128: Add flag in OLD mode even when standard matches the defaultRaul Tambre2022-01-233-0/+31
| | | | | | | | | Commit 4a0485be (cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic, 2021-04-29) unintentionally changed the behavior by modifying the code to match a pre-existing comment. The resulting behavior change however matches the intentions of CMP0128, so we simply need to guard it. Fixes #23122.
* CMP0128: Avoid test code duplicationRaul Tambre2022-01-237-26/+10
|
* CMP0128: Prefix test names with modeRaul Tambre2022-01-237-7/+7
| | | | Makes clear that these tests are for the NEW behaviour.
* Merge topic 'vs2022-v143-link-guard-cf' into release-3.22Brad King2022-01-133-0/+48
|\ | | | | | | | | | | | | 9e24437c91 VS: Remove the '/guard:cf' flag from v143 link flag table Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6858
| * VS: Remove the '/guard:cf' flag from v143 link flag tableBenjamin Sluis2022-01-123-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | Apply the change from commit db35e3cfd6 (VS: Fix support for '/guard:cf' linker flag for v142, 2019-01-24, v3.14.0-rc1~74^2~2) to the v143 flag table. The entry for `LinkControlFlowGuard` in `v143_Link.json` does not work when used in a `.vcxproj` file. Drop our link flag table entries for this toolset so that the flag will be passed via `AdditionalOptions`. Also add a test case.
| * Merge topic 'revert-debian-libexec' into release-3.21Brad King2021-10-081-2/+2
| |\ | | | | | | | | | | | | | | | | | | 6658e260d4 GNUInstallDirs: Fix misinterpretation of Debian Policy on LIBEXECDIR Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6607
* | | file: Restore error capture in undocumented READ_ELF modeBrad King2022-01-112-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Revise the error message added by commit 115ff6a347 (cmELF: Include the ELF parsing code unconditionally, 2021-06-17, v3.22.0-rc1~557^2) to honor the `CAPTURE_ERROR` option. This is needed by the call site in `BundleUtilities` to suppress errors on non-ELF files. Fixes: #23074
* | | CMakeParseLibraryArchitecture: Fix parsing /lib/<arch> implicit object pathRaphael Gozzo2021-12-068-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current regular expression is able to match `/usr/lib/<arch>`, `/usr/usr/lib/<arch>`, `/usr/usr/usr/lib/<arch>`, ... but not `/lib/<arch>`. This behavior ends up causing the detected architecture to be x86_64-pc-linux-gnu when the Clang compiler is installed on a "non-system" location (like /opt/llvm-13) which, in turn, makes almost every 'find_library()' fail because the correct architecture is x86_64-linux-gnu. This is due to a typo in commit 764606e256 (CMakeDetermineCompilerABI: Extract lib arch from implicit object file paths, 2021-04-05, v3.20.1~10^2), which used `+` instead of `?`.
* | | file(RPATH): Restore tolerance of unknown formats if new RPATH is emptyBrad King2021-12-0112-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 2e1149874d (cmSystemTools: Support multiple binary formats, 2021-06-14, v3.22.0-rc1~575^2) the `file(RPATH_...)` operations fail on files that are not ELF or XCOFF format. Previously the RPATH operations tolerated files of unknown format if the goal was to produce a file with an empty RPATH. Restore this tolerance in order to support setting an empty RPATH on GNU ld scripts. Fixes: #22963
* | | try_compile: Do not use CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES env varsBrad King2021-11-223-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since: * commit e216b9bbd3 (cmake: Allow CMAKE_BUILD_TYPE to be set by environment variable, 2021-06-29, v3.22.0-rc1~503^2~1) * commit ef56eefc9b (cmake: Allow CMAKE_CONFIGURATION_TYPES to be set by environment variable, 2021-06-29, v3.22.0-rc1~503^2) the environment variables are supposed to provide defaults for settings the user otherwise can control via cache entries. However, they accidentally affect `try_compile` projects too, which are supposed to be programmatically controlled. Fixes: #22935
* | | gtest_discover_tests: Re-run PRE_TEST discovery on any arg changeCraig Scott2021-11-164-0/+77
| | | | | | | | | | | | Fixes: #22912
* | | Tests: Fix and update wrongly named GoogleTest stdout fileCraig Scott2021-11-141-3/+3
| | | | | | | | | | | | The GoogleTest-skip-test output was never being checked since this test was added due to this file having the wrong name.
* | | CMP0128: Enable/disable extensions if standard same as defaultRaul Tambre2021-11-115-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was intended to be part of the initial MR (!6177), but accidentally went missing when debugging nightly failures on less common systems. Noticed during !6711 review as the comment about this behaviour didn't match the code. Documentation for CMP0128 is updated to remove a false case and note the two cases related to this. Fixes #22224.
* | | Ninja Multi-Config: Fix custom command target dependencies in cross-configsBrad King2021-11-045-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generator expressions in a non-cross custom command's `COMMAND` arguments are evaluated in the command config. Target-level dependencies implied by `TARGET_FILE` must therefore be cross dependencies. This is important to generate proper target-level dependencies on the cross-config build statements for the target to which the custom command is attached. Fixes: #22855
* | | cmake_host_system_information: Add undocumented VS_MSBUILD_COMMAND keyBrad King2021-10-205-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using the Visual Studio generator for VS 10 or above, offer this key to get the location of the MSBuild command before the first `project()` or `enable_language()` command has finished running. This will be needed only by one of our own modules, so leave it undocumented for now.
* | | cmFileCommand: improve error messageSeth R Johnson2021-10-124-4/+12
| | | | | | | | | | | | | | | Print full list of unresolved dependencies and a phrase that indicates what about the file is unresolved.
* | | Merge topic 'revert-debian-libexec'Brad King2021-10-081-2/+2
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 6658e260d4 GNUInstallDirs: Fix misinterpretation of Debian Policy on LIBEXECDIR Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6607
| * | GNUInstallDirs: Fix misinterpretation of Debian Policy on LIBEXECDIRTimo Röhling2021-10-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert commit 798c1c3192 (GNUInstallDirs: Comply with Debian Policy on LIBEXECDIR, 2020-10-08, v3.19.0-rc1~11^2). The Debian Policy builds upon FHS 3.0 and permits installing to `/usr/libexec`. While Policy does grant an additional exception for applications to use a single subdirectory of `/usr/lib/<triplet>`, this is not meant to replace `/usr/libexec` as valid target. Fixes: #22731
* | | Tests: Skip RunCMake.file INSTALL-FOLLOW_SYMLINK_CHAIN case on CygwinBrad King2021-10-062-2/+4
| | | | | | | | | | | | | | | | | | | | | This case was added by commit e3ff7ced63 (file(INSTALL): Add FOLLOW_SYMLINK_CHAIN argument, 2019-05-16, v3.15.0-rc1~103^2). Skip it on Cygwin because it fails due to `foo/../` pairs being flattened away in symlinks.
* | | Merge topic 'ci-xcode-13.0'Brad King2021-10-062-4/+4
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | 429522e89c gitlab-ci: update macOS jobs to use Xcode 13.0 75901f0472 Tests: Fix RunCMake.XcodeProject XcodeIOSInstallCombined cases for Xcode 13.0 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6578
| * | Tests: Fix RunCMake.XcodeProject XcodeIOSInstallCombined cases for Xcode 13.0Brad King2021-10-052-4/+4
| | | | | | | | | | | | | | | The output of `otool -vf` now contains additional content that happens to be matched by our architectures regex. Make the regex more strict.
* | | Merge topic 'xcode13-schema'Brad King2021-10-061-1/+6
|\ \ \ | |/ / | | | | | | | | | | | | | | | 0e86fea0be Tests: Specify destination for Xcode scheme Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6582
| * | Tests: Specify destination for Xcode schemeGregor Jasny2021-10-051-1/+6
| | | | | | | | | | | | | | | | | | | | | The `Using the first of multiple matching destinations` warning vanishes if we explicitly specify a destination. Fixes: #22704
* | | Merge topic 'fetchcontent-CMAKE-vars-passthrough'Craig Scott2021-10-062-0/+39
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1851aa49be FetchContent: Pass through networking-related CMAKE_... variables 96937438b7 Help: Clean up how TLS and NETRC variables are discussed 2a82bd85b6 Help: Add documentation for CMAKE_TLS_CAINFO Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6589
| * | | FetchContent: Pass through networking-related CMAKE_... variablesCraig Scott2021-10-052-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | CMAKE_TLS_VERIFY, CMAKE_TLS_CAINFO, CMAKE_NETRC and CMAKE_NETRC_FILE are now passed through to the underlying ExternalProject sub-build. Previously, they were silently ignored. Fixes: #22144
* | | | Merge topic 'qt6-tests'Craig Scott2021-10-0517-64/+134
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a742088472 Tests: Add support for testing Qt6 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6587
| * | | | Tests: Add support for testing Qt6Craig Scott2021-10-0417-64/+134
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The minimum CMake version for Qt6 is 3.16, so all the calls to cmake_minimum_required() are updated here to enforce that minimum. This will avoid any CMake version-related warnings from Qt. Avoid hard-coding Qt5 where the tests could now be using Qt5 or Qt6. Fixes: #22188
* | | | cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logicRaul Tambre2021-09-2911-1/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes are part of CMP0128. When the standard level is unset: * Flags are added if extension mode doesn't match the compiler's default. Previously logic only worked if LANG_EXTENSIONS was ON. Fixes #22224. * The full flag is used. Previously CMAKE_LANG_EXTENSION_COMPILE_OPTION was used. This was only supported for IAR. Otherwise: * Avoid adding flags if not necessary per the detected compiler defaults. * Fixed check for when the requested standard is older. It now matches the nearby comments. I reworded the fallback comment as its logic was a bit difficult to wrap my head around.
* | | | Tests: Simplify RunCMake.CompileFeatures introspectionRaul Tambre2021-09-284-60/+24
|/ / /
* | | Merge topic 'autogen-dep-on-imported-implib-only-target'Brad King2021-09-275-0/+75
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | 895fa3433f cmQtAutoGenInitializer: support IMPLIB-only imported targets 354c1f5628 Tests/RunCMake/Autogen: test CMP0111 behavior Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !6558
| * | Tests/RunCMake/Autogen: test CMP0111 behaviorBen Boeckel2021-09-245-0/+75
| | | | | | | | | | | | | | | | | | | | | On Windows, imported shared libraries which only have an `IMPORTED_IMPLIB` set fail if they are depended upon by a target using automoc. Add a test for the behavior of depending upon all imported target types from an automoc-using target.
* | | Merge topic 'cat_empty_file'Brad King2021-09-211-1/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0b4a56e64b cmake: -E cat stops when an empty file is encountered Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6539
| * | | cmake: -E cat stops when an empty file is encounteredJohnny Jazeix2021-09-181-1/+2
| | | | | | | | | | | | | | | | Fixes: #22652
* | | | Tests: fix RunCMake.CPack_DEB.EXTRA on Debian non-Linux OSesPino Toscano2021-09-181-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | The generated path with the packages uses $CPACK_TOPLEVEL_TAG, which by default is $CPACK_SYSTEM_NAME, thus the OS name. To make the expected stderr match also non-Linux OSes, accept any non-slash characters in place of "Linux", so it works also on other Debian OSes (e.g. Debian/Hurd).
* | | Merge topic 'xcode-embed-libraries'Craig Scott2021-09-167-24/+28
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 6ef7bfbb64 Xcode: add support for embedding dynamic libraries Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6490
| * | | Xcode: add support for embedding dynamic librariesLucas SOLTIC2021-09-137-24/+28
| | | |
* | | | PCH: MSVC: Restrict OBJECT library INTERFACE_LINK_LIBRARIES usageCristian Adam2021-09-152-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pch object file could cause problems when the reused pch is passed through an OBJECT library, which would use INTERFACE_LINK_LIBRARIES to link the pch object file. Fixes: #22630
* | | | Merge topic 'pch-xcode-multiple-languages'Brad King2021-09-145-0/+35
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bbcdac4e5d PCH: Fix all-language precompile header support in Xcode Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6435
| * | | | PCH: Fix all-language precompile header support in XcodeCristian Adam2021-09-135-0/+35
| | | | | | | | | | | | | | | | | | | | Fixes: #22384
* | | | | Merge topic 'CMakeDependentOption-condition-syntax'Brad King2021-09-1412-1/+51
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 059b90a0b4 CMakeDependentOption: Introduce policy CMP0127 for full Condition Syntax Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6493
| * | | | CMakeDependentOption: Introduce policy CMP0127 for full Condition SyntaxDaniel Schürmann2021-09-1012-1/+51
| | | | | | | | | | | | | | | | | | | | Fixes: #22303
* | | | | Merge topic 'vs_settings'Brad King2021-09-102-3/+14
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f21158cdfe VS: Honor VS_SETTINGS source file property on all sources 3bf013632d cmVisualStudio10TargetGenerator: Factor out helper to write VS_SETTINGS Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6492
| * | | | | VS: Honor VS_SETTINGS source file property on all sourcesSteven Boswell2021-09-092-3/+14
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | Extend the feature added by commit 2ce42f281f (VS: Add VS_SETTINGS source file property, 2020-03-18, v3.18.0-rc1~449^2~3) to support all source file types.
* | | | | ctest_memcheck: generate `DynamicAnalysis-Test.xml` as wellBen Boeckel2021-09-094-0/+26
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | This is useful so that memcheck results also show up as test results on CDash. It will be submitted with the other `MemCheck` parts. Fixes: #22190
* | | | Merge topic 'host-distro-info'Brad King2021-08-2436-0/+263
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b9698f89df cmake_host_system_information: Make it available for all systems 5469c71a82 Refactor: Simplify `GetValue()` function calls 6c92f80f2e cmake_host_system_information: Also set `USED_FALLBACK_SCRIPT` efe139d1b8 cmake_host_system_information: Can run fallback scripts 1e65e4a6e5 cmake_host_system_information: Can read `/etc/os-release` file e808cbb1dd Testing: Convert `cmake_host_system_information` tests into `RunCMake` 9e831284e5 Documentation: Use definition list instead of tables 346f3de005 Refactor: Deduplicate code for `VS_nn_DIR` keys processing ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6410
| * | | | cmake_host_system_information: Make it available for all systemsAlex Turbov2021-08-202-11/+7
| | | | | | | | | | | | | | | | | | | | Before it was Linux only.