summaryrefslogtreecommitdiffstats
path: root/Modules/FindPackageHandleStandardArgs.cmake
Commit message (Collapse)AuthorAgeFilesLines
* FPHSA: Fix regression when VERSION_VAR is missingBrad King2022-09-151-9/+13
| | | | | | | | | If a package is found but FPHSA is called by the find module without a `VERSION_VAR`, and the `find_package` call specifies a version, we have previously accepted the package as found. This was accidentally regressed by commit 8f50f135ae (FPHSA: Improve error message when VERSION_VAR is empty or has been unset(), 2022-08-01). Restore it and add a test case.
* FPHSA: Improve error message when VERSION_VAR is empty or has been unset()Andrea Pappacoda2022-09-071-2/+4
| | | | | | | | | Previously, when `VERSION_VAR` is set but empty, FPHSA emitted a confusing error message, saying that the package was found but of an unsuitable version "". Fix the error message to state that the package was not found. Fixes: #23807
* Help: Add `.. versionadded` directives to module docsNikita Nemkin2020-12-021-3/+15
| | | | Issue: #19715
* FPHSA: ensure it can be used outside 'find_package'Marc Chevrier2020-11-251-2/+7
| | | | Fixes: #21505
* find_package: raise error on empty version rangeMarc Chevrier2020-09-291-7/+3
|
* FPHSA: avoid spurious error if version variable is not definedMarc Chevrier2020-09-251-1/+1
| | | | Fixes: #21241
* FPHSA: add support of version rangeMarc Chevier2020-09-231-58/+184
|
* FPHSA: REQUIRED_VARS is optional if HANDLE_COMPONENTS is specifiedMarc Chevrier2020-04-301-4/+17
| | | | Fixes: #20655
* FPHSA: Check _FOUND var name with STREQUALFeRD (Frank Dana)2020-01-241-2/+4
| | | | | | Using MATCHES "^${_Name}_FOUND$" limits the name of the found variable, since it can't contain any regular expression special-chars (period, plus sign, etc.)
* FPHSA: detect package name mismatchesBen Boeckel2020-01-141-3/+53
| | | | | | | The `FPHSA_NAME_MISMATCHED` variable may be set if this is intentional (but should be cleared after the call to not affect other FPHSA calls). It may also be passed via the `NAME_MISMATCHED` option for new-signature FPHSA calls.
* FPHSA: add capability to specify message explaining reason of failureMarc Chevrier2019-09-271-6/+21
| | | | Fixes: #19660
* FPHSA: Remove extra space in module components reportSylvain Joubert2019-08-061-2/+2
|
* doc: Consistently use <PackageName> for describing the name of a packageJean-Christophe Fillion-Robin2018-08-141-2/+2
|
* FPHSA: replace left-over VERSION by _FOUND_VERSION.Yves Frederix2017-09-141-1/+1
| | | | | | | This was accidentally left out of commit aec27c152e (FPHSA: use more localized _FOUND_VERSION instead of VERSION, 2017-09-05). Fixes: #17281
* FPHSA: lower-case for cmake_parse_arguments + move config-mode related codeYves Frederix2017-09-051-16/+16
|
* FPHSA: use more localized _FOUND_VERSION instead of VERSION.Yves Frederix2017-09-051-13/+14
| | | | This fixes the failing unit tests in which a cache variable VERSION is present or the found version is 0.
* FPHSA: remove extra spaceBen Boeckel2017-05-151-2/+2
| | | | | | Each missing variable is added to the string as " ${var}" which causes the string to always have a leading space. Remove the duplicate space due to this in the output.
* Don't include CMakeParseArgumentsDaniel Pfeifer2017-01-111-1/+0
| | | | | | | | | | | | The cmake_parse_arguments command is builtin with version 3.5. The CMakeParseArguments module is empty and exists for backwards compatibility with CMake 3.4 and lower. Remove the includes of CMakeParseArguments from CMake's modules. The modules are always used with the current version of CMake. Leave the includes in the tests, as the tests may be run with an older version of CMake.
* Simplify CMake per-source license noticesBrad King2016-09-271-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Use string(APPEND) in ModulesDaniel Pfeifer2016-07-271-9/+9
| | | | | | | Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* FPHSA: fix typo in documentationRolf Eike Beer2015-08-241-1/+1
|
* FPHSA: Document REQUIRED_VARS recommendation (#15352)Brad King2015-04-171-0/+4
| | | | State explicitly that the variables specified are user-facing.
* FPHSA: Revise and format documentationBrad King2015-04-171-110/+123
| | | | Use better reStructuredText markup and add cross-references.
* FPHSA: Always populate the ExactCase_FOUND variable (#15412).Stephen Kelly2015-04-171-31/+28
| | | | | | | | | | | 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.
* FPHSA: Revise documented command signatureGregor Jasny2015-03-181-1/+1
| | | | | | | For mode 2 the first argument is not the literal NAME but the package name. Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* FPHSA: remove unneeded variable dereferencingRolf Eike Beer2014-10-251-2/+2
| | | | | | These variables can be dereferenced by if() alone so do not do it here, avoiding the risk of their content being treated as a variable name and dereferenced again.
* Modules: Format documentation to avoid over-long preformatted linesBrad King2014-10-221-13/+15
| | | | | | Convert several preformatted code block literals that enumerate lists of options or variables to use reST definition lists instead. Manually wrap other long lines in code blocks.
* FPHSA: fix when requested or found version is exactly 0Rolf Eike Beer2014-10-071-3/+4
| | | | | Until now it was checked with "if(VAR)", which will be false in case "0" is the content of the variable.
* FPHSA: when EXACT version match is requested only compare the components givenRolf Eike Beer2014-10-071-4/+32
| | | | | | | | | Given that you have a foobar that identifies itself as 1.2.3 from now on a find_package(foobar 1.2 EXACT) will succeed, as 1.2.3 will now be considered as being 1.2. Until now this was only the case for version 1.2.0.
* FPHSA: Avoid if() dereferencing of quoted variableBrad King2014-09-111-1/+1
| | | | | | | Legacy invocations may pass a variable name where "DEFAULT_MSG" belongs. When comparing FPHSA_FAIL_MESSAGE to "DEFAULT_MSG", use a leading "x" on both sides to avoid mistaking the value of the message for a variable name.
* Convert builtin help to reStructuredText source filesKitware Robot2013-10-151-66/+94
| | | | | | | | Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.
* FPHSA: Fix FOUND_VAR check to work with if() auto-dereferenceStephen Kelly2013-03-181-1/+1
| | | | Otherwise, it seems to match on the content of the variable.
* FPHSA: improve documentationAlex Neundorf2013-02-221-8/+12
| | | | Alex
* FPHSA: Add FOUND_VAR option to specify _FOUND variable nameAlex Neundorf2013-02-221-15/+32
| | | | | | | | 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
* FPHSA: don't succeed if only checking for XX_FOUND (#13755)Alex Neundorf2012-11-291-1/+4
| | | | | | | | | | | | | This fixes issue #13755. FPHSA(XX DEFAULT_MSG XX_FOUND) always succeeded due to the way how the XX_FOUND variable was set. It was preset to TRUE, and then reset to FALSE if something was missing (...which had the effect that XX_FOUND itself was already preset when FPHSA checked whether XX_FOUND is set) Now XX_FOUND is unset first, and only later on set to TRUE. Alex
* Find* (and some other): use ${CMAKE_CURRENT_LIST_DIR} in include()Rolf Eike Beer2012-11-041-2/+2
| | | | | | This solves a lots of warnings, e.g. in the FindModulesExecuteAll test. If the installed version on the system is rather old this may even lead to bugs, e.g. https://bugs.gentoo.org/show_bug.cgi?id=436540
* find_package: add support for a <package>_NOT_FOUND_MESSAGE variableAlex Neundorf2012-09-281-0/+3
| | | | | | | | 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
* fphsa: clarify message about minimum required version found.Clinton Stimpson2012-08-161-1/+1
| | | | Thanks to Dubrovskiy Viacheslav.
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-44/+44
| | | | | | | | | | | | | | | | | 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-131-151/+151
| | | | | | | | | | | | | | | | | 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
* FPHSA(): add HANDLE_COMPONENTS optionAlex Neundorf2012-03-191-2/+38
| | | | | | | | | 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
* FPHSA(): add missing "]" to documentationAlex Neundorf2012-03-191-1/+1
| | | | Alex
* FindPackageHandleStandardArgs: fix documentationYury G. Kudryashov2012-01-201-3/+3
| | | | State explicitly what CONFIG_MODE argument does.
* Also store the required version number in the details message.Alex Neundorf2010-09-271-1/+1
| | | | | | | This way the success/failure message of FPHSA() is also printed again if the required version is changed. Alex
* Improve version notice in the generated messageAlex Neundorf2010-08-301-53/+61
| | | | | | | | | | Now the version number is also printed if no required version was specified, but a version number was detected (showing more information shouldn't hurt). The code for generating the failure message in config-mode is moved into a separate helper macro, it was becoming too much. Alex
* Add option CONFIG_MODE to FPHSA()Alex Neundorf2010-08-291-9/+55
| | | | | | | | When this option is used for FPHSA(), it automatically handles the information created by a preceding find_package(NO_MODULE) all and creates a proper success/error message. Alex
* Small cleanup of FindPackageHandleStandardArgs.cmakeAlex Neundorf2010-08-291-21/+17
| | | | | | | | -remove unnecessary arguments _VAR1 -move code for deciding the type of the message into helper macro _FPHSA_FAILURE_MESSAGE() Alex
* Add macro CMakeParseArguments() and use it in FPHSA()Alex Neundorf2010-08-141-71/+29
| | | | | | | | | This adds a macro cmake_parse_arguments() (as discussed on cmake-devel) which can be used in macros or functions to help with parsing its arguments. Detailled docs are included. find_package_handle_standard_args() is the first user of this new macro. Alex
* Merge topic 'ImprovedVersionCheckingInSomeModules'Brad King2010-08-101-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | 430336c Merge branch 'findsubversion_fphsa_cleanup' b6c6156 Use FPHSA() in FindSWIG, including version checking. 656cd2f Improved version checking for FindCUDA using the new mode of FPHSA 126db7b Improved version checking for FindSubversion using the new mode of FPHSA() 77d909b Fix DETAILS string with version number in FHPSA() 19b68b9 Improved version checking for FindJava using the new FPHSA() mode 6bb0b6e Improved version checking for FindRuby using the new mode of FPHSA() 946493f FindSquish doesn't detect the version, remove that from the documentation cb9d1ea Add version checking support to FindFlex and FindPerlLibs
| * Fix DETAILS string with version number in FHPSA()Alex Neundorf2010-08-071-1/+1
| | | | | | | | | | | | | | If found, the version which was found should be stored in the DETAILS string, but it was dereferenced twice, which was wrong. Alex