summaryrefslogtreecommitdiffstats
path: root/Tests/FindPackageTest
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Report commit hash in CMake development versionsBrad King2010-04-231-1/+2
| | | | | | For builds from Git repositories, add "-g<commit>" to the end of the version number. If the source tree is modified, append "-dirty". For builds from CVS checkouts, add "-cvs-<branch>".
* Document and test find_package <pkg>_DIR env varBrad King2009-11-041-0/+10
| | | | | The find_package(<pkg>) command checks the <pkg>_DIR environment variable. This commit documents and tests the feature.
* Fix find_package() when <pkg>_DIR is wrongBrad King2009-10-071-3/+33
| | | | | | | | | | | | 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.
* Test the user package registryBrad King2009-09-015-0/+33
| | | | | | We teach the FindPackageTest to build a sample project that stores its build tree in the user package registry using export(PACKAGE), and then find it with find_package.
* ENH: Test find_package re-find featureBrad King2009-01-141-0/+3
| | | | | | | Recently we taught find_package to re-find a package if its <package>_DIR result variable was set to a location not containing the package (instead of reporting an error as before). This tests the feature.
* ENH: Teach find_package about more install dirsBrad King2008-12-175-1/+23
| | | | | | | | | | | | We now search in <prefix>/<name>*/ <prefix>/<name>*/(cmake|CMake) when looking for package configuration files. This is useful on Windows since the Program Files folder is in CMAKE_SYSTEM_PREFIX_PATH. These paths are the Windows equivalent to the Apple convention application and framework paths we already search. See issue #8264.
* ENH: Strengthen FindPackageTest version checkBrad King2008-12-165-3/+14
| | | | | | | | The previous change to test finding in lib/cmake/<name>* weakened the versioned find tests. Since the lib/cmake paths are searched before lib/<name>* paths the previous change skipped requiring the command to ignore zot-3.0 when finding zot-3.1. This change restores that and adds zot-4.0 to test the lib/cmake path.
* ENH: Add useful search locations to find_packageBrad King2008-12-093-2/+2
| | | | | | | | | | This teaches find_package to search <prefix>/(share|lib)/cmake/<name>*/ for package configuration files. Packages that do not already have files in a <prefix>/lib/<name>* directory can use this location to avoid cluttering the lib directory.
* ENH: Remove implicit NO_MODULE when recursingBrad King2008-10-081-1/+1
| | | | | | | | | Recently we taught find_package that the NO_MODULE option is implied when it is recursively invoked in a find-module. This behavior may be confusing because two identical calls may enter different modes depending on context. It also disallows the possibility that one find-module defers to another find-module by changing CMAKE_MODULE_PATH and recursively invoking find_package. This change reverts the feature.
* ENH: Add UNSUITABLE result to package version testBrad King2008-10-032-0/+12
| | | | | | | Package version test files may now declare that they are unsuitable for use with the project testing them. This is important when the version being tested does not provide a compatible ABI with the project target environment.
* ENH: Help recursive find_package calls in modulesBrad King2008-10-035-0/+13
| | | | | | | These changes teach find_package to behave nicely when invoked recursively inside a find-module for the same package. The module will never be recursively loaded again. Version arguments are automatically forwarded.
* ENH: Add version comparison to if() commandBrad King2008-09-101-0/+17
| | | | | | Provide VERSION_LESS, VERSION_EQUAL, and VERSION_GREATER operators in the if() command. This simplifies component-wise comparison of version numbers in the form "major[.minor[.patch[.tweak]]]".
* ENH: Improve find_package version numberingBrad King2008-09-105-9/+46
| | | | | | | | 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.
* ENH: Add test for new find_* command HINTS option.Brad King2008-06-093-0/+10
|
* ENH: preclean some warningsKen Martin2008-03-251-0/+1
|
* ENH: Added version support to Config mode of find_package command.Brad King2008-01-299-1/+77
| | | | | | - Added EXACT option to request an exact version. - Enforce version using check provided by package. - Updated FindPackageTest to test versioning in config mode.
* ENH: Implement version support in the find_package command module mode. ↵Brad King2008-01-214-0/+43
| | | | 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.
* ENH: Updated FindPackageTest to test new find_package command features.Brad King2008-01-1711-0/+70
|
* ENH: Renamed CMAKE_FIND_PREFIX_PATH to CMAKE_PREFIX_PATH for brevity and ↵Brad King2007-12-191-3/+3
| | | | consistency with other find path variable names.
* ENH: add support for CMAKE_FIND_PREFIX_PATH as discussed with Brad.Alexander Neundorf2007-10-262-0/+13
| | | | | | | | CMAKE_FIND_PREFIX_PATH is both an environment variable and a cmake variable, which is a list of base directories where FIND_PATH, FIND_FILE, FIND_PROGRAM and FIND_LIBRARY will search in the respective subdirectories Alex
* ENH: remove the watch for the upper case variable name, it breaks theAlexander Neundorf2007-08-081-1/+1
| | | | | | | feature summary, which needs to check for both the upper case and original case _FOUND variables Alex
* BUG: disable this test temporarilyAlexander Neundorf2007-08-071-1/+1
| | | | Alex
* ENH: Added FindPackageTest to improve coverage.Brad King2003-07-242-0/+16