Commit Graph

12 Commits

Author SHA1 Message Date
Pierluigi Taddei 31be918b0b find_package: Optionally sort globbed directories in a meaningful order
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.
2016-09-15 13:35:25 -04:00
Silvio Traversaro 828d6c137d find_package: Extend search path for combined Windows/UNIX convention
Find packages that install their cmake package configuration files in
`lib/cmake/<name>` when they are installed in the default Windows
CMAKE_INSTALL_PREFIX, `C:/Program Files/<name>`.

Closes: #16212
2016-08-24 09:40:25 -04:00
Silvio Traversaro ff5c89de0c Help: Widen find_package search path table
Make room for additional longer entries.
2016-08-23 13:28:42 -04:00
Brad King 8c64c4783d Help: Document CMAKE_FIND_APPBUNDLE and CMAKE_FIND_FRAMEWORK
Add dedicated documents for these and link to them instead of
duplicating their documentation in every find command.
2015-06-08 15:45:59 -04:00
Brad King 1506f9ca56 find_package: Drop search in recent cmake-gui locations
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.
2015-05-08 11:27:02 -04:00
Gregor Jasny b8abd25897 find_package: Document CMAKE_FIND_PACKAGE_NAME variable
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2015-01-11 15:16:48 -05:00
Daniele E. Domenichelli be8ae96098 Allow the Package Registry to be disabled (#14849)
When a project is packaged for redistribution the local package
registries should not be updated or consulted.  They are for developers.

Add variables to disable use of package registries globally:

* CMAKE_EXPORT_NO_PACKAGE_REGISTRY that disables the export(PACKAGE)
  command
* CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY that disables the User Package
  Registry in all the find_package calls.
* CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY that disables the
  System Package Registry in all the find_package calls.

Update documentation and unit tests.
2014-05-12 09:50:01 -04:00
Brad King 69d73d27cb Help: Mention in find_package that cmake-gui step is Windows-only (#14781)
Recently used cmake-gui locations are searched only on Windows because
the Windows registry is used to record the values.  This behavior is
historical and may be removed by a policy in the future so rather than
implementing it on other platforms simply document the current behavior.
2014-03-03 14:36:48 -05:00
Brad King bf012e0cb6 Help: Format find_package() command documentation
Add inline markup and explicit markup block syntax as needed.
Add cross-references to other documentation as appropriate.
2014-02-17 15:37:04 -05:00
Stephen Kelly 3e3f8b456f Help: Document the CMAKE_FIND_ROOT_PATH* variables.
Add a replacement template for the variables, and link to them from
the documentation for the find_* commands.
2013-11-27 13:21:12 +01:00
Brad King 898216137a Help: Factor out find_* command duplication
These documents were represented in the builtin documentation using a
common starting point with placeholders substituted by each command.
Convert them back to this approach using the reStructuredText include
directive and substitutions to avoid duplication.
2013-10-16 09:22:38 -04:00
Kitware Robot f051814ed0 Convert builtin help to reStructuredText source files
Run the convert-help.bash script to convert documentation:

 ./convert-help.bash "/path/to/CMake-build/bin"

Then remove it.
2013-10-15 14:12:03 -04:00