summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Source: Avoid comparing pointers to nullptrVitaly Stakhovsky2024-08-271-1/+1
|
* find_package(): Debug re-rooting behaviorKyle Edwards2024-08-021-1/+1
| | | | | | find_package()'s debug mode provides information about which prefixes are searched, but not which roots are prepended to each prefix. Display this information if debugging is enabled.
* FindBoost: Add policy to remove this moduleBrad King2024-05-031-0/+1
| | | | | | | | | | Upstream Boost 1.70 and above provide a proper `BoostConfig.cmake` package configuration file. Packages for all major distros now provide it in at least one LTS release. Add a policy to pretend that the `FindBoost` module does not exist so that projects calling `find_package(Boost)` use the upstream package directly. Closes: #19402
* Merge topic 'save-restore-PACKAGE_PREFIX_DIR'Brad King2024-04-221-0/+30
|\ | | | | | | | | | | | | | | | | | | | | | | | | 41f4e1c457 CMakePackageConfigHelpers: Document PACKAGE_PREFIX_DIR for public use c5231ba29e find_package: Save/restore PACKAGE_PREFIX_DIR 8ac7958e3a generate_apple_*_selection_file: Save/restore PACKAGE_PREFIX_DIR bf88879f1f generate_apple_architecture_selection_file: Avoid early returns a4ac2c92f4 Help: Add missing section heading for apple architecture selection b7fcc44be9 Help: Fix CMakePackageConfigHelpers typos, grammar and formatting f1cacaa830 Tests/RunCMake/CMakePackage: Define variable closer to where it is used Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9430
| * find_package: Save/restore PACKAGE_PREFIX_DIRCraig Scott2024-04-191-0/+30
| | | | | | | | | | | | | | | | | | | | | | Package configuration files generated by `configure_package_config_file` set this variable in `@PACKAGE_INIT@` and then use it later. There may be intervening calls to `find_package`, e.g., via `find_dependency`. If the loaded package also used `configure_package_config_file`, it may change the value of `PACKAGE_PREFIX_DIR`. Explicitly save and restore the value to avoid this. Fixes: #25827
* | Source: Use cmValue::IsOn and IsOffVitaly Stakhovsky2024-03-171-4/+4
|/ | | | Speed up a bit by calling members directly.
* install(EXPORT): Export find_dependency() callsKyle Edwards2023-11-131-0/+2
| | | | | | Issue: #20511 Co-Authored-by: Brad King <brad.king@kitware.com> Co-Authored-by: Robert Maynard <rmaynard@nvidia.com>
* IWYU: Update for Debian 12 CI jobBrad King2023-07-281-1/+0
| | | | | | `include-what-you-use` diagnostics, in practice, are specific to the environment's compiler and standard library. Update includes to satisfy IWYU for our CI job under Debian 12.
* AddCacheEntry: Suppress raw pointer usageMarc Chevrier2023-05-301-1/+1
|
* SetProperty: suppress raw pointer usageMarc Chevrier2023-05-261-5/+5
|
* CMake code rely on cmList class for CMake lists management (part. 2)Marc Chevrier2023-04-291-21/+12
|
* CMake code rely on cmList class for CMake lists management (part. 1)Marc Chevrier2023-04-241-1/+2
|
* FindPython{Interp,Libs}: Add policy to remove these modulesBrad King2023-03-301-0/+2
| | | | | | The `FindPythonInterp` and `FindPythonLibs` modules have been deprecated since CMake 3.12. Add a policy to pretend they do not exist in order to encourage projects to port to `FindPython` or `FindPython{2,3}`.
* find_package: Ensure root path stack and module vars are restoredCraig Scott2023-03-171-12/+50
| | | | Fixes: #24595
* Merge topic 'recursion-limit'Brad King2023-03-141-0/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 49167cf68f Source: Adjust stack sizes and recursion limits to work together 9504cef8c4 Tests: Allow RunCMake.MaxRecursionDepth to test public-facing default limit 60ef076bac find_package: Enforce maximum nesting depth below maximum recursion depth 89b69bf1ad Add CMAKE_MAXIMUM_RECURSION_DEPTH environment variable 395895bda7 cmMakefile: Factor out helper to get recursion depth limit 88bc8dfc14 cmMakefile: Store recursion depth limit as size_t fcad8d0630 cmMakefile: Improve parsing of CMAKE_MAXIMUM_RECURSION_DEPTH variable 497f7d5c1a Tests: Simplify option passing to RunCMake.MaxRecursionDepth cases Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8307
| * find_package: Enforce maximum nesting depth below maximum recursion depthBrad King2023-03-131-0/+15
| | | | | | | | | | | | The stack usage for nested `find_package` calls is much larger than for other kinds of recursion, so enforce a lower limit to avoid stack overflow.
* | FindCUDA: Add policy to remove this moduleBrad King2023-03-091-0/+1
|/ | | | | | The `FindCUDA` module has been deprecated since CMake 3.10. Add a policy to pretend it doesn't exist in order to encourage projects to port away from it.
* Dart,FindDart: Add policy to remove these modulesBrad King2023-02-281-0/+1
| | | | | These modules and the "DART" tool they support have long been replaced by CTest.
* find_package: Use <PACKAGENAME>_ROOT variables as search prefixesBrad King2023-02-231-0/+43
| | | | | | | | | Extend commit eb35d8884b (find_package: Use PackageName_ROOT variables as search prefixes, 2018-03-15, v3.12.0-rc1~349^2) to also check upper-case `<PACKAGENAME>_ROOT` variables. Add policy `CMP0144` to enable the behavior in a compatible way. Fixes: #24403
* cmFindPackageCommand: Refactor CMP0074 logic to de-duplicate lookupsBrad King2023-02-231-8/+22
|
* cmFindPackageCommand: Factor out methods for package root stack managementBrad King2023-02-231-31/+38
|
* cmValue: Use operator* explicitly to convert to std::string; avoid extra callVitaly Stakhovsky2023-01-161-1/+1
|
* LCC: Update -Wunused-variable warning number as of LCC 1.26.16makise-homura2022-12-081-0/+7
|
* cmFindPackageCommand: Suppress LCC false-positive warningBrad King2022-10-131-0/+7
| | | | | | | Extend the LCC warning suppression from commit 08e7fb3cfa (cmFindPackageCommand: Compile-time path generator expressions, 2022-07-05, v3.25.0-rc1~361^2~5) to cover a new number for the same warning, now produced by LCC 1.26.15.
* cmFindPackageCommand: Protect overrides of `cmDirectoryListGenerator`Alex Turbov2022-08-041-0/+2
| | | | Move virtual function overrides into a protected section of class.
* cmFindPackageCommand: Add one more search pathAlex Turbov2022-08-041-4/+10
| | | | | | The `PREFIX/(Foo|foo|FOO).*/(cmake|CMake)/(Foo|foo|FOO).*/` search path is the similar to the one already exists `PREFIX/(Foo|foo|FOO).*/(lib/ARCH|lib*|share)/cmake/(Foo|foo|FOO).*/`.
* cmFindPackageCommand: Optimize the last calls to `TryGeneratedPaths`Alex Turbov2022-08-021-18/+6
|
* cmFindPackageCommand: Path generators are actually reusableAlex Turbov2022-08-021-76/+40
|
* cmFindPackageCommand: Better names for template parametersAlex Turbov2022-08-021-14/+17
|
* cmFindPackageCommand: Rename some generatorsAlex Turbov2022-08-021-72/+77
| | | | | | | | The point is that `cmFileListBlahBlahGenerator` actually "generate" directory names and never files. The `cmBlahBlahStringGenerators` produce paths in fact. Ok, paths nowadays are also strings but...
* cmFindPackageCommand: Deduplicate directory listing codeAlex Turbov2022-08-021-65/+58
| | | | | | | | The `cmFileListGeneratorProject` and `cmFileListGeneratorMacProject` was look very similar 'cept few lines. Now they have a base class and the generator-specific logic has moved to overrides.
* cmFindPackageCommand: Compile-time path generator expressionsAlex Turbov2022-08-021-496/+434
| | | | | | | | | Original code had path generators built at run-time using a linked list of dynamically allocated nodes each of which was responsible to generate a path segment. However, the combination of used generators is totally well known at compile time.
* cmFindPackageCommand: Avoid friendship between command class and generatorAlex Turbov2022-07-111-21/+34
|
* cmFindPackageCommand: Drop dead codeAlex Turbov2022-07-111-8/+2
| | | | | | | | | | | The `cmFindPackageFileList` instances always constructed w/ the only parameter. The boolean flag is always `true` (default value). Also, `cmFindPackageCommand::InitialPass` adds an empty string to the `cmFindPackageCommand::SearchPathSuffixes` vector. Meaning that `cmFindPackageCommand::CheckDirectory()` gonna be called for the suffix-less path, so `cmFindPackageFileList::Visit` may call only `cmFindPackageCommand::SearchDirectory` and get the same result.
* cmFindPackageCommand: Move methods implementation into the class definitionAlex Turbov2022-07-111-25/+18
|
* cmFindPackageCommand: Drop redundant `std::ostream::operator<<` callsAlex Turbov2022-07-111-9/+8
|
* cmFindPackageCommand: Use `vector` instead of `set` to store arg indicesAlex Turbov2022-07-111-18/+18
| | | | | | They are unique by design. I.e., when the algorithm iterates over args doing only one push per iteration indices gonna be unique ;-) So, no need for `std::set` here.
* cmFindPackageCommand: Move comment inside the `else if` blockAlex Turbov2022-07-111-4/+3
|
* cmFindPackageCommand: Named lambda w/o capture to normal functionAlex Turbov2022-07-111-12/+12
|
* cmFindPackageCommand: ConstnessAlex Turbov2022-07-111-62/+66
|
* cmFindPackageCommand: Enclose file list generators into anonymous nsAlex Turbov2022-07-111-22/+27
|
* cmFindPackageCommand: Move `cmFindPackageCommandHoldFile` to anonymous nsAlex Turbov2022-07-111-29/+35
| | | | Also, avoid `#include` in the middle of the module.
* cmFindPackageCommand: Move `collectPathsForDebug()` to anonymous namespaceAlex Turbov2022-07-111-15/+15
|
* cmFindPackageCommand: Deduplicate version string comparator codeAlex Turbov2022-07-111-18/+15
|
* cmFindPackageCommand: Replace empty string literal w/ default `std::string{}`Alex Turbov2022-07-111-1/+1
|
* cmFindPackageCommand: Simplify if-return-else-return into single return stmtAlex Turbov2022-07-111-7/+1
|
* cmFindPackageCommand: Replace `strcmp` with array subscriptionAlex Turbov2022-07-111-2/+3
|
* cmFindPackageCommand: Deduplicate code to exclude `.` and `..` dir entriesAlex Turbov2022-07-111-3/+10
|
* cmFindPackageCommand: Replace single-char string literals with char literalsAlex Turbov2022-07-111-3/+3
|
* cmFindPackageCommand: Use `std::any_of` instead of "manual" `for` loopsAlex Turbov2022-07-111-24/+16
|