Commit Graph

40 Commits

Author SHA1 Message Date
Brad King b0cd630521 Refactor find_* command final path list computation
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.
2011-09-23 14:36:27 -04:00
Brad King b41ad3b399 Teach find_(library|package) about Linux multiarch (#12037)
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.
2011-06-08 10:04:44 -04:00
Brad King b95f3cac91 find_package: Check both 32-bit and 64-bit registry views
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.
2011-04-13 13:17:42 -04:00
Brad King a0d76c10a7 find_package: Search a "system package registry"
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.
2011-04-13 13:17:00 -04:00
Brad King 4df119773c find_package: Rename implementation of user package registry
Rename {Registry => UserRegistry} in names associated specifically with
the user package registry and not registry access in general.
2011-04-13 12:57:18 -04:00
Brad King 5303fbf09e Speedup find_* commands (#11412)
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>
2010-11-12 10:47:28 -05:00
Alex Neundorf 0367245f0c Replace the two vector<string,string> with one vector<struct{string,string}>
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
2010-08-29 17:51:44 +02:00
Alex Neundorf dfe9c95129 Record all considered Config files and their versions.
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
2010-08-29 17:07:39 +02:00
Todd Gamblin 1221581aa8 Teach find_* commands to ignore some paths
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.
2010-08-13 11:53:28 -04:00
Brad King 71910b3fd4 Fix find_package() when <pkg>_DIR is wrong
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.
2009-10-07 14:37:30 -04:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
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.
2009-09-28 11:43:28 -04:00
Brad King ed0650f6ae Teach find_package to search a "package registry"
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.
2009-09-01 14:04:27 -04:00
Brad King c332e0bf3c ENH: Isolate policy changes in included scripts
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.
2009-01-22 13:18:40 -05:00
Alexander Neundorf ef3e48c3d5 ENH: when trying to find a FooConfig.cmake file, if in the directory pointed
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
2009-01-08 17:57:52 -05:00
Brad King ae28ec9f24 ENH: Preserve <pkg>_FIND_XXX vars in find_package
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.
2008-12-09 10:08:54 -05:00
Brad King 994262e5cc ENH: Improve find_package version numbering
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.
2008-09-10 10:11:48 -04:00
Alexander Neundorf c2cc883430 COMP: fix compile warning/error (non-void function returning void)
Alex
2008-09-07 06:52:06 -04:00
Alexander Neundorf 8903f88b36 ENH: provide the xxx_FIND_QUIETLY, xxx_FIND_REQUIRED and xxx_FIND_VERSION_ variables
also in Config mode, so the xxxConfig.cmake files can e.g. test the QUIETLY
parameter and print something or not

Alex
2008-09-06 19:10:02 -04:00
Brad King 2b96e0edab ENH: Teach find_package about lib64 paths
When find_package is about to look in <prefix>/lib, search first in
<prefix>/lib64 in cases that find_library would use lib64 paths.
2008-08-12 19:01:04 -04:00
Brad King 5b406c9044 ENH: Add HINTS option to find_* commands.
- 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
2008-06-09 15:08:59 -04:00
Brad King 789c167b6f ENH: Refactor cmFindCommon, cmFindBase, and cmFindPackageCommand
- 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.
2008-06-05 18:20:16 -04:00
Brad King 41c2895b75 ENH: Added version support to Config mode of find_package command.
- Added EXACT option to request an exact version.
  - Enforce version using check provided by package.
  - Updated FindPackageTest to test versioning in config mode.
2008-01-28 20:38:48 -05:00
Ken Martin 0e69d38004 ENH: add return and break support to cmake, also change basic command invocation signature to be able to return extra informaiton via the cmExecutionStatus class 2008-01-23 10:28:26 -05:00
Brad King f41b1e8e91 ENH: Implement version support in the find_package command module mode. Version numbers provided to the command are converted to variable settings to tell the FindXXX.cmake module what version is requested. This addresses issue #1645. 2008-01-21 08:48:33 -05:00
Brad King b424df917d ENH: Major improvements to the FIND_PACKAGE command. See bug #3659.
- 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.
2008-01-17 09:02:31 -05:00
Brad King 994c88559a STYLE: Removed trailing whitespace. 2007-12-15 14:17:21 -05:00
Ken Martin 8d32d229a3 ENH: make commands lower case by default 2007-10-10 11:47:43 -04:00
Alexander Neundorf 2f06857635 COMP: also commit the header...
Alex
2007-08-07 16:26:59 -04:00
Alexander Neundorf 8c77fe55dc STYLE: fix some typos, nicer debug output
Alex
2007-07-19 11:13:01 -04:00
Brad King d9f1d4d71a ENH: Added NO_MODULE and COMPONENTS options to improve flexibility of the command. Re-implemented argument parsing to be simpler and more robust. 2006-10-26 11:39:56 -04:00
Brad King 9f625beab6 ENH: Added optional component list to the REQUIRED option of the FIND_PACKAGE command. This addresses bug#2771. 2006-01-27 13:07:23 -05:00
Andy Cedilnik 02b961f29c ENH: Make commands scriptable 2005-12-07 11:39:08 -05:00
Ken Martin 345cf04012 ENH: big change that includes immediate subdir support, removing the notion of inherited commands, makefiles no longer read in the parent makefiles but instead inherit thier parent makefiles current settings 2005-03-18 10:41:41 -05:00
Brad King d4214bc565 ENH#696: Adding REQUIRED option to FIND_PACKAGE command. It will terminate the cmake configure step if the package is not found. 2004-04-19 10:36:42 -04:00
Ken Martin 072db6ad70 removed redundent includes 2003-08-10 18:30:54 -04:00
Brad King 78367fbc1b ENH: Implemented QUIET argument propagation to FOO_FIND_QUIETLY setting in FindFOO.cmake module that is found. 2003-07-24 11:32:41 -04:00
Brad King 8ca5266645 ENH: Added QUIET optional argument to block error message when _DIR variable is not set. Also removed upper-casing of package name. 2003-07-16 14:52:51 -04:00
Brad King 1c3680410b BUG: This command must be inherited. 2003-02-17 15:47:26 -05:00
Brad King a02574158d ENH: Cleaned up documentation and formatted it for use by cmDocumentation. 2003-02-14 18:47:16 -05:00
Brad King 259a49aaac ENH: Added FIND_PACKAGE command prototyp. 2003-01-21 17:15:22 -05:00