summaryrefslogtreecommitdiff
path: root/Source/cmFindPathCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* find_(program,library,file,path): add validation functionMarc Chevrier2022-06-141-2/+4
| | | | Fixes: #23603
* find_file: Fix blank line instead of framework path in debug outputCraig Scott2022-03-011-3/+8
| | | | | | There's no point printing a blank line if FindHeaderInFramework() returns an empty string. Pass in the debug object to that function instead so it can record the actual paths it tests in the debug output directly.
* 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
* 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-33/+16
|
* clang-tidy: fix `readability-make-member-function-const` warningsBen Boeckel2021-01-271-2/+2
|
* 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::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/+12
| | | | | | 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.
* cmFind*: Port away from cmCommandRegina Pfeifer2019-09-101-3/+9
|
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-11/+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)`
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-2/+2
| | | | | | | | | | * 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.
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-161-1/+1
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-14/+8
| | | | | | 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-2/+2
|
* 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'
* clang-tidy: apply performance-faster-string-find fixesDaniel Pfeifer2016-12-121-2/+2
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-1/+5
|
* Separate compilation for commands included in cmBootstrapCommands1Daniel Pfeifer2016-10-211-0/+2
|
* cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-3/+4
| | | | 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-2/+1
|
* find_path: Fix location of <dir/header.h> in a framework on OS XHarry Mallon2016-06-071-1/+1
| | | | | | | After finding it in `foo.Framework/Headers/dir/header.h`, we should report the `foo.Framework/Headers` directory, not `foo.Framework/Headers/dir`, because the former is what actually contains the path the caller wishes to include.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-88/+57
| | | | | | | | | | | | | 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-3/+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.
* cmState: Move CacheEntryType enum from cmCacheManager.Stephen Kelly2015-04-131-4/+3
|
* Replace foo.size() pattern with !foo.empty().Stephen Kelly2015-01-181-2/+2
|
* Replace 'foo.size() != 0' pattern with !foo.empty().Stephen Kelly2015-01-181-1/+1
|
* strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-1/+1
| | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
* Remove some c_str() calls.Stephen Kelly2014-03-111-3/+3
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* strings: Remove cmStdString referencesBen Boeckel2014-03-081-5/+5
| | | | | | | | | | | Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
* Drop builtin command documentationBrad King2013-10-161-45/+0
| | | | | Drop all GetTerseDocumentation and GetFullDocumentation methods from commands. The command documentation is now in Help/command/*.rst files.
* Teach find_(path|file) about Linux multiarch (#13742)Brad King2012-11-261-2/+4
| | | | | | | | | | | Implement support for multiarch include directories as specified here: https://wiki.ubuntu.com/MultiarchCross Generalize the multiarch feature added in commit b41ad3b3 (Teach find_(library|package) about Linux multiarch, 2011-06-08) to the find_path and find_file commands. Teach them to search <prefix>/include/<arch> whenever they would search <prefix>/include.
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-4/+4
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* Teach find_(library|package) about Linux multiarch (#12037)Brad King2011-06-081-0/+2
| | | | | | | | | | | | | Implement support for multiarch as specified here: http://wiki.debian.org/Multiarch https://wiki.ubuntu.com/MultiarchSpec Detect the <arch> part of <prefix>/lib/<arch> from the implicit library search path from each compiler to set CMAKE_<lang>_LIBRARY_ARCHITECTURE. Define CMAKE_LIBRARY_ARCHITECTURE using one of these values (they should all be the same). Teach the find_library and find_package commands to search <prefix>/lib/<arch> whenever they would search <prefix>/lib.
* Speedup find_* commands (#11412)Brad King2010-11-121-14/+11
| | | | | | | Delay computation of the command documentation until it is needed. It is wasteful to do it in the constructor on every call. Inspired-By: Christian Ehrlicher <Ch.Ehrlicher@gmx.de>
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* ENH: Improve framework search speed for find_file and find_pathBrad King2008-06-091-2/+2
| | | | | | | - Locating a header inside a framework often requires globbing - Previously the glob was <dir>/*/Headers/<name> - Now the glob is <dir>/*.framework/Headers/<name> - This is much faster when <dir> is not really a framework dir
* ENH: Refactor find_* command framework/appbundle search order impl.Brad King2008-06-091-52/+79
| | | | | | | | | | | - CMAKE_FIND_FRAMEWORK and CMAKE_FIND_APPBUNDLE are supposed to specify whether to find frameworks/appbundles FIRST, LAST, ONLY, or NEVER. - Previously this affected only the placement of CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH with respect to the other path specifiers. - Now it behaves as documented. The entire search path is inspected for each kind of program, library, or header before trying the next kind. - Additionally the ONLY mode is now honored for headers so that users do not end up with a library in framework and a header from elsewhere.
* ENH: In find_* implementation centralize addition of trailing slashesBrad King2008-06-091-10/+0
| | | | | | - Create cmFindCommon::AddTrailingSlashes - Use it in cmFindBase and cmFindPackageCommand - Remove duplication from other find commands
* ENH: add return and break support to cmake, also change basic command ↵Ken Martin2008-01-231-1/+2
| | | | invocation signature to be able to return extra informaiton via the cmExecutionStatus class
* BUG: Fix previous commit to not access empty strings out of bounds.Brad King2008-01-201-1/+1
|
* BUG: Make sure search paths never have double-slashes. Leading with two ↵Brad King2008-01-201-3/+11
| | | | slashes (//) on cygwin looks like a network path and delays while waiting for a non-existent machine.
* ENH: Major improvements to the FIND_PACKAGE command. See bug #3659.Brad King2008-01-171-0/+6
| | | | | | | | | - Use CMAKE_PREFIX_PATH and CMAKE_SYSTEM_PREFIX_PATH among other means to locate package configuration files. - Create cmFindCommon as base for cmFindBase and cmFindPackageCommand - Move common functionality up to cmFindCommon - Improve documentation of FIND_* commands. - Fix FIND_* commands to not add framework/app paths in wrong place.
* BUG: fix for bug 6039 LIB and INCLUDE not used for find stuffBill Hoffman2007-12-141-0/+1
|
* ENH: add support for CMAKE_FIND_PREFIX_PATH as discussed with Brad.Alexander Neundorf2007-10-261-0/+2
| | | | | | | | CMAKE_FIND_PREFIX_PATH is both an environment variable and a cmake variable, which is a list of base directories where FIND_PATH, FIND_FILE, FIND_PROGRAM and FIND_LIBRARY will search in the respective subdirectories Alex
* ENH: make commands lower case by defaultKen Martin2007-10-101-1/+1
|
* ENH: add cmExternalMakefileProjectGenerator, which should make it easier toAlexander Neundorf2007-06-081-0/+4
| | | | | | | | | write generators for IDE projects, which use already existing makefiles (current the kdevelop generator) -first stept of the export interface, iniitial export() command -more replacements for the FIND_XXX docs Alex
* BUG: If the user specifies a cache entry on the command line without a type, ↵Brad King2006-07-181-0/+12
| | | | the FIND_* commands should add the type and docstring to the given value and put it back in the cache.