summaryrefslogtreecommitdiffstats
path: root/Tests/FindPackageTest
Commit message (Collapse)AuthorAgeFilesLines
* FindPackageTest: Replace VTK with BoostFeRD (Frank Dana)2022-09-031-1/+1
|
* Tests: Fix typos and spelling in commentsJosef Angstenberger2021-05-071-1/+1
|
* MSYS: Add support for running under MSYS runtime environmentOrgad Shaneh2021-04-261-1/+3
| | | | Detect MSYS as CYGWIN, with the required adaptations.
* Merge topic 'find_package-prefer-config-not-found'Brad King2019-08-071-0/+6
|\ | | | | | | | | | | | | 8ed868606d find_package: Fix prefer-config mode to not fail on missing optional package Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3653
| * find_package: Fix prefer-config mode to not fail on missing optional packageCristian Adam2019-08-061-0/+6
| | | | | | | | | | | | | | | | 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
* | Merge topic 'find_package-fix-NO_MODULE'Brad King2019-07-173-0/+35
|\ \ | |/ | | | | | | | | | | f2edccea66 find_package: Fix NO_MODULE under CMAKE_FIND_PACKAGE_PREFER_CONFIG Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3557
| * find_package: Fix NO_MODULE under CMAKE_FIND_PACKAGE_PREFER_CONFIGCristian Adam2019-07-163-0/+35
| | | | | | | | | | | | | | | | | | | | | | 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
* | Find: find_package prefers variable CMAKE_FIND_USE_REGISTRYRobert Maynard2019-07-091-3/+31
|/ | | | | | 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`.
* find_package: Fixed CMAKE_FIND_PACKAGE_PREFER_CONFIG Module fallbackCristian Adam2019-06-132-0/+14
| | | | Fixes: #19361
* find_package: Add option to prefer Config modeCristian Adam2019-05-213-1/+37
| | | | | | | | 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
* Tests: Fix FindPackageTest when path to source has a symlinkBrad King2019-04-181-8/+13
| | | | Exclude a portion of the test that does not work in this case.
* Tests/FindPackageTest: Tell Git to ignore temporary symlink pathBrad King2019-04-181-0/+1
|
* export: Disable PACKAGE mode user package registry by defaultRobert Maynard2019-03-151-0/+20
| | | | | | | 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.
* find_package: add test coverage for CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKSDavid Aguilar2019-01-162-0/+32
|
* Tests: Factor out RunCMake.WriteBasicConfigVersionFile testBrad King2018-11-141-906/+0
| | | | | The `WriteBasicConfigVersionFile` section of the `FindPackageTest` is independent of the rest.
* doc: Consistently use <PackageName> for describing the name of a packageJean-Christophe Fillion-Robin2018-08-141-1/+1
|
* Refactor write_basic_package_version_file testsDaniele E. Domenichelli2018-06-011-239/+894
|
* WriteBasicConfigVersionFile: Fix messages in ExactVersion testsDaniele E. Domenichelli2017-11-211-6/+6
|
* WriteBasicConfigVersionFile: Add SameMinorVersion COMPATIBILITY optionDaniele E. Domenichelli2017-11-211-1/+78
|
* find_package: Optionally sort globbed directories in a meaningful orderPierluigi Taddei2016-09-155-0/+52
| | | | | | | | | | | | 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_package: Extend search path for combined Windows/UNIX conventionSilvio Traversaro2016-08-247-2/+34
| | | | | | | | 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
* Use string(APPEND) in TestsDaniel Pfeifer2016-07-271-1/+1
| | | | | | | 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'
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-1/+4
| | | | | | | | | | | | | 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.
* Tests: Fix failures when running under the default install prefix (#15566)Brad King2015-05-141-0/+3
| | | | | | | 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).
* FPHSA: Always populate the ExactCase_FOUND variable (#15412).Stephen Kelly2015-04-173-6/+10
| | | | | | | | | | | 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.
* CMakePackageConfigHelpers: Add unit tests for INSTALL_PREFIX optionDaniele E. Domenichelli2014-08-111-0/+38
|
* Allow the Package Registry to be disabled (#14849)Daniele E. Domenichelli2014-05-121-1/+31
| | | | | | | | | | | | | | | | 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.
* Tests: Improve FindPackageTest for in-source buildsBrad King2014-05-121-1/+1
| | | | | 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.
* Tests: Improve FindPackageTest exported package versionBrad King2014-05-122-2/+9
| | | | | 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.
* CMP0017: Fix check when including from CMake source treeBrad King2014-03-043-3/+3
| | | | | | | | | | 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.
* FPHSA: Add FOUND_VAR option to specify _FOUND variable nameAlex Neundorf2013-02-223-0/+22
| | | | | | | | 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
* Remove CMake-language block-end command argumentsKitware Robot2012-08-1315-56/+56
| | | | | | | | | | | | | | | | | 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
* Convert CMake-language commands to lower caseKitware Robot2012-08-1322-344/+344
| | | | | | | | | | | | | | | | | 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
* add test for #13241: empty SIZEOF_VOIDP in write_basic_package_version_fileAlex Neundorf2012-05-231-0/+12
| | | | Alex
* add macro check_required_components() to configure_package_config_file()Alex Neundorf2012-03-192-0/+16
| | | | | | | | | | | | | 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
* FPHSA(): add HANDLE_COMPONENTS optionAlex Neundorf2012-03-192-0/+16
| | | | | | | | | 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
* find_package: add test for setting Foo_FOUND to FALSE in a Config fileAlex Neundorf2012-03-133-0/+14
| | | | Alex
* WriteBasicConfigVersionFile: add test for ExactVersion modeAlex Neundorf2012-03-101-0/+70
| | | | Alex
* wrap write_basic_config_version_file as write_basic_package_version_file()Alex Neundorf2012-03-071-5/+4
| | | | | | | So the name fits better with configure_package_config_file(), as discussed on the mailing list. Adapt the documentation accordingly. Alex
* add CMakePackageConfigHelpers: configure_package_config_file()Alex Neundorf2012-03-072-0/+33
| | | | | | | | 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
* Set UNSUITABLE instead of not COMPATIBLEAlex Neundorf2011-08-051-0/+11
| | | | Alex
* Add some tests for write_basic_config_version_file()Alex Neundorf2011-08-011-0/+80
| | | | Alex
* Add a basic test for CMAKE_DISABLE_FIND_PACKAGE_<package>Alex Neundorf2011-06-232-1/+5
| | | | Alex
* Test find_package multiarch support (#12037)Brad King2011-06-087-0/+31
|
* find_package: Fix system package registry test path conversionBrad King2011-04-141-1/+1
| | | | | | | 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.
* find_package: Test system package registry when possibleBrad King2011-04-132-0/+42
| | | | | | 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.
* find_package: Forward component list for recursive calls in modulesBrad King2011-04-072-1/+4
| | | | | | | | | 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.
* Improve documentation and messages for the new CMP0017Alex Neundorf2011-01-041-1/+1
| | | | | | This patch incorporates the comments from Brad: -some improvements to the documentation of CMP0017 -make the test QUIETLY search for zlib
* Prefer files from CMAKE_ROOT when including from CMAKE_ROOTAlex Neundorf2011-01-042-1/+10
| | | | | | | | | | | | | | | 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.
* Teach find_* commands to ignore some pathsTodd Gamblin2010-08-133-0/+10
| | | | | | | | 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.