Commit Graph

34 Commits

Author SHA1 Message Date
Brad King 58b2d760ee Modules: Format documentation to avoid over-long preformatted lines
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.
2014-10-22 15:52:31 -04:00
Rolf Eike Beer ba907f7dc2 FPHSA: fix when requested or found version is exactly 0
Until now it was checked with "if(VAR)", which will be false in case "0" is the
content of the variable.
2014-10-07 23:14:46 +02:00
Rolf Eike Beer 4f9bf4468b FPHSA: when EXACT version match is requested only compare the components given
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.
2014-10-07 23:14:45 +02:00
Brad King e177e7affb FPHSA: Avoid if() dereferencing of quoted variable
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.
2014-09-11 21:23:24 +02:00
Kitware Robot f051814ed0 Convert builtin help to reStructuredText source files
Run the convert-help.bash script to convert documentation:

 ./convert-help.bash "/path/to/CMake-build/bin"

Then remove it.
2013-10-15 14:12:03 -04:00
Stephen Kelly 78e6217f31 FPHSA: Fix FOUND_VAR check to work with if() auto-dereference
Otherwise, it seems to match on the content of the variable.
2013-03-18 09:35:07 -04:00
Alex Neundorf c1f5780e2d FPHSA: improve documentation
Alex
2013-02-22 08:32:34 -05:00
Alex Neundorf 7bb1abe56a FPHSA: Add FOUND_VAR option to specify _FOUND variable name
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
2013-02-22 08:31:00 -05:00
Alex Neundorf 4809cadfe8 FPHSA: don't succeed if only checking for XX_FOUND (#13755)
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
2012-11-29 09:21:18 +01:00
Rolf Eike Beer 8ebf74b02f Find* (and some other): use ${CMAKE_CURRENT_LIST_DIR} in include()
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
2012-11-04 05:55:37 +01:00
Alex Neundorf ae4ab62569 find_package: add support for a <package>_NOT_FOUND_MESSAGE variable
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
2012-09-28 09:21:36 -04:00
Clinton Stimpson 213a9e5a7b fphsa: clarify message about minimum required version found.
Thanks to Dubrovskiy Viacheslav.
2012-08-15 18:23:55 -06:00
Kitware Robot 9db3116226 Remove CMake-language block-end command arguments
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
2012-08-13 14:19:16 -04:00
Kitware Robot 77543bde41 Convert CMake-language commands to lower case
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
2012-08-13 14:19:16 -04:00
Alex Neundorf b15c0b418b FPHSA(): add HANDLE_COMPONENTS option
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
2012-03-19 10:53:36 -04:00
Alex Neundorf cdabde82c2 FPHSA(): add missing "]" to documentation
Alex
2012-03-19 10:53:36 -04:00
Yury G. Kudryashov 26015baba3 FindPackageHandleStandardArgs: fix documentation
State explicitly what CONFIG_MODE argument does.
2012-01-20 09:09:47 -05:00
Alex Neundorf 567ac0bb1f Also store the required version number in the details message.
This way the success/failure message of FPHSA() is also printed again
if the required version is changed.

Alex
2010-09-27 22:08:14 +02:00
Alex Neundorf 4969c3b5bb Improve version notice in the generated message
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
2010-08-30 22:42:58 +02:00
Alex Neundorf e8ae504c0e Add option CONFIG_MODE to FPHSA()
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
2010-08-29 19:53:43 +02:00
Alex Neundorf cc955a042b Small cleanup of FindPackageHandleStandardArgs.cmake
-remove unnecessary arguments _VAR1
-move code for deciding the type of the message into helper macro
 _FPHSA_FAILURE_MESSAGE()

Alex
2010-08-29 18:55:25 +02:00
Alex Neundorf b173b879f8 Add macro CMakeParseArguments() and use it in FPHSA()
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
2010-08-14 22:06:49 +02:00
Brad King 74805b28c1 Merge topic 'ImprovedVersionCheckingInSomeModules'
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
2010-08-10 14:51:45 -04:00
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -04:00
Alex Neundorf 77d909b559 Fix DETAILS string with version number in FHPSA()
If found, the version which was found should be stored in the DETAILS
string, but it was dereferenced twice, which was wrong.

Alex
2010-08-07 22:30:06 +02:00
Alex Neundorf d016468e9c -fix indentation of the documentation
Alex
2010-07-29 19:09:59 +02:00
Alex Neundorf d358cf5cc4 add 2nd, more powerful mode to find_package_handle_standard_args()
This additional mode also supports version checking and should be
easily extendible, e.g. for COMPONENT stuff.
Updated FindBISON.cmake as first user of this new mode.
Docs updated.

Alex
2010-07-29 00:09:14 +02:00
Brad King c4bb9c9d42 Convert CMake find-modules to BSD License
This adds copyright/license notification blocks CMake's find-modules.
Many of the modules had no notices at all.  Some had notices referring
to the BSD license already.  This commit normalizes existing notices and
adds missing notices.
2009-09-28 11:45:50 -04:00
Alexander Neundorf 3a738a49c3 BUG: fix #6375: print the variables which were not found, so it's easier to
see what went wrong

Alex
2008-05-11 05:12:16 -04:00
Brad King 7a888b68da ENH: Added FindPackageMessage module
- Defines FIND_PACKAGE_MESSAGE function to help display
    find result messages only once
  - Added use of it to FindPackageHandleStandardArgs
  - Added use of it to FindQt4, and FindX11
  - This cleans up repeated messages in big projects
2008-03-17 11:10:42 -04:00
Alexander Neundorf 10dfc89731 STYLE: use a function instead of a macro, to keep FAIL_MESSAGE local
patch from Miguel

Alex
2008-02-06 17:02:53 -05:00
Alexander Neundorf af1b145b3b STYLE: fix typo
Alex
2007-08-06 22:08:59 -04:00
Alexander Neundorf 13db5b578b ENH: add second failure message parameter to
FIND_PACKAGE_HANDLE_STANDARD_ARGS(), so cmake modules can specify their own
better failure messages. If the default is ok use "DEFAULT_MSG".
Do this also for FindBoost.cmake (#5349)

Alex
2007-07-23 09:49:52 -04:00
Alexander Neundorf e118a62709 ENH: add a macro FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
which handles the required and QUIET arguments and sets <NAME>_FOUND

Alex
2007-07-18 13:26:02 -04:00