summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_package
Commit message (Collapse)AuthorAgeFilesLines
* find_*(): Add CMAKE_IGNORE_PREFIX_PATH variableKyle Edwards2022-02-022-0/+27
| | | | Fixes: #20878
* find_package(): Add tests for CMAKE_IGNORE_PATHKyle Edwards2022-01-312-0/+13
|
* cmake: Add filtered debug-find optionsJohn Parent2021-12-176-0/+86
| | | | | | | | | | Add a `--debug-find-pkg=` option to debug find calls for specific packages. Add a `--debug-find-var=` option to debug find calls for specific return variables. Fixes: #21880
* find_package: Don't reroot prefix that is equal to a root pathAlexandru Croitor2021-10-203-0/+17
| | | | | | | | | | | When both CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH are set to /opt/my_device_sysroot, cmFindCommon::RerootPaths would only look for packages in /opt/my_device_sysroot/opt/my_device_sysroot but would not try to look in /opt/my_device_sysroot. Make sure to not reroot the prefix path in such a case. Fixes: #21937
* find_package: Add variable to make package REQUIREDEugene Shalygin2021-07-087-0/+43
| | | | | | | | | | | | | | Add a `CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` variable is complement to `CMAKE_DISABLE_FIND_PACKAGE_<PackageName>` with just the opposite behaviour: it turns non-required find_package call into the required one. While optional package dependencies usually result in simple and clean build logic, sometimes people want to be sure those optional dependencies will be found and used. Examples are reproducible builds and build instructions for 3rd parties. People choose to make find_package calls REQUIRED and put them behind an option(). Such workarounds blend build logic with build environment management and do not look elegant.
* Add deprecation warnings for policies CMP0088 and belowBrad King2021-06-301-0/+10
| | | | | | | The OLD behaviors of all policies are deprecated, but only by documentation. Add an explicit deprecation diagnostic for policies introduced in CMake 3.14 and below to encourage projects to port away from setting policies to OLD.
* WriteBasicConfigVersion supports version strings such as 21.07.04Robert Maynard2021-05-273-2/+28
| | | | Fixes #22207
* MSYS: Add support for running under MSYS runtime environmentOrgad Shaneh2021-04-261-1/+3
| | | | Detect MSYS as CYGWIN, with the required adaptations.
* find_package: raise error on empty version rangeMarc Chevrier2020-09-299-11/+81
|
* find_package: Add support of version rangeMarc Chevier2020-09-2319-0/+431
| | | | This enhancement is the first step for solving issue #21107
* Tests/RunCMake: Update cmake_minimum_required versionsBrad King2020-06-182-6/+7
| | | | Use 3.3 or 2.8.12 where possible.
* find_package: Improve debug logging outputRobert Maynard2020-01-012-5/+10
| | | | | The find_package debug log messages are now easier to read when enabled by the `--debug-find` command-line option or `CMAKE_FIND_DEBUG_MODE` variable.
* find_*: Use debug logging infrastructureRobert Maynard2019-12-195-0/+44
| | | | | | Teach the find_package, find_library, find_program, find_path, and find_file commands to print debug log messages when enabled by the `--debug-find` command-line option or `CMAKE_FIND_DEBUG_MODE` variable.
* FindPackage: Support `NO_[]_PATH` global call optionsRobert Maynard2019-07-225-0/+76
|
* find_package: add test coverage for CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKSDavid Aguilar2019-01-164-0/+31
|
* find_package(): Add policy to remove the FindQt moduleKyle Edwards2018-11-146-0/+51
| | | | | | | | Removing FindQt.cmake gives Qt upstream a path forward to export its own QtConfig.cmake files which can be found by find_package() without having to explicitly specify CONFIG. Projects that still want to use Qt3/4 can call find_package(Qt[34]), include(FindQt), or add FindQt.cmake to their CMAKE_MODULE_PATH.
* Help: Add explicit <PackageName>_ROOT variable documentationBrad King2018-07-201-1/+1
| | | | | | Add documentation for both the CMake variable and environment variable of this name pattern. Update references to these names to link to their documents. Clarify the pattern used to construct their names.
* find_package: Improve CMP0074 warning messagesBrad King2018-03-211-2/+6
| | | | | | | | Policy `CMP0074` was added by commit eb35d8884b (find_package: Use PackageName_ROOT variables as search prefixes, 2018-03-15). Revise the logic to avoid warning when a `PackageName_ROOT` variable is set to empty since that won't change the search behavior. Also, when we do warn include the variable value(s) for reference.
* find_package: Use PackageName_ROOT variables as search prefixesBrad King2018-03-169-3/+95
| | | | | | | | | | | | | | | | | | | This feature was originally added by commit v3.9.0-rc1~71^2~2 (find_*: Add a new PackageRoot search path group, 2017-05-03) and documented by commit v3.9.0-rc1~71^2 (find_*: Add docs for PackageRoot search path group, 2017-05-03). However, we had to disable the feature and remove the documentation in commit v3.9.1~2^2 (find_*: Disable the PACKAGE_ROOT search path group for CMake 3.9, 2017-08-08) due to breaking projects that used `PackageName_ROOT` variables themselves. Add policy `CMP0074` to restore the `PackageName_ROOT` variable behavior in a compatible way. Also revise the stack of root paths to store the paths themselves rather than the package names. This way the policy can be considered at the `find_package` call site instead of individual `find_` calls inside a find module. Co-Author: Chuck Atkins <chuck.atkins@kitware.com> Issue: #17144
* Merge topic 'find-package_root-test-regex'Brad King2017-08-106-465/+480
|\ | | | | | | | | | | | | | | e574bce1 Tests: Simplify RunCMake.find_package PackageRoot case regexes Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Chuck Atkins <chuck.atkins@kitware.com> Merge-request: !1115
| * Tests: Simplify RunCMake.find_package PackageRoot case regexesBrad King2017-08-086-465/+480
| |
* | find_*: Disable the PACKAGE_ROOT search path group for CMake 3.9Brad King2017-08-083-0/+3
|/ | | | | | | | | | | | | | | | Disable the feature added by commit v3.9.0-rc1~71^2~2 (find_*: Add a new PackageRoot search path group, 2017-05-03) and remove documentation added by commit v3.9.0-rc1~71^2 (find_*: Add docs for PackageRoot search path group, 2017-05-03). Unfortunately the name `<pkg>_ROOT` may already be set by projects for their own incompatible purposes. Disable the behavior change for now to fix the regression for CMake 3.9. We can restore it later with a policy. In order to keep the implementation and tests working, add an undocumented variable we can use in the tests to enable the behavior before the policy is introduced. Fixes: #17144
* find_package: Split PACKAGE_ROOT tests to work with smaller regexChuck Atkins2017-08-027-846/+872
|
* find_package: Fix PACKAGE_ROOT test to check find_pacakge(CONFIG) mode.Chuck Atkins2017-07-287-99/+531
|
* Merge branch 'find_package-root-prefix-path-suffixes' into release-3.9Brad King2017-07-118-0/+72
|\
| * find_*: Honor PATH_SUFFIXES in PackageName_ROOT pathsBrad King2017-07-118-0/+72
| | | | | | | | | | | | | | This was accidentally forgotten in commit v3.9.0-rc1~71^2~2 (find_*: Add a new PackageRoot search path group, 2017-05-03). Fixes: #17052
* | find_package: Restore longer message when config files were consideredBrad King2017-07-0711-1/+45
|/ | | | | | | | | | | | | | | | | | Since commit v3.9.0-rc1~58^2 (find_package: shorten output for missing package in config mode, 2017-05-09) we print only the one line - Could NOT find Foo (missing: Foo_DIR) when package Foo cannot be found in CONFIG mode and it is not REQUIRED. However, in the case that package configuration files were found but not used, this one line message leaves out important information. This can happen when a package configuration file sets `Foo_FOUND` to `FALSE` or when its package version file does not match the requested version. Restore the longer message in these cases. Otherwise a seemingly valid explicit `Foo_DIR` setting appears to be silently ignored even if it was considered. Fixes: #17029
* Merge topic 'find_package-shorter-message'Brad King2017-05-259-47/+5
|\ | | | | | | | | | | | | | | d0b9d1cc find_package: shorten output for missing package in config mode d9df805f cmFindPackageCommand: Split condition to improve readability Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !851
| * find_package: shorten output for missing package in config modeChristoph GrĂ¼ninger2017-05-239-47/+5
| | | | | | | | | | | | | | If CONFIG or MODULE is given and the package is not REQUIRED, output a one-liner instead of the full warning. Update Tests/RunCMake/find_package expected output to match.
* | find_*: Add tests for PackageRoot search path groupChuck Atkins2017-05-1617-0/+476
|/
* cmListFileBacktrace: Refactor storage to provide efficient value semanticsBrad King2016-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit v3.4.0-rc1~321^2~2 (Genex: Store a backtrace, not a pointer to one, 2015-07-08) we treat cmListFileBacktrace instances as lightweight values. This was true at the time only because the backtrace information was kept in the cmState snapshot hierarchy. However, that forced us to accumulate a lot of otherwise short-lived snapshots just to have the backtrace fields available for reference by cmListFileBacktrace instances. Recent refactoring made backtrace instances independent of the snapshot hierarchy to avoid accumulating short-lived snapshots. This came at the cost of making backtrace values heavy again, leading to lots of string coying and slower execution. Fix this by refactoring cmListFileBacktrace to provide value semantics with efficient shared storage underneath. Teach cmMakefile to maintain its call stack using an instance of cmListFileBacktrace. This approach allows the current backtrace to be efficiently saved whenever it is needed. Also teach cmListFileBacktrace the notion of a file-level scope. This is useful for messages about the whole file (e.g. during parsing) that are not specific to any line within it. Push the CMakeLists.txt scope for each directory and never pop it. This ensures that we always have some context information and simplifies cmMakefile::IssueMessage. Push/pop a file-level scope as each included file is processed. This supersedes cmParseFileScope and improves diagnostic message context information in a few places. Fix the corresponding test cases to expect the improved output.
* Tests: Add case for package version file unmatched policy scopeBrad King2015-11-2411-0/+22
|
* Cygwin: Avoid legacy warnings in RunCMake.* testsBrad King2013-08-131-1/+1
| | | | | | Set the minimum required version of CMake high enough to avoid the warning for CMAKE_LEGACY_CYGWIN_WIN32. The warning appears on stderr and breaks the expected output matching.
* find_package: Test rejection of required+optional componentsBrad King2012-03-194-0/+11
|
* find_package: additional test for checking the error messageAlex Neundorf2012-03-134-0/+13
| | | | | | | | This patch adds a test which checks the error message, which is produced in the case that a Config file has set Foo_FOUND to FALSE by itself. Alex
* Use generalized RunCMake test infrastrucure for find_package testBrad King2012-03-1230-0/+274