summaryrefslogtreecommitdiffstats
path: root/Source/cmFindLibraryCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Merge topic 'find_library-custom-lib-suffix'Brad King2017-03-021-13/+15
|\ | | | | | | | | 503f25d4 find_library: Allow custom lib suffix be used as find path
| * find_library: Allow custom lib suffix be used as find pathChristian Schmidbauer2017-03-011-13/+15
| | | | | | | | | | | | | | | | | | | | Add a new `CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX` variable to allow use of a custom suffix on `lib` directory names. This is a more general option than that added by commit v3.7.0-rc1~504^2 (Teach find_library and find_package to search lib32 paths, 2016-06-10). It allows the find path to be more deterministic on custom setups. See discussion in #10287 and #15994.
* | Merge topic 'find-libarch-not-symlink'Brad King2017-03-011-16/+48
|\ \ | |/ |/| | | | | | | 6f5aede7 find_library: Skip 'lib => lib<arch>' searches if one symlinks the other e67963ed cmFindLibraryCommand: Refactor AddArchitecturePath logic
| * find_library: Skip 'lib => lib<arch>' searches if one symlinks the otherBrad King2017-02-281-0/+22
| | | | | | | | | | | | | | | | | | | | | | The `FIND_LIBRARY_USE_LIB<arch>_PATHS` global properties ask `find_library` to look in `lib<arch>` directories automatically before corresponding `lib` directories. However, if `lib<arch>` is just a symlink to `lib` (or vice-versa) then we should skip adding the `lib<arch>` path. Such symlinks typically only exist to satisfy software that expects the `lib<arch>` path to be available. Fixes: #16687
| * cmFindLibraryCommand: Refactor AddArchitecturePath logicBrad King2017-02-281-16/+26
| | | | | | | | | | Use boolean variables to save results and rename variables to more closely represent their roles.
* | Include necessary headers in commandsDaniel Pfeifer2016-10-261-2/+9
| |
* | Separate compilation for commands included in cmBootstrapCommands1Daniel Pfeifer2016-10-211-0/+4
| |
* | cmListFileCache: Remove cmState header includeStephen Kelly2016-10-191-0/+1
| | | | | | | | | | Include it in dependents which have previously relied on it transitively.
* | cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-3/+3
|/ | | | Port dependent code to the change.
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Avoid else after returnDaniel Pfeifer2016-09-161-4/+2
|
* Teach find_library and find_package to search lib32 paths (#11260)Daniel Scharrer2016-06-101-5/+4
| | | | | | | Add a ``FIND_LIBRARY_USE_LIB32_PATHS`` global property analogous to the ``FIND_LIBRARY_USE_LIB64_PATHS`` property. This helps find commands on multilib systems that use ``lib32`` directories and either do not have ``lib`` symlinks or point ``lib`` to ``lib64``.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-188/+134
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* cmFindLibraryCommand: Avoid repeating search for the same nameBrad King2015-09-021-2/+9
| | | | | | | | In FindNormalLibraryDirsPerName we consider one name at a time and search the entire path. Avoid repeated consideration of names by removing each one from the list of candidates before considering the next one. This will not change behavior because we already know the earlier candidates were not found on repeated considering anyway.