| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
Detect MSYS as CYGWIN, with the required adaptations.
|
|\
| |
| |
| |
| |
| |
| | |
8ed868606d find_package: Fix prefer-config mode to not fail on missing optional package
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3653
|
| |
| |
| |
| |
| |
| |
| |
| | |
When `CMAKE_FIND_PACKAGE_PREFER_CONFIG` mode was set to `ON`, failure to
find a package was fatal even if it was not `REQUIRED`. Fix this and
add a test case.
Fixes: #19557
|
|\ \
| |/
| |
| |
| |
| |
| | |
f2edccea66 find_package: Fix NO_MODULE under CMAKE_FIND_PACKAGE_PREFER_CONFIG
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3557
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The module mode fallback added by commit 22e65d10c1 (find_package: Fixed
CMAKE_FIND_PACKAGE_PREFER_CONFIG Module fallback, 2019-06-13,
v3.15.0-rc2~6^2) should not be used unless the `find_package` call
allows module mode. Doing so can lead to infinite recursion if a find
module tries to call config mode with `find_package(... NO_MODULE)`.
Fix the logic and add a test case.
Fixes: #19478
|
|/
|
|
|
|
| |
CMake's find control flags should all have a consistent name.
To make this happen we are introducing `CMAKE_FIND_USE_REGISTRY`
and deprecating `CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`.
|
|
|
|
| |
Fixes: #19361
|
|
|
|
|
|
|
|
| |
Add a `CMAKE_FIND_PACKAGE_PREFER_CONFIG` variable to tell
`find_package` calls to look for a package configuration file
first even if a find module is available.
Fixes: #16805, #19236
|
|
|
|
| |
Exclude a portion of the test that does not work in this case.
|
| |
|
|
|
|
|
|
|
| |
The user package registry populated by the `export()` command causes
side effects outside the build and source directories. Such effects
should be opt-in rather than op-out. Introduce a policy to change
default behavior of `export(PACKAGE)` to do nothing.
|
| |
|
|
|
|
|
| |
The `WriteBasicConfigVersionFile` section of the `FindPackageTest`
is independent of the rest.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Automate with:
find Tests -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
|
|
|
|
|
|
|
| |
Fix test cases whose behavior differs when their source or build tree is
under CMAKE_INSTALL_PREFIX by setting an install prefix under the build
tree. Otherwise they may fail when run under the default install prefix
(e.g. /usr/local).
|
|
|
|
|
|
|
|
|
|
|
| |
The UPPERCASE name was inconsistent with config-packages, the
find_dependency macro, and even FPHSA itself, which expects
components to be specified with names matching ExactCase.
The FOUND_VAR was only permitted to have two possible values, and
now both are set for compatibility. Document it as obsolete, and
adjust the code for the same. Users of the variable should just
remove it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 a different directory name for the Exporter build tree so that it is
out-of-source even when the main test is in-source.
|
|
|
|
|
| |
Add a random version component so that the test is unlikely to conflict
with other tests of the same CMake version on the same machine.
|
|
|
|
|
|
|
|
|
|
| |
When running CMake from the build tree the CMAKE_ROOT is the
entire source tree. Fix the CMP0017 check to be specific to
the Modules/ directory under CMAKE_ROOT so that Tests/ does
not count. Fix the FindPackageTest modules to include FPHSA
by full path from CMAKE_ROOT so that they do not include the
local FPHSA which reports an error meant to test that CMP0017
works.
|
|
|
|
|
|
|
|
| |
In the new mode FPHSA now accepts a FOUND_VAR option, which can be set
either to ExactCase_FOUND or UPPERCASE_FOUND, no other values are
accepted. Also add tests for that, including failure.
Alex
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block. This is no longer the preferred style.
Run the following shell code:
for c in else endif endforeach endfunction endmacro endwhile; do
echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ancient CMake versions required upper-case commands. Later command
names became case-insensitive. Now the preferred style is lower-case.
Run the following shell code:
cmake --help-command-list |
grep -v "cmake version" |
while read c; do
echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
|
|
|
|
| |
Alex
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As discussed on cmake-developers, this patch adds a macro
check_required_components() to the file configured via
configure_package_config_file(), so for proper handling
of components in Config.cmake files users can simply call
check_required_components(PackageName)
and this will do the right thing.
Alex
|
|
|
|
|
|
|
|
|
| |
if the HANDLE_COMPONENTS is used, FPHSA() now also checks all required COMPONENTS,
i.e. all elements from <name>_FIND_COMPONENTS for which <name>_FIND_REQUIRED_<comp>
is true, and sets <name>_FOUND only to true if all have been found.
As discussed on cmake-developers.
Alex
|
|
|
|
| |
Alex
|
|
|
|
| |
Alex
|
|
|
|
|
|
|
| |
So the name fits better with configure_package_config_file(), as
discussed on the mailing list. Adapt the documentation accordingly.
Alex
|
|
|
|
|
|
|
|
| |
The function configure_package_config_file() may be used instead of
configure_file() for generating the Config.cmake files for installation,
they help to make those files relocatable.
Alex
|
|
|
|
| |
Alex
|
|
|
|
| |
Alex
|
|
|
|
| |
Alex
|
| |
|
|
|
|
|
|
|
| |
Do not use file(TO_NATIVE_PATH) to compute the value to store in the
registry. It is meant for constructing values to be put in shells.
Since find_package() can use the value with CMake-normalized slashes do
not bother with any conversion.
|
|
|
|
|
|
| |
Teach the FindPackagTest to try creating the appropriate HKLM system
package registry value. If it works then add a test to verify that
find_package() reads it as expected. Then delete the value to cleanup.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This patch incorporates the comments from Brad:
-some improvements to the documentation of CMP0017
-make the test QUIETLY search for zlib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes include() and find_package() prefer cmake files
located in CMAKE_ROOT over those in CMAKE_MODULE_PATH.
This makes sure that the including file gets that file included
which it expects, i.e. the one from cmake with which it was tested.
It only changes behaviour when such an included file exists both
in CMAKE_MODULE_PATH and in CMAKE_ROOT.
This comes together with a new policy CMP0017, with default
behaviour it behaves as it always did, but warns.
With NEW behaviour it includes the file from CMAKE_ROOT
instead from CMAKE_MODULE_PATH. This fixes (if CMP0017 is set)
building KDE 4.5 with cmake >= 2.8.3.
Also a basic test for this policy in included.
|
|
|
|
|
|
|
|
| |
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.
|