summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/find_package
Commit message (Collapse)AuthorAgeFilesLines
* 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