summaryrefslogtreecommitdiffstats
path: root/Source/cmFindLibraryCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* find_*: support suppressing implicit transition eventsBen Boeckel2025-06-111-1/+3
| | | | | | | When projects explicitly unset variables, the transition detection can end up reporting events when they are not desired. See: #24833
* cmFindCommon: always track configure log informationBen Boeckel2025-06-091-3/+2
| | | | | This does mean that debug state is always around, so instead gate the non-configure log information behind a dedicated variable.
* cmStrCat: use character literals where possibleBen Boeckel2025-05-151-3/+3
| | | | | Found and replaced using the `cmstrcat-to-char-literal` rule for `ast-grep`.
* cmFindCommon: track debug state as an objectBen Boeckel2025-04-291-14/+17
| | | | | This also means that the `DebugState` instances do not need to ask if debug mode is enabled: if they exist, it is enabled.
* cmFindCommon: use `DebugModeEnabled` to query for debug modeBen Boeckel2025-04-291-3/+3
| | | | This simplifies changing how debug mode is represented.
* cmFindBaseDebugState: get the command name directly from the objectBen Boeckel2025-04-291-6/+5
|
* cmFindBase: Track initial state with an `enum`Ben Boeckel2025-04-281-1/+1
| | | | | | | | | When logging a `WriteFindBaseEvent`, one of the triggers to log is the change in the "found" status of a `find_` command. Track the difference between "undefined", "found", and "tried before, but not found" so that the transition can be detected reliably. Co-Authored-by: Ryan Krattiger <ryan.krattiger@kitware.com>
* LICENSE: Replace references to Copyright.txt with LICENSE.rstKitware Robot2025-03-031-1/+1
| | | | | | | | | | ``` git grep -lz 'Copyright.txt or https://cmake.org/licensing ' | while IFS= read -r -d $'\0' f ; do sed -i '/Copyright.txt or https:\/\/cmake.org\/licensing / { s/Copyright.txt/LICENSE.rst/ }' "$f" ; done ```
* Revise C++ coding style using clang-format with "east const"Kitware Robot2025-01-231-6/+6
| | | | | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`, now with "east const" enforcement. Use `clang-format` version 18. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit. Issue: #26123
* find_library: Handle case-insensitive filesystems on LinuxRussell Greene2024-12-111-29/+65
| | | | | | | Linux 5.2+ supports case-insensitive ext4 filesystems. Teach `find_library` pattern matching to account for this. Fixes: #26526
* find_*: Explicitly normalize found paths as they exist on diskBrad King2024-10-221-11/+10
|
* cmFind*Command: Simplify file validation code pathsBrad King2024-10-221-5/+2
|
* cmFind*Command: Store candidate paths as local variablesBrad King2024-10-221-10/+7
|
* Source: Restore compilation on OpenBSDRafael Sadowski2024-01-051-4/+4
| | | | We cannot use `OpenBSD` as a name, it is defined in `sys/param.h`.
* find_library(): Add support for .xcframeworkKyle Edwards2023-07-281-0/+16
| | | | Issue: #21752
* find_library: Improve regex readability in --debug-find outputThomas Schenker2023-07-131-2/+8
| | | | | If there is only one possible library prefix/suffix, omit the capture group around it in the debug output.
* CMake code rely on cmList class for CMake lists management (part. 2)Marc Chevrier2023-04-291-8/+8
|
* find_(program,library,file,path): add validation functionMarc Chevrier2022-06-141-7/+26
| | | | Fixes: #23603
* cmake: Add filtered debug-find optionsJohn Parent2021-12-171-1/+2
| | | | | | | | | | 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
* Source: Fix clang -Wextra-semi warningsSean McBride2021-09-281-2/+2
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-4/+4
|
* find_library: Infer library prefix and suffix when in script modeRobert Maynard2021-07-191-4/+31
| | | | | | | | | | | This aligns `find_library` with the documentation that states it can be called from script mode. This is done by infering the proper prefix and suffix values when `find_library` is called when the `CMAKE_FIND_LIBRARY*` are not set. This also means that `find_library` won't produce obscure error messages about unset definitions. Fixes: #22027
* find_*: Add support for option NO_CACHEMarc Chevrier2021-06-021-1/+1
| | | | | | | | Request that find result is stored in a normal variable rather than a cache entry. Fixes: #20687 Issue: #20743
* find_*: refactor cache variable handlingMarc Chevrier2021-05-111-34/+13
|
* Source: Reduce c_str() usagevvs314152021-03-131-1/+1
|
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-1/+1
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-2/+3
|
* find_library: Check that library files are readableBrad King2020-06-291-1/+2
| | | | | | | | | Refactoring in commit 6b85166920 (ENH: Refactor find_library search logic, 2008-09-22, v2.8.0~1665) dropped a call to `FileExists` on the path under the assumption that the presence of a file in a directory listing means it exists. However, dropping that also dropped a check that verifies the file is readable. Restore the `FileExists` call to ensure that we only find readable libraries.
* cmMakefile::AddCacheDefinition: Add overload that accepts std::string valueVitaly Stakhovsky2020-03-111-2/+2
|
* find_*: Add support for REQUIRED keywordSylvain Joubert2020-03-061-0/+8
| | | | | | In the same spirit as the REQUIRED keyword on find_package, this will stop cmake execution with an error on a failed find_program, find_file, find_path or find_library.
* find_*: Use debug logging infrastructureRobert Maynard2019-12-191-5/+63
| | | | | | 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.
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-1/+2
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-2/+2
|
* cmFind*: Port away from cmCommandRegina Pfeifer2019-09-101-3/+9
|
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-1/+1
|
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-12/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-2/+3
|
* cleanup: Prefer compiler provided special member functionsRegina Pfeifer2019-01-251-1/+0
|
* clang-tidy: Use `= default`Regina Pfeifer2019-01-251-1/+1
| | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* IWYU: Update CMake code for IWYU built with Clang 6Brad King2019-01-151-0/+1
| | | | | IWYU now correctly requires `<utility>` for `std::move`. It also requires a container header when used via a range-based for loop.
* clang-tidy: Use default member initializationRegina Pfeifer2018-12-151-5/+2
|
* cmMakefile: Make GetRequiredDefinition return std::stringVitaly Stakhovsky2018-09-051-2/+2
| | | | | | | In all cases the return value is converted to std::string anyway. Also remove unnecessary `c_str()` calls in arguments to `GetRequiredDefinition`.
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-1/+1
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-2/+2
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Fix minor clang-tidy findingsMatthias Maennich2017-09-281-1/+1
| | | | | | | | | | | Fix issues diagnosed by clang-tidy - modernize-use-bool-literals - misc-string-integer-assignment - performance-faster-string-find - readability-redundant-string-cstr - readability-delete-null-pointer Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Replace empty-string comparisons with checking against `empty()`.Pavel Solodovnikov2017-09-211-2/+2
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-43/+25
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Access string npos without instancePavel Solodovnikov2017-06-011-1/+1
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Add support for x32-abiSteven Newbury2017-03-071-1/+8
| | | | | | | | Detect x32-abi through CMakeCompilerABI infrastruture and use this information at runtime to determine the correct library paths with `FIND_LIBRARY_USE_LIBX32_PATHS`. Fixes: #15994