summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.h
Commit message (Collapse)AuthorAgeFilesLines
* find_package: Ensure root path stack and module vars are restoredCraig Scott2023-03-171-0/+5
| | | | Fixes: #24595
* cmFindPackageCommand: Factor out methods for package root stack managementBrad King2023-02-231-0/+3
|
* cmFindPackageCommand: Avoid friendship between command class and generatorAlex Turbov2022-07-111-2/+0
|
* Dependency providers: Add find_package and FetchContent supportCraig Scott2022-05-241-0/+1
| | | Fixes: #22619
* cmFindPackageCommand: Handle Makefile variable definitions more robustlyCraig Scott2022-05-171-1/+3
| | | | | | | | | | | | | | | | | | | 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-0/+3
|\ | | | | | | | | | | | | | | | | 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-0/+3
| | | | | | | | | | | | | | | | 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/+1
|/ | | | Fixes: #22775
* find_package: Add support for default GLOBAL imported targetsJohn Parent2022-03-101-0/+1
| | | | | | | | | Allow find package to promote scope of imported targets by specifying an argument to `find_package` or by specifying a CMake variable. * Add support for CMAKE_GLOBAL_IMPORT_SCOPE variable * Add support for GLOBAL argument to find_package Additionally add testing for above features.
* cmFindPackageCommand: Drop ComputeIfDebugModeWanted overloadBrad King2022-02-101-2/+0
| | | | | | The overload for `--debug-find-pkg` has the same signature as the base class method for `--debug-find-var`. To avoid confusion, drop the overload and inline it its only call site.
* find_*(): Add CMAKE_IGNORE_PREFIX_PATH variableKyle Edwards2022-02-021-0/+1
| | | | Fixes: #20878
* cmake: Add filtered debug-find optionsJohn Parent2021-12-171-0/+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_package: Add support of version rangeMarc Chevier2020-09-231-0/+13
| | | | This enhancement is the first step for solving issue #21107
* cmFindPackageCommand: RefactoringMarc Chevrier2020-09-231-26/+34
| | | | | | * Use member initialisation at declaration * AddFindDefinition: same signature as cmMakefile::AddDefinition for consistency * Factorise version variables creation
* Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
| | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* Refactoring: Third-parties public headers are under cm3p prefixMarc Chevrier2020-05-071-1/+1
| | | | Fixes: #20666
* find_package: Improve debug logging outputRobert Maynard2020-01-011-0/+1
| | | | | The find_package debug log messages are now easier to read when enabled by the `--debug-find` command-line option or `CMAKE_FIND_DEBUG_MODE` variable.
* find_*: Use debug logging infrastructureRobert Maynard2019-12-191-1/+0
| | | | | | 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.
* cmFind*: Port away from cmCommandRegina Pfeifer2019-09-101-20/+7
|
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-2/+2
|
* modernize: manage cmCommand instances using unique_ptr.Marc Chevrier2019-07-141-2/+7
|
* find_package: Fixed CMAKE_FIND_PACKAGE_PREFER_CONFIG Module fallbackCristian Adam2019-06-131-1/+8
| | | | Fixes: #19361
* find_package: Factor out module and config find_package methodsCristian Adam2019-05-201-0/+3
|
* ReadListFile: Accept std::string argumentVitaly Stakhovsky2019-01-311-1/+1
|
* find_package: optionally resolve symlinks when discovering packagesDavid Aguilar2019-01-161-0/+1
| | | | | | | | | Teach find_package() to resolve symlinks when constructing relocatable prefix paths from discovered cmake config files. The `CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS` variable enables this behavior when set to `TRUE`. Fixes: #18704
* find_package(): Add policy to remove the FindQt moduleKyle Edwards2018-11-141-0/+3
| | | | | | | | Removing FindQt.cmake gives Qt upstream a path forward to export its own QtConfig.cmake files which can be found by find_package() without having to explicitly specify CONFIG. Projects that still want to use Qt3/4 can call find_package(Qt[34]), include(FindQt), or add FindQt.cmake to their CMAKE_MODULE_PATH.
* IWYU: Fix workaround mapping for std::hashBrad King2018-08-071-3/+2
| | | | | | | | | It is provided by `functional`, not `utility`. Fix the mapping added by commit 276d3c7afe (IWYU: Add workaround mapping for std::hash, 2018-07-31). Also generalize the workaround from commit v3.12.0-rc1~39^2~1 (IWYU: Define a macro to tell code it is preprocessing for iwyu, 2018-05-25) to allow local builds to configure specific flags. This is needed because iwyu behaves differently in different environments.
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-1/+1
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * 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.
* cmAlgorithms: Speed up cmRemoveDuplicates methodLe Minh Phuc2018-05-251-0/+32
| | | | | | Use a hash table instead of a sorted vector to track entries. Co-authored-by: Chu Qinghao <me@qinghao1.com>
* Use C++11 override instead of CM_OVERRIDEBrad King2017-09-151-2/+2
| | | | | | | | We now require C++11 support including `override`. Drop use of the old compatibility macro. Convert references as follows: git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' | xargs sed -i 's/CM_OVERRIDE/override/g'
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+1
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* find_package: Add missing PACKAGE_ROOT_PATH search path implementation.Chuck Atkins2017-07-281-0/+1
|
* cmCommand: remove unused methods from interface and all implementationsDaniel Pfeifer2017-05-111-5/+0
|
* cmCommand: remove IsScriptableDaniel Pfeifer2017-05-081-5/+0
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-2/+2
| | | | | | | | | | | | | 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'
* cmConfigure: Ensure separate include block in headersDaniel Pfeifer2017-04-111-0/+1
| | | | | | | | | | | Make sure that `#include <cmConfigure.h>` is followed by an empty line in header files. This is necessary to make sure that changing <> to "" does not affect the include ordering of clang-format. Automate with: git grep -l '#include <cmConfigure.h>' | grep -v '.cxx$' \ | xargs sed -i '/#include <cmConfigure.h>/ { N; N; s/\n\{1,2\}/\n\n/ }'
* Add support for x32-abiSteven Newbury2017-03-071-0/+1
| | | | | | | | 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
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-1/+10
|
* Make cmCommand not inherit from cmObjectDaniel Pfeifer2016-10-221-2/+0
|
* 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.
* find_package: Optionally sort globbed directories in a meaningful orderPierluigi Taddei2016-09-151-0/+26
| | | | | | | | | | | | Add `CMAKE_FIND_PACKAGE_SORT_{ORDER,DIRECTION}` variables to specify sort order and direction. When multiple package with the same name have been found in the same location sorting option can be used to force a specific version to be loaded (e.g. libA_1.12.0 instead of libA_1.1.0). Currently sorting by NAME and by NATURAL order have been implemented. Natural ordering makes use of the `strverscmp(3)` ordering.
* mark functions with CM_OVERRIDEDaniel Pfeifer2016-06-271-5/+5
|
* Merge topic 'find_package-duplicate-search-paths'Brad King2016-06-161-0/+15
|\ | | | | | | | | | | 919db25c cmFindPackageCommand: remove duplicate paths from error message ebf18df5 cmFindPackageCommand: use iterators to loop over configurations
| * cmFindPackageCommand: remove duplicate paths from error messageBen Boeckel2016-06-131-0/+15
| | | | | | | | Fixes #15252.
* | Teach find_library and find_package to search lib32 paths (#11260)Daniel Scharrer2016-06-101-0/+1
|/ | | | | | | 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-10/+24
| | | | | | | | | | | | | 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.
* Port CMake from cmIML to KWIMLBrad King2015-12-181-1/+1
| | | | KWIML no longer uses a configured prefix.
* find_package: Drop search in recent cmake-gui locationsBrad King2015-05-081-2/+0
| | | | | | | | | | | | | | | | | | | | | | The find_package command, on Windows, has always searched build trees recently visited by cmake-gui (or CMakeSetup at one time). This was done when the command was created with the intention of simplifying workflows involving building multiple dependent projects. However, this behavior depends on recent developer interaction and therefore can create different find results based on transient system states. It can lead to surprising results and user confusion. Since this behavior was first added CMake has gained many more search options, better error messages when a package is not found, and a package registry. The latter in particular allows projects to make their build trees available for dependent projects to find without user intervention. Therefore the originally intended workflow can be achieved in other, more stable ways. After the above evoluion of find_package we have now decided that the magic search-where-cmake-gui-was behavior does more harm than good. Drop it. We do not need a policy for this behavior change because it only affects interactive use.
* Use containers of labeled search paths instead of individual membersChuck Atkins2014-11-121-0/+15
| | | | | | | 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.