summaryrefslogtreecommitdiffstats
path: root/Source/cmFindCommon.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Fix misc. typosluz.paz2018-06-041-2/+2
| | | | Found via `codespell` and `grep`
* find_package: Use PackageName_ROOT variables as search prefixesBrad King2018-03-161-7/+0
| | | | | | | | | | | | | | | | | | | This feature was originally added by commit v3.9.0-rc1~71^2~2 (find_*: Add a new PackageRoot search path group, 2017-05-03) and documented by commit v3.9.0-rc1~71^2 (find_*: Add docs for PackageRoot search path group, 2017-05-03). However, we had to disable the feature and remove the documentation in commit v3.9.1~2^2 (find_*: Disable the PACKAGE_ROOT search path group for CMake 3.9, 2017-08-08) due to breaking projects that used `PackageName_ROOT` variables themselves. Add policy `CMP0074` to restore the `PackageName_ROOT` variable behavior in a compatible way. Also revise the stack of root paths to store the paths themselves rather than the package names. This way the policy can be considered at the `find_package` call site instead of individual `find_` calls inside a find module. Co-Author: Chuck Atkins <chuck.atkins@kitware.com> Issue: #17144
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-1/+1
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Fix trivial typos in textluzpaz2017-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some are user facing. Found using codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt` whereby the whitelist contained: ans dum helpfull emmited emmitted buil iff isnt nto ot pathes substract te todays upto whitespaces
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-22/+16
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-2/+2
|
* find_*: Disable the PACKAGE_ROOT search path group for CMake 3.9Brad King2017-08-081-0/+7
| | | | | | | | | | | | | | | | Disable the feature added by commit v3.9.0-rc1~71^2~2 (find_*: Add a new PackageRoot search path group, 2017-05-03) and remove documentation added by commit v3.9.0-rc1~71^2 (find_*: Add docs for PackageRoot search path group, 2017-05-03). Unfortunately the name `<pkg>_ROOT` may already be set by projects for their own incompatible purposes. Disable the behavior change for now to fix the regression for CMake 3.9. We can restore it later with a policy. In order to keep the implementation and tests working, add an undocumented variable we can use in the tests to enable the behavior before the policy is introduced. Fixes: #17144
* cmFindCommon: Drop unused FilterPaths methodBrad King2017-07-111-12/+0
| | | | | | The method has not been used since commit v3.2.0-rc1~400^2~1 (Encapsulate search path manipulation functions into a seperate class, 2014-10-15).
* cmFindCommon: Fix typo in PackageName_ROOT path labelBrad King2017-07-111-1/+1
|
* Remove second arg: npos in substr usagesPavel Solodovnikov2017-06-011-1/+1
|
* Access string npos without instancePavel Solodovnikov2017-06-011-1/+1
|
* find_*: Add a new PackageRoot search path groupChuck Atkins2017-05-161-2/+10
| | | | | | The new PackageRoot search path group allows the PackageName_ROOT cmake and environment variables to be used as search prefixes for all find_* commands called from within a find module
* Merge topic 'split-sysroot'Brad King2017-05-111-1/+13
|\ | | | | | | | | | | | | 53e89b6a Add options for separate compile and link sysroots Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !819
| * Add options for separate compile and link sysrootsBrad King2017-05-091-1/+13
| | | | | | | | | | | | | | | | | | Add `CMAKE_SYSROOT_COMPILE` and `CMAKE_SYSROOT_LINK` variables to as operation-specific alternatives to `CMAKE_SYSROOT`. This will be useful for Android NDKs that compile and link with different sysroot values (e.g. `r14` with unified headers). Co-Author: Florent Castelli <florent.castelli@gmail.com>
* | cmFindCommon: remove unused function SetMakefileDaniel Pfeifer2017-05-101-12/+0
|/
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-3/+4
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-0/+1
|
* Separate compilation for commands included in cmBootstrapCommands1Daniel Pfeifer2016-10-211-0/+2
|
* 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.
* use CM_NULLPTRDaniel Pfeifer2016-06-281-2/+2
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-162/+98
| | | | | | | | | | | | | 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-14/+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.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* 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.
* Use containers of labeled search paths instead of individual membersChuck Atkins2014-11-121-20/+56
| | | | | | | Manage classes of search paths in labeled containers. This removes the need to have a seperate member variable for each type of search path, but also allows path types to be grouped togethor in various different ways and manipulated as subsets of the full set of search paths.
* Encapsulate search path manipulation functions into a seperate class.Chuck Atkins2014-11-111-122/+23
| | | | | | The functions for adding the various different types of paths have been factored out into a new class, cmSearchPath. It is to be used as a helper container class for the various find_* commands.
* Refactor and seperate search path construction for find commandsChuck Atkins2014-11-111-54/+75
| | | | | | | Prior to this commit, the set of search paths to traverse for find commands was incrementally constructed. This change allows each group of paths, i.e. CMakeVariablePaths, UserHintsPaths, SystemEnvironmentPaths, etc. to be constructed and manipulated independently, and then all combined togethor.
* strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-4/+4
| | | | | 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-4/+4
| | | | | | 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.
* stringapi: Use strings for variable namesBen Boeckel2014-03-081-1/+1
| | | | Variable names are always generated by CMake and should never be NULL.
* Introduce CMAKE_STAGING_PREFIX variable.Stephen Kelly2013-11-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This variable can be useful in cross-compiling contexts where the sysroot is read-only or where the sysroot should otherwise remain pristine. If the new CMAKE_STAGING_PREFIX variable is set, it is used instead of CMAKE_INSTALL_PREFIX when generating the installation rules in cmake_install.cmake. This way, the CMAKE_INSTALL_PREFIX variable always refers to the installation prefix on the target device, regardless of whether host==target. If any -rpath paths passed to the linker contain the CMAKE_STAGING_PREFIX, the matching path fragments are replaced with the CMAKE_INSTALL_PREFIX. Matching paths in the -rpath-link are not transformed. The cross-prefix usr-move workaround is assumed not to require extension regarding CMAKE_STAGING_PREFIX. The staging area is a single prefix, so there is no scope for cross-prefix symlinks. The CMAKE_INSTALL_PREFIX is still used to determine the workaround path, and that variable remains the relevant one even if CMAKE_STAGING_PREFIX is used. If the generated export files are deployed to the target, the workaround will still be in place, and still be employed if required.
* Add CMAKE_SYSROOT variable to set --sysroot when cross compiling.Stephen Kelly2013-11-191-2/+13
| | | | | | | | | | As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is introduced, which is never a list. The contents of this variable is passed to supporting compilers as --sysroot. It is also accounted for when processing implicit link directories reported by the compiler, and when generating RPATH information.
* cmFindCommon: Revert accidental changeBrad King2013-11-021-13/+2
| | | | | | | In commit c4373b33 (cmTarget: Make GetProperty() const, 2013-10-29) we accidentally changed the cmFindCommon.cxx logic in a way that looks like a local experiment leftover that went unnoticed due to the size of the other changes in the commit. Revert it.
* cmTarget: Make GetProperty() const.Stephen Kelly2013-10-311-2/+13
| | | | | | This has follow-on effects for other methods and classes. Further work on making the use of const cmTarget pointers common can be done, particularly with a view to generate-time methods.
* Drop builtin command documentationBrad King2013-10-161-49/+0
| | | | | Drop all GetTerseDocumentation and GetFullDocumentation methods from commands. The command documentation is now in Help/command/*.rst files.
* Revert "Use --sysroot when cross compiling."Stephen Kelly2013-07-121-20/+4
| | | | | | | This reverts commit de4da665d3205afa239749c41513a315c3831f51. This feature is not yet ready for release. It needs to be merged with the CMAKE_OSX_SYSROOT feature.
* Use --sysroot when cross compiling.Stephen Kelly2013-06-071-4/+20
| | | | | | | | | | As CMAKE_ROOT_FIND_PATH can be a list, a new CMAKE_SYSROOT is introduced, which is never a list. The contents of this variable is passed to supporting compilers as --sysroot. It is also accounted for when processing implicit link directories reported by the compiler, and when generating RPATH information.
* Refactor find_* command final path list computationBrad King2011-09-231-1/+6
| | | | | | | All find_* commands re-root the list of paths and then add trailing slashes. Factor this pair of calls out into a dedicated method. The new method would be the only caller to AddTrailingSlashes, so subsume that method into it.
* Speedup find_* commands (#11412)Brad King2010-11-121-0/+4
| | | | | | | 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>
* Teach find_* commands to ignore some pathsTodd Gamblin2010-08-131-0/+57
| | | | | | | | Add platform configuration variable CMAKE_SYSTEM_IGNORE_PATH and user configuration variable CMAKE_IGNORE_PATH. These specify a set of directories that will be ignored by all the find commands. Update FindPackageTest so that several cases will fail without a functioning CMAKE_IGNORE_PATH.
* -improve crosscompiling from Linux to iphone (#10526)Alex Neundorf2010-05-011-0/+14
| | | | | | Patch by Karol Krizka Alex
* Create cmMakefile::PlatformIs64Bit helper methodBrad King2009-09-301-7/+3
| | | | This method centralizes tests for whether CMAKE_SIZEOF_VOID_P is 8.
* 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.
* some white space fixes for the bookKen Martin2009-09-031-2/+2
|
* ENH: undo bad checkinBill Hoffman2008-10-031-9/+0
|
* STYLE: fix line length issuesBill Hoffman2008-10-021-1/+9
|
* ENH: Add HINTS option to find_* commands.Brad King2008-06-091-9/+10
| | | | | | - Hints are searched after user locations but before system locations - The HINTS option should have paths provided by system introspection - The PATHS option should have paths that are hard-coded guesses
* ENH: In find_* implementation centralize addition of trailing slashesBrad King2008-06-091-0/+15
| | | | | | - Create cmFindCommon::AddTrailingSlashes - Use it in cmFindBase and cmFindPackageCommand - Remove duplication from other find commands
* ENH: Refactor cmFindCommon, cmFindBase, and cmFindPackageCommandBrad King2008-06-051-93/+33
| | | | | | | | | | | - Add each part of the search order in a separate method. - Collect added paths in an ivar in cmFindCommon. - Move user path storage up to cmFindCommon and share between cmFindBase and cmFindPackageCommand. - Expand user path registry values up in cmFindCommon - Enables 32-/64-bit registry view for find_package - Disables registry expansion for paths not specified with the PATHS argument, which is not expected.
* ENH: Major improvements to the FIND_PACKAGE command. See bug #3659.Brad King2008-01-171-0/+479
- 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.