summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Source: Replace uses of sprintf with safer snprintfSean McBride2022-06-221-4/+4
|
* cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-1/+1
| | | | | | | | Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to 's_ErrorOccurred' and 's_FatalErrorOccurred', respectively. Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and 'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
* Dependency providers: Add find_package and FetchContent supportCraig Scott2022-05-241-1/+48
| | | Fixes: #22619
* cmFindPackageCommand: Handle Makefile variable definitions more robustlyCraig Scott2022-05-171-10/+16
| | | | | | | | | | | | | | | | | | | During argument parsing in InitialPass(), Makefile variables were being added for components. Most other such variables were set in the call to SetModuleVariables(), which happens much later. Both sets of variables were then restored to their previous values as part of a call to AppendSuccessInformation(), but that is not an obvious nor robust place to undo those variable changes. InitialPass() also pushes a new item to the package root stack, but the corresponding pop was in AppendSuccessInformation(). Again, this puts a symmetric operation in an asymmetric place. Refactor the code slightly such that Makefile variables are set in one clear location, then restored later in the same function. Also move the package root stack pop into the same function as the push. AppendSuccessInformation() now has one clear responsibility and doesn't perform any unrelated cleanup on behalf of InitialPass().
* Merge topic 'FetchContent_find_package_integration'Craig Scott2022-05-061-7/+91
|\ | | | | | | | | | | | | | | | | 29e31e2825 Packages: Integrate FetchContent and find_package() Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: huangqinjin <huangqinjin@gmail.com> Merge-request: !5688
| * Packages: Integrate FetchContent and find_package()Craig Scott2022-05-031-7/+91
| | | | | | | | | | | | | | | | Allow FetchContent_MakeAvailable() to try a call to find_package() first, or redirect a find_package() call to FetchContent_MakeAvailable(). The user can set variables to control which of these are allowed or tried by default. Fixes: #21687
* | find_* commands: add control over Windows registry viewsMarc Chevrier2022-04-291-0/+21
|/ | | | Fixes: #22775