Commit Graph

44 Commits

Author SHA1 Message Date
Brad King 7aa97b948f FeatureSummary: Add include() to examples
Since this module's documentation already includes complete usage
examples, make them more complete by showing the include() explicitly.

Issue: #16309
2016-09-15 11:34:34 -04:00
Brad King 46ded385c0 FeatureSummary: Format documentation
Revise the documentation using reStructuredText inline markup and
explicit blocks so that it formats well.
2016-09-15 11:33:24 -04:00
Brad King 5d17e99580 FeatureSummary: Convert docs to a bracket comment
Use a bracket comment to hold the documentation instead of a block of
line comments.  This will make further updates easier.
2016-09-15 09:50:32 -04:00
Brad King 7c92c84302 FeatureSummary: Order function implementations the same as the documentation 2016-09-15 09:49:03 -04:00
Daniel Pfeifer 5d0d980d99 Use string(APPEND) in Modules
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'
2016-07-28 00:41:13 +02:00
Daniele E. Domenichelli a7631fc4e0 Modules: Check for ARGC before using ARGV#
ARGV# could be defined from a parent scope.
2015-02-27 10:59:23 -05:00
Gregor Jasny 38ef2b7363 FeatureSummary: Print each feature info only once
If a feature is added multiple times via ADD_FEATURE_INFO it should
appear only once in FEATURE_SUMMARY.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2015-02-23 11:39:17 -05:00
Christoph Grüninger b79d8f2934 FeatureSummary: Fix bracket in documentation. 2015-01-23 09:02:48 -05:00
Brad King 20c5f4fbd9 Modules: Wrap long lines in pre-formatted documentation blocks
Help format the blocks better for display without a wide screen.
2014-11-06 14:52:26 -05:00
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 7eacbaed4d Replace MATCHES ".+" tests with NOT STREQUAL "" 2014-04-14 18:17:23 +02:00
Daniele E. Domenichelli 1af77f3f1d FeatureSummary: Add missing titles for PACKAGES_FOUND and PACKAGES_NOT_FOUND
Since now these can be used with the WHAT argument a title is required.
2014-03-14 11:51:51 +01:00
Daniele E. Domenichelli d348cd1bc5 FeatureSummary: Allow to combine and reorder values for the "WHAT" option
For example it is now possible to do:

  feature_summary(WHAT ENABLED_FEATURES
                       DISABLED_FEATURES)

That produces an output like:

  --
  -- The following features have been enabled:

   * Feature1
   * Feature2

  -- The following features have been disabled:
   * Feature2

Skipping the lists that are empty.

Without this patch this would require to do:

  message(STATUS "")
  feature_summary(WHAT ENABLED_FEATURES
      DESCRIPTION "The following features have been enabled:")
  feature_summary(WHAT DISABLED_FEATURES
      DESCRIPTION "The following features have been disabled:")

And empty lists would not be skipped.

The behaviour when WHAT has a single argument (ALL or any option) is
unchanged.
2014-03-03 19:52:13 +01:00
Stephen Kelly a6971f6510 FeatureSummary: Don't list transitive package dependencies
Set a global property in the find_package implementation.  Track and
reset that property in the find_dependency macro.  Read the property
in FeatureSummary when determining whether to print output.

This means that packages which are found only as dependencies are not
listed by FeatureSummary, but if a project uses find_package elsewhere
directly, then it will be listed by FeatureSummary.

Suggested-by: Alex Merry

 http://thread.gmane.org/gmane.comp.kde.devel.frameworks/10640
2014-02-03 20:20:42 +01: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
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
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 b1d7c4b1d2 FeatureSummary.cmake: nicer formatting
Alex
2012-05-13 14:37:51 +02:00
Modestas Vainius d36d29f1f0 various typo and formatting fixes in manual pages (#12975)
The patch fixes the following lintian warnings:

W: cmake-data: manpage-has-errors-from-man usr/share/man/man1/cmakemodules.1.gz 2728: warning: macro `..' not defined
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz overriden overridden
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz overriden overridden
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz explicitely explicitly
I: cmake-data: spelling-error-in-manpage usr/share/man/man1/cmakemodules.1.gz jave java
W: cmake-data: manpage-has-errors-from-man usr/share/man/man1/cmakeprops.1.gz 1040: warning [p 25, 3.7i]: can't break line
W: cmake: manpage-has-errors-from-man usr/share/man/man1/cmake.1.gz 4233: warning [p 85, 1.3i]: can't break line
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz overriden overridden
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz overriden overridden
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz explicitely explicitly
I: cmake: spelling-error-in-manpage usr/share/man/man1/cmake.1.gz jave java
2012-02-18 16:12:45 +01:00
Alex Neundorf 0ba98533d0 Don't warn when setting a property multiple times to the same value #12464
Patch by Yury Kudryashov

Alex
2011-09-18 12:51:05 +02:00
Alex Neundorf b7ac63e1c1 Fix typos in FeatureSummary.cmake (#12462)
Patch by Yury Kudrashov

Alex
2011-09-18 12:46:29 +02:00
Stephen Kelly 356cef2198 Make the formatting of feature_summary output a little better. 2011-08-27 09:26:26 +02:00
Alex Neundorf b62349cc60 FeatureSummary.cmake: update documentation
Alex
2011-07-17 21:23:13 +02:00
Alex Neundorf f366cf8a86 FeatureSummary.cmake: cosmetics
-move the compat function to the bottom of the file
-make all except one endif() empty

Alex
2011-07-17 20:47:11 +02:00
Alex Neundorf f407bb5da2 FeatureSummary.cmake: only higher TYPEs can override previous TYPEs
This way e.g. a REQUIRED cannot become OPTIONAL, only the other way round

Alex
2011-07-17 20:41:09 +02:00
Alex Neundorf 02d47abe58 FeatureSummary.cmake: error out when a REQUIRED package is missing
Alex
2011-07-17 20:26:49 +02:00
Alex Neundorf 91a1527735 FeatureSummary.cmake: add INCLUDE_QUIET_PACKAGES keyword
Now found packages are not stored in ENABLED/DISABLED_FEATURES
anymore, but always in PACKAGES_FOUND/NOT_FOUND.
ENABLED/DISABLED_FEATURES is now only used via
ADD_FEATURE_INFO(), e.g. for stuff set via option().

Alex
2011-07-17 17:48:00 +02:00
Alex Neundorf 0671a02920 FeatureSummary.cmake: remove "comment" field
What was given as comment to set_package_info(), now goes into
the PURPOSE field. It was not clear what the comment should contain,
with the PURPOSE this is much clearer now.

Alex
2011-07-17 16:03:38 +02:00
Alex Neundorf aae13f4c8e Extend FeatureSummary: add PURPOSE of package and TYPE
With the PURPOSE a project can state what the package in question
is used for in the project (as opposed to describing what the package
does in general).
TYPE can be one of OPTIONAL (default)
                   RUNTIME - not needed for building, only at runtime
                   RECOMMENDED - as OPTIONAL, but you should really have it
                   REQUIRED - cmake will fail if one of these is not found

This can be set using the new function set_package_properties()

Alex
2011-07-17 15:57:50 +02:00
Alex Neundorf b935f00fdf Close ENDFUNCTION() properly with the same name as FUNCTION()
Alex
2010-09-21 22:43:04 +02:00
Alex Neundorf 07bca48868 Set a default DESCRIPTION if none is given for ALL mode of feature_summary()
Alex
2010-09-21 22:31:04 +02:00
Alex Neundorf d5b29155b4 APPEND and not-APPEND mode of feature_summary() were swapped
Alex
2010-09-21 22:27:14 +02:00
Alex Neundorf 88e6447e19 Add macro ADD_FEATURE_INFO() and improve docs.
ADD_FEATURE_INFO() can be used to set the info for a feature,
e.g. an option().
set_feature_info() has been renamed to set_package_info(), since this is
about found or not found packages. For compatiblity set_feature_info()
is still provided.

Alex
2010-08-25 21:53:16 +02:00
Alex Neundorf b35352464c Improve wording of the documentation.
Alex
2010-08-24 23:08:41 +02:00
Alex Neundorf 6fc88b26b6 Improve documentation.
Alex
2010-08-24 22:59:01 +02:00
Alex Neundorf 33338781db Log the required package version and major improvement to FeatureSummary
find_package() now also stores the required version automatically, so it
can be used by FeatureSummary.cmake.
This was one of the requested features for setting up nightly builds
for KDE, since with this functionality it will be possible to write
a file at the end of each project which lists all required packages
and their versions. This file could then be compared for equality
with an older one and if something has changed the build maintainer
can be emailed.

In FeatureSummary.cmake there is now a new function feature_summary(),
which also allows to print the log to a file or into a variable.
It also allows to specify whether to append to a file or to write a new
one, and what information to log.

Docs are still missing.

Alex
2010-08-24 21:24:54 +02:00
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -04:00
Alexander Neundorf b143c335fd make it more robust wrt. #9621
although #9621 did not happen anymore with cmake 2.8.0, probably because
GET_PROPERTY(... GLOBAL ...) now makes the result variable empty instead of
simply not touching it, using FUNCTION() instead of MACRO() makes sure that
the _EnabledFeatures variables is always empty before the GET_PROPERTY()
call (and does not still have the old value from the previous call)

Alex
2009-10-14 18:13:49 -04:00
Brad King 3a666595c9 Convert CMake non-find modules to BSD License
This adds copyright/license notification blocks CMake's non-find
modules.  Most 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:46:51 -04:00
Ken Martin f686dbecb6 some white space fixes for the book 2009-09-03 15:29:29 -04:00
Brad King 669db35aa4 ENH: Changed signature of GET_PROPERTY command to be more powerful and extendible. 2008-01-17 17:19:13 -05:00
Brad King b8357db11d ENH: Rename SET_PROPERITES command to SET_PROPERTY and give it a more powerful signature. 2008-01-17 15:54:49 -05:00
Alexander Neundorf 8d7b502337 ENH: add global properties for collecting enabled/disabled features during
the cmake run and add macros print_enabled/disabled_features() and
set_feature_info(), so projects can get a nice overview at the end of the
cmake run what has been found and what hasn't
FIND_PACKAGE() automatically adds the packages to these global properties,
except when used with QUIET
Maybe this can also be useful for packagers to find out dependencies of
projects.

Alex
2007-08-07 15:41:57 -04:00