summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Mention that IMPORTED targets may be created by a find_package call.Stephen Kelly2013-03-061-1/+2
|
* Revert "Add a way to exclude INTERFACE properties from exported targets."Stephen Kelly2013-02-131-21/+0
| | | | | | | | This reverts commit 2c3654c3de718fe822f8960063373774fc019494. The removal of some tests added in commit 77cecb77 (Add includes and compile definitions with target_link_libraries., 2012-11-05) are also squashed into this commit.
* Revert "find_package: Reword <package>_NO_INTERFACES documentation"Stephen Kelly2013-02-131-17/+18
| | | | This reverts commit 179f49560286e2e322b9b0cf5d0a277b7634540f.
* find_package: Reword <package>_NO_INTERFACES documentationBrad King2013-02-011-18/+17
|
* Add a way to exclude INTERFACE properties from exported targets.Stephen Kelly2013-01-311-0/+21
| | | | | | | | | | | | Projects set interface requirements upstream, and existing downstreams use of target_link_libraries will consume those interfaces. This can create a backward compatibility concern as the result may be changing the order of include directories of downstreams, or another side-effect of using the INTERFACE properties. Provide a way for them to emulate the behavior of a version-based policy in the config file.
* exports: define a CMAKE_FIND_PACKAGE_NAME var set by find_package()Alex Neundorf2012-09-301-0/+2
| | | | | | | | | This way the name of the searched package can be accessed in find-modules, config-files and more importantly in generated target export files. This is now used when a target export file detects that a required target does not exist. Alex
* find_package: add support for a <package>_NOT_FOUND_MESSAGE variableAlex Neundorf2012-09-281-0/+10
| | | | | | | | If a config-file sets <package>_FOUND to FALSE, it can now give a reason using the variable <package>_NOT_FOUND_MESSAGE, which is used by cmFindPackage and FPHSA. Alex
* fix #13195: avoid multiple mentions of found packagesAlex Neundorf2012-05-061-32/+60
| | | | | | | Now before adding a package to the list of found or not-found packages, the package is remvoed from both lists before. Alex
* find_package: Fix components signature documentation (#13142)Brad King2012-04-191-3/+3
| | | | | Update the signature notation to show that "REQUIRED COMPONENTS ..." is allowed and that REQUIRED is an option on its own.
* find_package: Document <package>_FIND_* variables (#13142)Brad King2012-04-181-0/+23
| | | | | | | | When loading a find module or package config file the find_package command defines several variables to provide information about the caller's request. Previously this was documented only in the Modules/readme.txt file which is not distributed. Document the behavior explicitly in the main find_package documentation.
* find_package: add documentation for OPTIONAL_COMPONENTSAlex Neundorf2012-03-191-4/+9
| | | | | | | | This patch adds documentation for OPTIONAL_COMPONENTS to cmFindPackage.cxx, and also extends Modules/readme.txt significantly with regard to how components should be handled. Alex
* find_package: add OPTIONAL_COMPONENTS keywordAlex Neundorf2012-03-191-5/+39
| | | | | | | | Add an OPTIONAL_COMPONENTS keyword to find_package() so we can have a clear distinction between required and optional components. Don't allow a component to be both required and optional. Alex
* find_package: allow <pkg>Config.cmake to set <pkg>_FOUND to FALSEAlex Neundorf2012-03-131-4/+34
| | | | | | | | | | | Before, find_package in Config mode always set Foo_FOUND to true if the Config file has been found and could be executed. If the Config file itself detected some problem, like a missing dependency, it did not have a way to signal to the outside that the package is not working. With this patch, if a Config file sets Foo_FOUND to FALSE, this is taken into account and not overridden. Alex
* Merge topic 'find_package_fatal_error_if_required_and_config_not_found'David Cole2012-03-081-0/+4
|\ | | | | | | | | | | c5ae733 find_package: Test that REQUIRED aborts processing correctly c91a54d find_package: error out if REQUIRED Config has not been found
| * find_package: error out if REQUIRED Config has not been foundAlex Neundorf2012-03-061-0/+4
| | | | | | | | | | | | | | | | If in Config mode a configuration file could not be found, cmake printed an error, but did not actually stop processing. With SetFatalErrorOccured it does. Alex
* | Merge topic 'MakingConfigFilesEasier_ConfigureMacro'David Cole2012-03-081-1/+1
|\ \ | |/ |/| | | | | | | 6973e2d wrap write_basic_config_version_file as write_basic_package_version_file() 204f5d4 add CMakePackageConfigHelpers: configure_package_config_file()
| * wrap write_basic_config_version_file as write_basic_package_version_file()Alex Neundorf2012-03-071-1/+1
| | | | | | | | | | | | | | So the name fits better with configure_package_config_file(), as discussed on the mailing list. Adapt the documentation accordingly. Alex
* | Merge topic 'add-const-qualifiers'David Cole2012-03-021-2/+2
|\ \ | | | | | | | | | | | | | | | 737c49a Add 'const' qualifier to some cmCommand members 261491f cmPropertyDefinition::IsChained is const
| * | Add 'const' qualifier to some cmCommand membersYury G. Kudryashov2012-02-291-2/+2
| |/ | | | | | | | | Use const_cast for the special case in cmFindBase where GetFullDocumentation calls GenerateDocumentation.
* | find_package: Optionally warn when implicitly using Config modeBrad King2012-02-281-0/+41
| | | | | | | | | | | | | | | | | | | | | | Define variable CMAKE_FIND_PACKAGE_WARN_NO_MODULE for use by a project that wants to use an explicit mode in every call to find_package in order to generate more specific failure messages. Word the warning using the new CONFIG and MODULE mode keywords when the minimum required version of CMake is new enough to have them. Otherwise word the warning using the old NO_MODULE mode keyword. Inspired-by: Alex Neundorf <neundorf@kde.org>
* | find_package: Reject mixed use of MODULE- and CONFIG-only optionsBrad King2012-02-281-43/+37
| | | | | | | | | | Many options imply exclusive Config mode. The new MODULE option implies exclusive Module mode. Do not allow mixed combinations.
* | find_package: mention requested version number in error messageAlex Neundorf2012-02-281-2/+11
| | | | | | | | | | | | When neither a Find-module or a config file can be found print the required version so the user knows which version of the package to install.
* | find_package: add CONFIG mode keyword alias for NO_MODULEAlex Neundorf2012-02-281-4/+21
| |
* | find_package: add MODULE mode to use only Find-modulesAlex Neundorf2012-02-281-56/+116
| | | | | | | | | | The new mode differ from default mode in that that it doesn't fallback to config mode. The default mode stays unchanged.
* | find_package: improve error message when no Find module is presentAlex Neundorf2012-02-281-18/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explain exactly why CMake is looking for a package configuration file and who is expected to provide what: CMake Error at CMakeLists.txt:7 (find_package): By not providing "Find<pkg>.cmake" in CMAKE_MODULE_PATH the caller has asked CMake to find a package configuration file provided by "<pkg>", but CMake did not find one. Could not find a package configuration file provided by "<pkg>" with any of the names: <pkg>Config.cmake <pkg>-config.cmake Add the installation prefix of "<pkg>" to CMAKE_PREFIX_PATH or set "<pkg>_DIR" to a directory containing one of the above files. If "<pkg>" provides separate development package or SDK be sure it has been installed. The first paragraph explains how CMake is interpreting the intention of the caller. This puts the blame or credit at the call site in the project code where it belongs both when it is a bug and when it is intentional. It can be dropped in NO_MODULE mode. Suggested-by: Brad King <brad.king@kitware.com>
* | find_package: rename NoModule to UseFindModulesAlex Neundorf2012-02-271-14/+14
| | | | | | | | | | | | ...positive logic is easier to handle Alex
* | find_package: print error if an invalid CONFIGS name is usedAlex Neundorf2012-02-271-0/+1
|/ | | | | | In commit 41c2895b (Added version support to Config mode of find_package command, 2008-01-28) the error message was computed but was not reported. Add the SetError call to report it.
* fix FeatureSummary for REQUIRED packages, they were reported as OPTIONALAlex Neundorf2012-02-111-0/+9
| | | | Alex
* Refactor find_* command final path list computationBrad King2011-09-231-13/+1
| | | | | | | 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.
* Merge topic 'WriteConfigVersionFile_2TemplateFiles'David Cole2011-08-161-0/+3
|\ | | | | | | | | | | | | | | | | | | | | c9761de Improve documentation for WriteBasicConfigVersionFile.cmake 208bb90 Set UNSUITABLE instead of not COMPATIBLE bb03c2d Really fix copyright notice d50a61a Fix copyright notice 4ba09bc Add some tests for write_basic_config_version_file() 02b1e4b Add example to documentation d216a67 Provide macro write_basic_config_version_file()
| * Provide macro write_basic_config_version_file()Alex Neundorf2011-08-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | This macro can be used to generate basic version files which can be installed along a Config.cmake file to provide versioning support. This (3rd try) is implemented using a macro, which maps the COMPATIBILITY mode to a filename and configure_file()s the resulting file. Alex
* | Merge topic 'FeatureSummaryImprovements'David Cole2011-08-021-8/+8
|\ \ | |/ |/| | | | | | | | | | | | | | | | | b62349c FeatureSummary.cmake: update documentation f366cf8 FeatureSummary.cmake: cosmetics f407bb5 FeatureSummary.cmake: only higher TYPEs can override previous TYPEs 02d47ab FeatureSummary.cmake: error out when a REQUIRED package is missing 91a1527 FeatureSummary.cmake: add INCLUDE_QUIET_PACKAGES keyword 0671a02 FeatureSummary.cmake: remove "comment" field aae13f4 Extend FeatureSummary: add PURPOSE of package and TYPE
| * FeatureSummary.cmake: add INCLUDE_QUIET_PACKAGES keywordAlex Neundorf2011-07-171-8/+8
| | | | | | | | | | | | | | | | | | Now found packages are not stored in ENABLED/DISABLED_FEATURES anymore, but always in PACKAGES_FOUND/NOT_FOUND. ENABLED/DISABLED_FEATURES is now only used via ADD_FEATURE_INFO(), e.g. for stuff set via option(). Alex
* | Add documentation for the CMAKE_DISABLE_FIND_PACKAGE_<Name> switchAlex Neundorf2011-06-231-0/+4
| | | | | | | | Alex
* | Add a switch to disable a find_package() call completelyAlex Neundorf2011-06-211-0/+18
|/ | | | | | | | As discussed, this adds a switch CMAKE_DISABLE_FIND_PACKAGE_<name>, which, when set to TRUE, keeps the find_package() command from executing. When the package is REQUIRED at the same time, an error is generated. Alex
* Teach find_(library|package) about Linux multiarch (#12037)Brad King2011-06-081-6/+18
| | | | | | | | | | | | | 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.
* find_package: Check both 32-bit and 64-bit registry viewsBrad King2011-04-131-5/+37
| | | | | | The system package registry is under HKEY_LOCAL_MACHINE\SOFTWARE which has separate views for 32-bit and 64-bit applications. Look in both views, but prefer the architecture matching the build target platform.
* find_package: Search a "system package registry"Brad King2011-04-131-13/+36
| | | | | | | | Generalize the "user package registry" created by commit ed0650f6 (Teach find_package to search a "package registry", 2009-09-01). Define a corresponding "system" registry key under HKEY_LOCAL_MACHINE. This gives package installers a place to create a registry value that points at the right location for find_package() to locate the package.
* find_package: Document user package registry locationsBrad King2011-04-131-3/+10
| | | | | Specify the Windows registry key under HKEY_CURRENT_USER and directory on UNIX platforms in which the package registry is stored.
* find_package: Cleanup user package registry less aggressivelyBrad King2011-04-131-4/+3
| | | | | | Delete only REG_SZ entries that are specifically detected to point to invalid paths. This will allow future versions to add other value types for different purposes.
* find_package: Rename implementation of user package registryBrad King2011-04-131-5/+5
| | | | | Rename {Registry => UserRegistry} in names associated specifically with the user package registry and not registry access in general.
* find_package: Forward component list for recursive calls in modulesBrad King2011-04-071-14/+23
| | | | | | | | | Some find modules call find_package recursively to locate a package configuration file for the package instead of searching for individual pieces. Commit 79e9b755 (Help recursive find_package calls in modules, 2008-10-03) taught find_package to forward the version number and EXACT arguments through the recursive call automatically. Do the same for the component list.
* Speedup find_* commands (#11412)Brad King2010-11-121-7/+17
| | | | | | | 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>
* Merge topic 'ImproveFindPackageConfigMode'Brad King2010-09-081-34/+109
|\ | | | | | | | | | | | | | | | | | | | | | | 5cdfc9c Improve wording of the error message of find_package() in config-mode 4969c3b Improve version notice in the generated message e8ae504 Add option CONFIG_MODE to FPHSA() b4b8f96 Don't create an empty element at the end of Foo_CONSIDERED_CONFIGS/VERSIONS cc955a0 Small cleanup of FindPackageHandleStandardArgs.cmake 0367245 Replace the two vector<string,string> with one vector<struct{string,string}> 130b0e2 Improve error message in Config-mode when no appropriate version was found dfe9c95 Record all considered Config files and their versions.
| * Improve wording of the error message of find_package() in config-modeAlex Neundorf2010-08-311-9/+10
| | | | | | | | | | | | | | | | As suggested by Brad, this improves the wording of the error message in config-mode when config-files were found, but no suitable version. The patch also contains the small loop-optimization suggested by Brad. Alex
| * Don't create an empty element at the end of Foo_CONSIDERED_CONFIGS/VERSIONSAlex Neundorf2010-08-291-2/+5
| | | | | | | | Alex
| * Replace the two vector<string,string> with one vector<struct{string,string}>Alex Neundorf2010-08-291-13/+14
| | | | | | | | | | | | | | | | | | Before this patch there were two separate vectors, and the code made sure they always had the same size. With this patch the code doesn't have to ensure this anymore, there is only one vector now. Alex
| * Improve error message in Config-mode when no appropriate version was foundAlex Neundorf2010-08-291-36/+50
| | | | | | | | | | | | | | | | If in config-mode config files have been found by find_package(), but their version didn't match the requested version, now all considered files and their versions are printed (instead of saying "didn't find config file) Alex
| * Record all considered Config files and their versions.Alex Neundorf2010-08-291-10/+66
| | | | | | | | | | | | | | | | As suggested on cmake-devel, find_package in Config-mode now records all considered config-files and their versions in <package>_CONSIDERED_CONFIGS and <package>_CONSIDERED_VERSIONS respectively. Alex
* | Log the required package version and major improvement to FeatureSummaryAlex Neundorf2010-08-241-0/+14
|/ | | | | | | | | | | | | | | | | | | | find_package() now also stores the required version automatically, so it can be used by FeatureSummary.cmake. This was one of the requested features for setting up nightly builds for KDE, since with this functionality it will be possible to write a file at the end of each project which lists all required packages and their versions. This file could then be compared for equality with an older one and if something has changed the build maintainer can be emailed. In FeatureSummary.cmake there is now a new function feature_summary(), which also allows to print the log to a file or into a variable. It also allows to specify whether to append to a file or to write a new one, and what information to log. Docs are still missing. Alex