Commit Graph

226 Commits

Author SHA1 Message Date
Stephen Kelly d92887efab Replace 'foo.size() > 0' pattern with !foo.empty(). 2015-01-18 14:25:24 +01:00
Stephen Kelly 4a6e795b0c Use the cmDeleteAll algorithm instead of trivial raw loops. 2015-01-13 23:00:17 +01:00
Stephen Kelly 26fb50114f Drop SGI as a CMake host compiler.
It has not been tested since commit v3.1.0-rc1~584^2 (Utilities/Release: Drop
IRIX binary generation on ferrari, 2014-04-30).
2015-01-08 22:10:14 +01:00
Sean McBride 111be1801f Rename header guards to not start with double underscore
Use regex to find/replace:

__(cm.*_h)
\1

Then fix QCMake.h by hand.
2014-12-11 13:53:06 -05:00
Ådne Hovda 6b045c3ba8 ccmake: Add CMAKE_USE_SYSTEM_FORM option to use libform instead of cmForm 2014-11-25 11:29:58 -05:00
Brad King 4987b37165 Merge topic 'remove-c_str'
5eb4d759 Remove some unneeded c_str calls.
2014-11-25 10:18:49 -05:00
Stephen Kelly 5eb4d7590e Remove some unneeded c_str calls. 2014-11-23 11:09:54 +01:00
Ådne Hovda 7a68729223 ccmake: Cleanup and simplify conditional blocks for HP-UX 2014-11-18 10:03:35 -05:00
Ådne Hovda 44f02b42fb ccmake: Use standard getmaxyx instead of non-standard getmax[xy]
Swap out getmax[xy]() calls for single call to getmaxyx(), to support
strict X/Open conformant curses implementations, e.g. HP-UX Xcurses.
2014-11-18 10:02:33 -05:00
Ådne Hovda ee3d06a41e ccmake: Remove incomplete support for cur_colr on old HP-UX
Enable support for the more modern Xcurses.
2014-11-18 10:02:08 -05:00
Nils Gladitz cc1139cc30 strings: Remove redundant calls to std::string::c_str()
Replacements were detected and performed by the clang tool
remove-cstr-calls on a linux build.
2014-10-15 14:54:05 +02:00
Brad King 94d1879ba0 Merge topic 'cmake-no-args-output'
de7c2882 cmake,ccmake: Produce shorter output on no arguments (#14973)
2014-06-16 08:54:43 -04:00
Adam Strzelecki de7c2882ff cmake,ccmake: Produce shorter output on no arguments (#14973)
Instead printing complete help cmake/ccmake now prints only Usage section and
extra information how to get more help or start your build.

Implementation Details:

  Usage help type was renamed to Help, and new Usage was introduces that prints
  only command line usage information without any extra details.

  Commands add some extra information when no arguments are passed.
2014-06-13 08:36:43 -04:00
Clinton Stimpson c746b00eee Encoding: Change to only set LC_CTYPE to fix encoding issues with libarchive.
Changing all categories with LC_ALL causes test failures in some locales.
For example, in some locales, the decimal characer could be a comma instead of period.
2014-06-11 22:29:16 -06:00
Clinton Stimpson 730e386291 Encoding: Add setlocale() to applications.
See also bug #14934 where chinese characters could not be used with cpack.
2014-06-03 18:22:25 -06:00
Brad King 73b13f5641 cmSystemTools: Rename ErrorCallback to MessageCallback
Clarify that it is the callback for the cmSystemTools::Message API.
Rename callback clients too.
2014-05-15 10:24:21 -04:00
Brad King 242e13bfe6 Merge topic 'clang-warnings'
8c9c4fe1 Remove 'return' statements that can never be reached
50ca77f4 create_test_sourcelist: Initialize variable at declaration
2014-04-01 11:06:15 -04:00
Sean McBride 8c9c4fe1a6 Remove 'return' statements that can never be reached
Clang -Wunreachable-code-return warns otherwise.
2014-03-31 09:41:05 -04:00
Stephen Kelly 21c573f682 Remove some c_str() calls.
Use the clang RemoveCStrCalls tool to automatically migrate the
code. This was only run on linux, so does not have any positive or
negative effect on other platforms.
2014-03-11 15:03:50 +01:00
Ben Boeckel 94fc63e2d5 stringapi: Use strings for cache iterator values 2014-03-08 13:05:39 -05:00
Ben Boeckel b3bf31a548 stringapi: Miscellaneous char* parameters 2014-03-08 13:05:37 -05:00
Ben Boeckel 270eb96df0 strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.

The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
2014-03-08 13:05:35 -05:00
Ben Boeckel 3742bb0d32 stringapi: Use strings for variable names
Variable names are always generated by CMake and should never be NULL.
2014-03-08 13:05:28 -05:00
Brad King 3a024ce0d8 Merge topic 'unicode-fstream'
5730710 Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
2014-01-07 09:39:17 -05:00
Clinton Stimpson 5730710c86 Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.
Also use SystemTools::Fopen() instead of fopen().
This is to eventually support utf-8 filenames.
2014-01-07 09:27:44 -05:00
Clinton Stimpson a1e542f195 Use Encoding::CommandLineArguments for main() functions. 2014-01-04 10:43:12 -07:00
Brad King d1526f825e Refactor internal resource location APIs and initialization
Rename cmSystemTools::FindExecutableDirectory to FindCMakeResources.
Teach it to compute the locations of cmake, ctest, cpack, ccmake, and
cmake-gui executables, and the location of CMAKE_ROOT.  Provide this
information from static cmSystemTools::Get<resource>() methods.
Refactor code that needs these locations to use the new APIs.

Teach FindCMakeResources to use the OS X system API to lookup the
executable location.  When running from the CMake build tree itself,
leave a file in the tree that FindCMakeResources can use to read the
location of the source tree.  This avoids the need to compile the source
tree location into a binary that may be installed and used without the
source tree.

Teach the QtDialog on OS X to create a "cmake-gui" symlink in the build
tree next to "cmake" and the other tools, as is already done in the
install tree for the application bundle.  This ensures a consistent set
of executables are available in one directory.
2013-11-12 08:23:35 -05:00
Brad King 9b212ad01a Make --help-* options available from all command-line tools
Make the standard --help-* options available from all command-line
tools.  Drop options that are no longer supported:

  --copyright, --help-full, --help-html, --help-man,
  --help-compatcommands, --help-custom-modules

De-duplicate Help/manual/*.1.rst help options by using an
OPTIONS_HELP.txt file included from each manual.
2013-10-16 16:24:51 -04:00
Brad King 0c39a757da Drop the 'Full' field from cmDocumentationEntry
We need only 'Brief' for usage documentation.  We no longer have builtin
'Full' documentation, which is now in Help/*/*.rst files.
2013-10-16 09:22:37 -04:00
Brad King 87cc62cab9 Drop "full" documentation output types
We will no longer support full documentation generation from executables
and will instead generate documentation with other tools.  Disable (with
a warning left behind) the command-line options:

 --copyright
 --help-compatcommands
 --help-full
 --help-html
 --help-man

Drop supporting code.  Drop manual sections generation from executables.
Remove internal documentation construction APIs.  Drop unused sections
See Also, Author, Copyright, Compat Commands, Custom Modules.
2013-10-15 14:12:49 -04:00
Bill Hoffman fadffab538 ccmake: Teach dialog to support cache STRINGS property
This commit adds the ability to ccmake of cycling through cache options.
This uses the STRINGS property of the cache entry. The enter key will cycle
forward, and the right and left arrows will go up and down in the list.
2013-10-07 14:17:54 -04:00
Brad King df62f64db7 Clean up install rules of CMake itself (#14371)
Ensure CMAKE_DATA_DIR, CMAKE_DOC_DIR, and CMAKE_MAN_DIR are always
relative paths in CMake code, and set defaults accordingly.  Use the
install() command instead of install_files() and install_targets().
This is more modern and also avoids stripping of the first character
from user-specified destinations.

While at it, fix the default destinations reported in the bootstrap
help.
2013-08-26 11:54:07 -04:00
Ömer Fadıl USTA 3b849a7ae9 ccmake: Add missing initializers reported by cppcheck
The return statement uses d1, d2, d3, and d4 variables but the code
which initialize them inside a if statement and not always this if
statement is corrent.  On the other hand these variables are using for
return statement and needed to be initialized.  A trivial fix to pervent
some compilers will give build error.

Reviewed-by: Igor Murzov <e-mail@date.by>
2013-07-15 10:20:00 -04:00
Sean McBride 1399825cf9 Remove some uses of obsolete 'register' storage specifier
Remove the keyword from all Source/* files outside of KWSys.
2013-06-28 16:37:49 -04:00
Andreas Mohr bf019d765d Fix spelling and typos (non-binary) 2013-05-07 08:39:19 -04:00
Matthew Woehlke d424de48dc ccmake: Allow DEL key in first column
Change test if DEL key is allowed from 'curcol > 0' to 'curcol >= 0', as
deleting forward is reasonable in the first column (and probably
expected by users to work).

Support for DEL was first added in commit b3b43508 (BUG: fix for 6462,
delete key should delete the current char, 2008-08-19).  The commit
appears to have copied the original logic from the backspace code so the
old 'curcol > 0' logic was accidental rather than intentional.
2012-11-13 13:44:33 -05: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
Kitware Robot 7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with
trailing whitespace.  Wipe out all remnants of trailing whitespace
everywhere except third-party code.

Run the following shell code:

git ls-files -z -- \
 bootstrap doxygen.config '*.readme' \
 '*.c' '*.cmake' '*.cpp' '*.cxx' \
 '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
 '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
2012-08-13 14:18:39 -04:00
David Cole 4f9c114dfa Merge topic 'ImproveCPackDoc-reloaded'
d4b77eb Avoid discovering system infos for documentation. Adding some path is enough.
9002f73 Fix non existent std::string::clear on VS6
02ccb32 Create getDocumentedModulesListInDir which may be used in other context.
24fbc28 Add missing section markup for CPackComponent
bafd8a9 Example of builtin variable documentation (i.e. only used in C++ source code).
543f1ad Make the load of script documentation more efficient and dynamic.
cdbd1a9 Fix another compiler warning due to a typo
52c53de Really avoid compiler warning about unused vars
37f90ed Calm down compiler warning about unused var
7c82b7f Fix potential bad memory access, thanks to Eike
62b589b Suppress unused var, beautify code, avoid 1 extra newline.
751713f Update bash completion file in order to handle new CPack doc options.
1629615 CPack Documentation extraction from CMake script begins to work
83e34dd Implement simple CMake script comment markup language.
c6a0169 CPack begin the implementation of --help-command* and --help-variables*
2012-02-14 16:14:56 -05:00
Nicolas Despres 415ffda7a8 ccmake: Extend clear line.
When configuring or generating the 'ng' of the end of the second line
is not cleared.  This patch fixes this.

The problem was introduced by commit fd632195 (ccmake: Align 'g' and 'q'
key instructions, 2011-01-07) which adjusted the length of lines that
need clearing.
2012-02-06 10:23:50 -05:00
Nicolas Despres 1dd43c4c9d ccmake: Factor clear line. 2012-02-05 15:09:37 +01:00
Eric NOULARD c6a0169442 CPack begin the implementation of --help-command* and --help-variables*
This modifications set tries to keep the unified doc for cmake/ctest/cpack
while introducing tool specific documentation separated.
Some documentation sections for CMake do not fit well to CPack.
2012-01-22 11:42:49 +01:00
Nicolas Despres ceff6ec525 ccmake: Factor toggle key help instructions. 2011-10-23 22:18:14 +02:00
Nicolas Despres 19da10629d ccmake: Document '/' key. 2011-10-23 22:18:14 +02:00
Nicolas Despres fd63219557 ccmake: Align 'g' and 'q' key instructions.
They were miss-aligned with the 'enter' key instruction.

Before:
----
Press [enter] to edit option           CMake Version 2.8.3.20110107-g4b05a-dirty
Press [c] to configure
Press [h] for help         Press [q] to quit without generating
----

After:
----
Press [enter] to edit option           CMake Version 2.8.3.20110107-g4b05a-dirty
Press [c] to configure
Press [h] for help           Press [q] to quit without generating
----
2011-10-23 22:18:14 +02:00
Nicolas Despres de512644d8 Usage: Print help, version and copyright options in usage information.
There were missing for ctest, cpack and ccmake.
2011-10-23 22:18:14 +02:00
Nicolas Despres d3d7e45df2 Remove trailing white-spaces. 2011-10-23 22:15:20 +02:00
Thomas Jarosch d1751fbf17 ccmake: Fix off-by-one memory access error
Credit goes to "cppcheck".

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
2011-09-02 11:15:40 -04:00
Brad King acd8161bad ccmake: Remove extra parens around comparison
The Clang compiler warns about extra parenthesis in the code

  if ((form->curpage == field->page))
      ~              ^             ~

because the idiom is commonly used when an assignment is intended
instead of a comparison.  Remove the extra enclosing layer.
2011-02-15 08:46:50 -05:00