summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Teach find_* commands to ignore some pathsTodd Gamblin2010-08-131-0/+14
| | | | | | | | 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.
* Document and test find_package <pkg>_DIR env varBrad King2009-11-041-0/+1
| | | | | The find_package(<pkg>) command checks the <pkg>_DIR environment variable. This commit documents and tests the feature.
* Fix find_package() when <pkg>_DIR is wrongBrad King2009-10-071-10/+17
| | | | | | | | | | | | When <pkg>_DIR is set to an incorrect version we search again and store the result in the variable, even if it is <pkg>_DIR-NOTFOUND. There was a bug in the case when the new search does not find anything and the old value came from a cache entry with UNINITALIZED type. The command used to try to load a package configuration file from the last place searched, and would leave the old wrong value in the entry. This commit fixes the behavior to avoid trying to load a missing file and to set the value to <pkg>_DIR-NOTFOUND as expected.
* Create cmMakefile::PlatformIs64Bit helper methodBrad King2009-09-301-8/+4
| | | | 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.
* Use BeAPI for per-user package registry on HaikuBrad King2009-09-281-0/+12
| | | | | | | | Applications on Haiku are discouraged from storing their data in $HOME. This teaches export(PACKAGE) and find_package() to use the BeAPI on Haiku to store the package registry instead of using ~/.cmake/packages. See issue #9603.
* Add parentheses around '&&' between '||' for gccBrad King2009-09-111-4/+4
| | | | | | | The GNU compiler warns about possible operator precedence mistakes and asks for explicit parentheses (-Wparentheses). We add the parentheses to silence the warning. This also fixes one real logic error in the find_package() implementation by correcting expression evaluation order.
* Teach find_package to search a "package registry"Brad King2009-09-011-3/+186
| | | | | | | | | | | | | | A common user workflow is to build a series of dependent projects in order. Each project locates its dependencies with find_package. We introduce a "user package registry" to help find_package locate packages built in non-standard search locations. The registry explicitly stores locations of build trees providing instances of a given package. There is no defined order among the locations specified. These locations should provide package configuration files (<package>-config.cmake) and package version files (<package>-config-version.cmake) so that find_package will recognize the packages and test version numbers.
* Fix find_package for cmake-gui registry entryBrad King2009-08-051-1/+1
| | | | | | | | | | | | The find_package commands looks at the "WhereBuild" registry entries created by CMakeSetup and cmake-gui hoping that the project was recently built. CMakeSetup created WhereBuild1..WhereBuild10 but cmake-gui creates WhereBuild0-WhereBuild9. This fixes find_package to look at WhereBuild0 so that the most recently configured project can be found. It is important in the case that the package to be found was the last one configured in cmake-gui but the current project that is finding it is configured from the command line.
* STYLE: fix typos in the docsAlexander Neundorf2009-04-191-1/+1
| | | | Alex
* ENH: Isolate policy changes in included scriptsBrad King2009-01-221-7/+23
| | | | | | | | Isolation of policy changes inside scripts is important for protecting the including context. This teaches include() and find_package() to imply a cmake_policy(PUSH) and cmake_policy(POP) around the scripts they load, with a NO_POLICY_SCOPE option to disable the behavior. This also creates CMake Policy CMP0011 to provide compatibility. See issue #8192.
* ENH: Refactor find_package version file scopingBrad King2009-01-221-6/+4
| | | | | This converts the variable and policy scope protection find_package() uses when loading version files to use automatic variables.
* BUG: Fix find_package docs for refind featureBrad King2009-01-151-2/+1
| | | | | | Recently we taught find_package to re-find a package configuration file if it is given a wrong answer. This fixes the documentation to reflect the change.
* ENH: when trying to find a FooConfig.cmake file, if in the directory pointedAlexander Neundorf2009-01-081-57/+36
| | | | | | | | | | to by the Foo_DIR variable there is no FooConfig.cmake file, then instead of abort and complain that the user should set or clear the Foo_DIR variables, just search for the file and discard the old Foo_DIR contents The tests succeed, ok by Brad. Alex
* ENH: Teach find_package about more install dirsBrad King2008-12-171-0/+27
| | | | | | | | | | | | We now search in <prefix>/<name>*/ <prefix>/<name>*/(cmake|CMake) when looking for package configuration files. This is useful on Windows since the Program Files folder is in CMAKE_SYSTEM_PREFIX_PATH. These paths are the Windows equivalent to the Apple convention application and framework paths we already search. See issue #8264.
* BUG: find_package must push/pop policiesBrad King2008-12-161-0/+2
| | | | | | | When the find_package command loads a <name>-version.cmake file to test the package version it must prevent the version file from affecting policy settings. Therefore the policy settings must be pushed and popped.
* ENH: Add useful search locations to find_packageBrad King2008-12-091-0/+15
| | | | | | | | | | This teaches find_package to search <prefix>/(share|lib)/cmake/<name>*/ for package configuration files. Packages that do not already have files in a <prefix>/lib/<name>* directory can use this location to avoid cluttering the lib directory.
* STYLE: Remove old TODO comment in find_packageBrad King2008-12-091-8/+0
| | | | | Versioning has been introduced to find_package, so the comment about it is out of date.
* ENH: Preserve <pkg>_FIND_XXX vars in find_packageBrad King2008-12-091-12/+46
| | | | | | | | | When the find_package command loads a module it sets several <pkg>_FIND_XXX variables to communicate information about the command invocation to the module. This restores the original state of the variables when the command returns. This behavior is useful when a find-module recursively calls find_package with NO_MODULE so that the inner call does not change the values in the find-module.
* ENH: Remove implicit NO_MODULE when recursingBrad King2008-10-081-22/+14
| | | | | | | | | Recently we taught find_package that the NO_MODULE option is implied when it is recursively invoked in a find-module. This behavior may be confusing because two identical calls may enter different modes depending on context. It also disallows the possibility that one find-module defers to another find-module by changing CMAKE_MODULE_PATH and recursively invoking find_package. This change reverts the feature.
* ENH: Add UNSUITABLE result to package version testBrad King2008-10-031-7/+14
| | | | | | | Package version test files may now declare that they are unsuitable for use with the project testing them. This is important when the version being tested does not provide a compatible ABI with the project target environment.
* ENH: Help recursive find_package calls in modulesBrad King2008-10-031-3/+41
| | | | | | | These changes teach find_package to behave nicely when invoked recursively inside a find-module for the same package. The module will never be recursively loaded again. Version arguments are automatically forwarded.
* ENH: Warn and ignore EXACT without versionBrad King2008-10-031-0/+8
| | | | | If the find_package command is invoked with the EXACT option but without a version, warn and ignore the option.
* ENH: Improve find_package version numberingBrad King2008-09-101-88/+63
| | | | | | | | Make the number of version components specified explicitly available. Set variables for unspecified version components to "0" instead of leaving them unset. This simplifies version number handling for find- and config-modules. Also support a fourth "tweak" version component since some packages use them.
* ENH: Improve message for bad find_package callBrad King2008-09-081-10/+3
| | | | | | Use the new-style error reporting mechanism to provide more context information for a find_package call with a bad package name. When the package is not required, issue a warning instead of an error.
* COMP: fix compile warning/error (non-void function returning void)Alexander Neundorf2008-09-071-1/+1
| | | | Alex
* ENH: provide the xxx_FIND_QUIETLY, xxx_FIND_REQUIRED and xxx_FIND_VERSION_ ↵Alexander Neundorf2008-09-061-57/+65
| | | | | | | | | variables also in Config mode, so the xxxConfig.cmake files can e.g. test the QUIETLY parameter and print something or not Alex
* ENH: Teach find_package about lib64 pathsBrad King2008-08-121-9/+27
| | | | | When find_package is about to look in <prefix>/lib, search first in <prefix>/lib64 in cases that find_library would use lib64 paths.
* ENH: Make find_* command search order more intuitive.Brad King2008-06-091-8/+8
| | | | | | | | - The CMAKE_PREFIX_PATH and similar variables have both environment and CMake cache versions. - Previously the environment value was checked before the cache value. - Now the cache value is favored because it is more specific.