Commit Graph

266 Commits

Author SHA1 Message Date
Brad King 86578eccf2 Simplify CMake per-source license notices
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.
2016-09-27 15:14:44 -04:00
Brad King d4d0c94226 ccmake: Fix recent compilation regression with GCC on Solaris
The change in commit 32f756c8 (CursesDialog: include what you use,
2016-09-01) revealed that an ancient workaround for compiling with GCC
on Solaris has not had an effect in a long time and is now incorrect.
Drop it.
2016-09-14 10:51:27 -04:00
Daniel Pfeifer 32f756c822 CursesDialog: include what you use 2016-09-03 23:37:09 +02:00
Daniel Pfeifer 3838a0d5fb make sure to include cmConfigure.h before cmStandardIncludes.h 2016-09-03 08:04:22 -04:00
Daniel Pfeifer 4988b914e1 CursesDialog: don't use else after return 2016-08-18 19:39:54 +02:00
Brad King 67a7dcef45 Merge topic 'readability-named-parameter'
e7b842e1 Make sure unnused parameters are /*named*/
2016-08-17 10:46:35 -04:00
Daniel Pfeifer e7b842e189 Make sure unnused parameters are /*named*/ 2016-08-17 01:49:57 +02:00
Daniel Pfeifer a2af850ba6 fix a batch of include-what-you-use violations 2016-08-17 01:08:13 +02:00
Paul Seyfert e34e9c2705 ccmake: Add VIM-like bindings for navigation
* scroll with j/k
* toggle bool with space, enter insert mode with i
* bindings not shown at the bottom of the screen, but given in help
2016-08-02 14:53:15 -04:00
Paul Seyfert 9a1b6c6037 ccmake: Revise documentation for [d]
* list it at the bottom of the screen
* different place in help message
2016-08-02 14:53:15 -04:00
Paul Seyfert 31b6cf41c5 ccmake: Fix typo in help (it's -> its) 2016-08-02 14:53:06 -04:00
Daniel Pfeifer 1d6909a287 use CM_NULLPTR 2016-06-28 09:02:26 -04:00
Daniel Pfeifer a7a9239096 mark functions with CM_OVERRIDE 2016-06-27 23:24:38 +02:00
Daniel Pfeifer a16bf141bc Add missing braces around statements.
Apply fixits of clang-tidy's readability-braces-around-statements
checker.
2016-06-10 18:36:24 +02:00
Brad King 811831a958 Merge topic 'simplify-boolean-expressions'
7f6b8d33 Simplify boolean expressions
2016-06-03 10:45:40 -04:00
Daniel Pfeifer 7f6b8d3399 Simplify boolean expressions
Use clang-tidy's readability-simplify-boolean-expr checker.
After applying the fix-its, revise all changes *very* carefully.
Be aware of false positives and invalid changes.
2016-06-02 08:24:04 -04:00
Nicolas BUNEL 18bfbc972f Add option to control 'bin' directory of CMake's own installation (#16076)
Add a `CMAKE_BIN_DIR` cache entry to CMake's own build configuration.
Add a `--bindir` option to the `bootstrap` script to set it.
2016-06-01 11:12:36 -04:00
Daniel Pfeifer 5784747d1b Improve string find: prefer character overloads.
Apply fix-its from clang-tidy's performance-faster-string-find checker.
Ignore findings in kwsys.
2016-05-24 23:22:24 +02:00
Kitware Robot d9fd2f5402 Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2016-05-16 16:05:19 -04:00
Brad King 0ac18d40c8 Remove `//------...` horizontal separator comments
Modern editors provide plenty of ways to visually separate functions.
Drop the explicit comments that previously served this purpose.
Use the following command to automate the change:

    $ git ls-files -z -- \
        "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" |
      egrep -z -v "^Source/cmCommandArgumentLexer\." |
      egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmDependsJavaLexer\." |
      egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmExprLexer\." |
      egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmFortranLexer\." |
      egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" |
      egrep -z -v "^Source/cmListFileLexer\." |
      egrep -z -v "^Source/cm_sha2" |
      egrep -z -v "^Source/(kwsys|CursesDialog/form)/" |
      egrep -z -v "^Utilities/(KW|cm).*/" |
      xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}'

This avoids modifying third-party sources and generated sources.
2016-05-09 09:41:43 -04:00
Brad King e1c7747253 Format include directive blocks and ordering with clang-format
Sort include directives within each block (separated by a blank line) in
lexicographic order (except to prioritize `sys/types.h` first).  First
run `clang-format` with the config file:

    ---
    SortIncludes: false
    ...

Commit the result temporarily.  Then run `clang-format` again with:

    ---
    SortIncludes: true
    IncludeCategories:
      - Regex:    'sys/types.h'
        Priority: -1
    ...

Commit the result temporarily.  Start a new branch and cherry-pick the
second commit.  Manually resolve conflicts to preserve indentation of
re-ordered includes.  This cleans up the include ordering without
changing any other style.

Use the following command to run `clang-format`:

    $ git ls-files -z -- \
        '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' |
      egrep -z -v '(Lexer|Parser|ParserHelper)\.' |
      egrep -z -v '^Source/cm_sha2' |
      egrep -z -v '^Source/(kwsys|CursesDialog/form)/' |
      egrep -z -v '^Utilities/(KW|cm).*/' |
      egrep -z -v '^Tests/Module/GenerateExportHeader' |
      egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' |
      xargs -0 clang-format -i

This selects source files that do not come from a third-party.

Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
2016-04-29 13:58:54 -04:00
Brad King 180538c706 Source: Stabilize include order
Each source file has a logical first include file.  Include it in an
isolated block so that tools that sort includes do not move them.
2016-04-29 13:58:31 -04:00
Daniel Pfeifer 7110b754fe CursesDialog: add missing cmState include 2016-04-29 09:12:32 -04:00
Felix Geyer 49e82c15d5 Fix spelling typos in comments and documentation (#16037)
The Debian package checker tool (lintian) detected several typos in
CMake.
2016-03-29 14:31:02 -04:00
Thomas Klausner 7046eedd38 ccmake: Use more-portable call to set_field_buffer (#15740)
The set_field_buffer function on NetBSD and Solaris:

  http://netbsd.gw.com/cgi-bin/man-cgi?set_field_buffer++NetBSD-current
  https://docs.oracle.com/cd/E36784_01/html/E36880/set-field-buffer-3curses.html

has as third argument "char *" while ncurses has "const char *".  Cast
the argument type in our call to account for the missing "const".
2015-09-16 08:42:20 -04:00
Joerg Sonnenberger da1a02f77f ccmake: Avoid using non-portable 'curcol' field (#15739)
'curcol' is an implementation detail of ncurses so other implementations
of 'form' may not have it.  The switch-to-previous-field logic only
exists for overloaded requests of REQ_DEL_PREV, so no need to check for
REQ_DEL_CHAR.  For REQ_DEL_PREV, check if the field changed and if it
did, change it back.
2015-09-16 08:42:20 -04:00
Joerg Sonnenberger 6c442e5a89 ccmake: Pass format string to 'printw' (#15738)
printw takes a format string as first argument, so don't pass variable
strings to it directly.
2015-09-16 08:42:20 -04:00
Konstantin Podsvirov c823f04e0c CMake: New option CMake_INSTALL_COMPONENTS
By default is OFF.
Now it's used with CPack IFW himself installer.
2015-07-07 09:16:40 -04:00
Konstantin Podsvirov 938bbc4352 CMake: Install COMPONENTs
Added components:
- cmake
- ctest
- cpack
- cmake-gui
- ccmake
- data
- sphinx-html
- sphinx-singlehtml
- sphinx-qthelp

Other now Unspecified.
2015-07-07 08:11:09 +03:00
Stephen Kelly 57bdc1a2f7 cmState: Compute and store directory components.
There is no need to duplicate these in all cmLocalGenerators.

Rename the symbols according to current conventions.

Add explicit calls to Set{Source,Binary}Directory with empty strings
in order to trigger the population of the components containers with
the current working directory in cmLocalGenerator.  Having
directories set to empty is a special case in CMake, which is relied
on for the `if(CMAKE_BINARY_DIR)` condition at the end of
CMakeDetermineSystem.cmake.
2015-05-16 08:11:33 +02:00
Stephen Kelly f081c5bddd cmState: Move CacheEntryType enum from cmCacheManager. 2015-04-13 11:44:16 -04:00
Stephen Kelly ff7169a03c Port to cmState. 2015-04-13 11:44:15 -04:00
Stephen Kelly 3e6a76e48b Port CursesDialog to non-iterator cache API. 2015-04-08 18:47:00 +02:00
Stephen Kelly 14973054a2 Add API for cache loading, deleting and saving to the cmake class.
Migrate existing users of the CacheManager API to use the new
API.  The CacheManager will be going away soon.
2015-04-07 23:25:39 +02:00
Brad King 3347c5e4f9 Revert topic 'refactor-cache-api'
This topic was never tested without some follow-up commits.  The
GetCacheEntryValue API returns a pointer to memory freed on return.
It will have to be revised along with the rest of the original topic.
2015-04-07 17:15:04 -04:00
Stephen Kelly 228c629c18 Port CursesDialog to non-iterator cache API. 2015-04-06 17:58:55 +02:00
Stephen Kelly 1fe7f24c2b Add API for cache loading, deleting and saving to the cmake class.
Migrate existing users of the CacheManager API to use the new
API.  The CacheManager will be going away soon.
2015-04-06 17:58:55 +02:00
Stephen Kelly 7916d7bac6 Include cmAlgorithms where it is used. 2015-03-11 00:17:29 +01:00
Brad King 0f870234fe Merge branch 'backport-no-global-setlocale' into no-global-setlocale
Resolve conflict in Source/CMakeLists.txt by taking both changes.
2015-02-06 13:35:21 -05:00
Brad King 87be2e1427 Do not call setlocale() globally in CMake applications (#15377)
Revert the changes made by commit v3.1.0-rc1~406^2~1 (Encoding: Add
setlocale() to applications, 2014-05-30) and commit v3.1.0-rc1~406^2
(Encoding: Change to only set LC_CTYPE, 2014-06-11), and other setlocale
calls added later in their spirit.  CMake has not been taught how to
deal with non-C locales everywhere.  We do not define any functionality
for character conversions for non-ASCII strings.  Another solution will
be needed to address the original problem motivating addition of
setlocale() calls.
2015-02-06 13:32:26 -05:00
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