Refactoring in the topic merged by commit v3.2.0-rc1~400 (Merge topic
'refactor-search-path-construction', 2014-11-13) introduced a bug that
filters out duplicate paths in an incorrect order. Restore the search
path to its documented order even when duplicate paths are present.
Reported-by: Marc CHEVRIER <marc.chevrier@sap.com>
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.
A few pieces of code have some ambiguous type deduction that seems to
resolve correctly for most compilers but not for the Oracle compiler.
This makes those few instances more explicit.
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.
The functions for adding the various different types of paths have been
factored out into a new class, cmSearchPath. It is to be used as a helper
container class for the various find_* commands.
Prior to this commit, the set of search paths to traverse for find commands
was incrementally constructed. This change allows each group of paths, i.e.
CMakeVariablePaths, UserHintsPaths, SystemEnvironmentPaths, etc. to be
constructed and manipulated independently, and then all combined togethor.
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.
Use the clang RemoveCStrCalls tool to automatically migrate the
code. This was only run on linux, so does not have any positive or
negative effect on other platforms.
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.
The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
Set a global property in the find_package implementation. Track and
reset that property in the find_dependency macro. Read the property
in FeatureSummary when determining whether to print output.
This means that packages which are found only as dependencies are not
listed by FeatureSummary, but if a project uses find_package elsewhere
directly, then it will be listed by FeatureSummary.
Suggested-by: Alex Merry
http://thread.gmane.org/gmane.comp.kde.devel.frameworks/10640
3917d86 Genex: Add a nullary form for CONFIG
5169130 Help: Document the target properties exported to IMPORTED targets.
ee21f1c CompatibleInterface: Test debugging of not-set property.
80e9fe9 Help: Note that language-specific 'built-ins' are set by the project command.
0b5bf8a Help: Mention CMAKE_DISABLE_FIND_PACKAGE_<PackageName> in package docs.
28c865b Tests: simplify Qt4 target usage
6cfe6b8 Help: Fix typo: 'target' -> 'target property'
b7deca4 Test: Remove obsolete commented code.
9c9f69f Genex: Make EQUAL support upper case binary literals
6eb3218 Genex: Fix case of methods in the dag checker.
646c6ec Genex: Use a preprocessor loop to implement transitive DAG check.
711fb38 Genex: List transitive properties and methods as a table, not two lists.
802a28f Add cmHasLiteralSuffix API.
Drop all behavior activated by setting CMAKE_BACKWARDS_COMPATIBILITY to
a value lower than 2.4, and generate an error when projects or the user
attempt to do so. In the error suggest using a CMake 2.8.x release.
Teach cmake_minimum_required to warn about projects that do not require
at least CMake 2.4. They are not supported by CMake >= 3.0.
Replace the documentation of CMAKE_BACKWARDS_COMPATIBILITY with a
reference to policy CMP0001.
This reverts commit 2c3654c3de.
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.
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.
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
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
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.
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
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
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