Commit Graph

8 Commits

Author SHA1 Message Date
Stephen Kelly efc43cde8f Help: Fix some erroneous code block markers in Module docs.
There are many style errors in these files. This patch fixes only
the syntactical errors.

The script which ported these to rst tripped on some incorrectly
formatted blocks in the original input documentation.  Use a new
script to find problematic code (and then fix them manually):

  #!/usr/bin/env python

  import os

  rootDir = '.'

  def checkFile(fname):

    f = open(fname)
    lines = f.readlines()
    started = False
    counter = 0
    for l in lines:
      if "#" in l:
        started = True
      elif started:
        return
      lin = l.find("(")
      if lin != -1 and l.find(")", lin) == -1 and \
          not "(To distribute this file outside of CMake, substitute the full" in l:
        for lp in lines[counter+1:]:
          if lp == "# ::\n":
            print "\n\n######### " + fname + "\n\n"
            print ''.join(lines[max(counter-2, 0):counter+6])
            break
          elif lp == "#\n" :
            continue
          break
      counter += 1

  for dirName, subdirList, fileList in os.walk(rootDir):
      for fname in fileList:
          checkFile(os.path.join(dirName, fname))
2014-01-07 09:52:56 -05: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
Daniele E. Domenichelli 73d28d2177 CheckStructHasMember: Add support for C++
Previously if headers required to check if a struct has a member can be
compiled with C++ compiler only, the check would fail because the C
compiler fails.  As a consequence, the result variable would be set to
false, even if the struct has that particular member.

Teach CHECK_STRUCT_HAS_MEMBER to accept a new optional argument LANGUAGE
that allows one to explicitly set the compiler to use.  The new
signature is therefore:

  CHECK_STRUCT_HAS_MEMBER (<struct> <member> <header> <variable>
                           [LANGUAGE <language>])
2013-10-08 09:43:06 -04: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
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -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
Alexander Neundorf 3e72dbe4c2 ENH: add macro to test if a member has specified struct, e.g.
check_struct_has_member("struct stat" st_rdev    "${CFG_HEADERS}" HAVE_STRUCT_STAT_ST_RDEV)

Alex
2007-07-12 15:00:37 -04:00