summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary local copies.Daniel Pfeifer2016-05-261-3/+1
| | | | | | | Use clang-tidy's performance-unnecessary-copy-initialization checker. After applying the fix-its (which turns the copies into const&), revise the changes and see whether the copies can be removed entirely by using the original instead.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-1372/+875
| | | | | | | | | | | | | 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Help clang-format wrap after braces on long initializer listsBrad King2016-05-061-0/+1
| | | | | | Add a long comment inside a few braced initializer lists in order to convince clang-format to break after the opening brace and format the list without indenting every value past the opening brace.
* Isolate formatted streaming blocks with clang-format off/onBrad King2016-05-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clang-format tool can do a good job formatting most code, but well-organized streaming blocks are best left manually formatted. Find blocks of the form os << "...\n" "...\n" ; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}' Find blocks of the form os << "...\n" << "...\n" << "...\n"; using the command $ git ls-files -z -- Source | egrep -v -z '^Source/kwsys/' | xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \ '<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}' Surround such blocks with the pair /* clang-format off */ ... /* clang-format on */ in order to protect them from update by clang-format. Use the C-style `/*...*/` comments instead of C++-style `//...` comments in order to prevent them from ever being swallowed by re-formatting of surrounding comments.
* Source: Stabilize include order of sys/types.h before sys/stat.hBrad King2016-05-031-1/+2
| | | | | Include the two headers in an isolated block with a comment separating them so that tools that re-order includes do not re-order these.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | 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.
* Remove unused cmake::IssueMessage overloadBrad King2016-04-181-35/+0
| | | | | | All callers now pass a full backtrace so we do not need the alternative that takes a cmListFileContext directly. Drop this overload to remove the code duplication.
* Avoid depending on CMAKE_ROOT cache entry internally (#16015)Brad King2016-03-161-2/+1
| | | | | | Use cmSystemTools::GetCMakeRoot() which always knows the location of our resources. Do not depend on CMAKE_ROOT because the user could unset it from the cache.
* Drop Visual Studio 7 generator for VS .NET 2002Brad King2016-03-111-4/+0
| | | | This generator has been deprecated since CMake 3.3. Remove it.
* Drop Visual Studio 6 generatorBrad King2016-03-091-4/+0
| | | | | | This generator has been deprecated since CMake 3.3. Remove it. Update documentation, modules, and tests to drop content specific to this generator.
* Add -Werror and -Wno-error command-line optionsMichael Scott2016-01-121-9/+191
| | | | | | | | | Expand the -W set of cmake options to include support for the -Werror and -Wno-error format, which is used to control upgrading and downgrading warning and error messages. Implement support for these new formats for the dev and deprecated message types. Add tests and updated documentation for new options.
* cmake: Deduplicate warning message control codeMichael Scott2015-12-101-42/+24
| | | | | | Remove the duplicate code in cmake::Configure to set the cache variables for the warning message suppression. Replace it with calls to the dedicated methods to carry this out.
* cmake-gui: Add options to control warning messagesMichael Scott2015-12-101-3/+30
| | | | | | | | | Create a new dialog window for the cmake-gui that provides controls for setting the state of suppression of developer and deprecated warning messages. This replaces the previous single checkbox for setting the state of suppression of developer warnings. Added a note for the new functionality to the release notes.
* Explicitly enable deprecated warnings by default.Michael Scott2015-12-011-4/+20
| | | | | | | | | | Explicitly enable deprecated warnings by default, via the cmake::GetSuppressDeprecatedWarnings method, which signals suppression is turned off unless the CMake variables are set as required. Add tests and update the documentation for the new functionality.
* Modify dev warning options to affect deprecated warnings.Michael Scott2015-12-011-0/+26
| | | | | | | | | | | Change the '-Wdev' and '-Wno-dev' options to also enable and suppress the deprecated warnings output, via the 'CMAKE_WARN_DEPRECATED' CMake variable, by default. This action does not happen if the user specifies a deprecated warning message option. Add tests and update the documentation for the new functionality.
* Add -W options to control deprecated warning messages.Michael Scott2015-12-011-0/+20
| | | | | | | | Add 'deprecated' warning options type, to allow setting CMAKE_WARN_DEPRECATED via the -W '-Wdeprecated' and '-Wno-deprecated' options. Add tests for new options and updated documentation.
* Refactor the -W options parser to be generic.Michael Scott2015-12-011-28/+76
| | | | | | Refactor the -Wdev and -Wno-dev options parser to use a generic -W parser that follows the GCC pattern, excluding support for -Werror=TYPE and -Wno-error=TYPE formats for now.
* Explicitly enable author (dev) warnings by default.Michael Scott2015-12-011-5/+20
| | | | | | | | | Explicitly enable author warnings by default, via the cmake::GetSuppressDevWarnings method, which signals suppression is turned off unless the CMake variables are set as required. Add test cases for author and deprecated messages displayed by default.
* Make message suppression more consistent.Michael Scott2015-11-301-13/+57
| | | | | | | | | | | | | | | | Make the message suppression more consistent, by adding a check for the message related CMake variables in cmake::IssueMessage, which allows callers of IssueMessage other than the message command to behave as expected. Also added a check for CMAKE_SUPPRESS_DEVELOPER_WARNINGS in the message command to mirror the deprecated message type behaviour. Added a 'force' flag to the cmake::IssueMessage method, to make the message suppression consistent, when setting the message related CMake variables directly in a CMake file. Expand message command tests to cover the AUTHOR_WARNING message type as well.
* cmake-gui: Add option to specify generator toolsetRobert Dailey2015-11-171-7/+21
| | | | | | | | | | The -T parameter to CMake may now be specified through cmake-gui via a new text field in the first-time configure wizard (below the generator chooser). The generator factories specify whether or not they support toolsets. This information is propagated to the Qt code and used to determine if the selected generator should also display the optional Toolset widgets.
* cmake: Port find_package mode away from GetGeneratorTargetStephen Kelly2015-10-271-4/+7
|
* cmake: Store hardcoded lists of sources and headersStephen Kelly2015-10-271-0/+24
| | | | Don't duplicate this in each cmMakefile.
* cmTarget: Move link type enum out.Stephen Kelly2015-10-141-1/+1
| | | | Remove a reason for generate time code to depend on the cmTarget header/type.
* cmState: Initialize default definitions immediately.Stephen Kelly2015-10-131-0/+5
| | | | Don't leave this as cmMakefile responsibility.
* cmState: Initialize top level source directories immediately.Stephen Kelly2015-10-131-0/+8
| | | | Don't leave this as cmMakefile responsibility.
* cmState: Port away from cmake instance.Stephen Kelly2015-10-101-4/+1
|
* cmState: Move ParseCacheEntry from cmCacheManager.Stephen Kelly2015-10-101-2/+2
|
* cmState: Externalize logic to caller.Stephen Kelly2015-10-101-0/+1
|
* cmCacheManager: Port away from cmake instance.Stephen Kelly2015-10-101-3/+21
|
* cmState: Add cache file manipulation wrappers.Stephen Kelly2015-10-101-3/+3
|
* Inline unary LoadCache.Stephen Kelly2015-10-101-1/+2
|
* cmake: Port away from trivial cmCacheManager use.Stephen Kelly2015-10-101-17/+17
|
* cmake: Use existing cache API wrapper.Stephen Kelly2015-10-101-14/+14
|
* Set the current dirs on the snapshot before creating the cmMakefile.Stephen Kelly2015-10-071-7/+7
| | | | | | The cmMakefile should get a fully prepared snapshot and not clobber its definitions. It should eventually be able to process list files from any starting-point snapshot, though that is some refactoring away still.
* cmake: Remove needless cmLocalGenerator creation.Stephen Kelly2015-10-051-7/+5
|
* Merge topic 'revert-cmake-W-options'Brad King2015-09-251-205/+29
|\ | | | | | | | | | | 2e606306 Merge branch 'improve-variable-help-formatting' into revert-cmake-W-options 81739e92 Revert topic 'cmake-W-options' (#15747)
| * Merge branch 'improve-variable-help-formatting' into revert-cmake-W-optionsBrad King2015-09-221-3/+30
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Resolve conflicts in Help/variable/CMAKE_ERROR_DEPRECATED.rst Help/variable/CMAKE_WARN_DEPRECATED.rst by integrating changes from both sides.
| * | Revert topic 'cmake-W-options' (#15747)Brad King2015-09-221-205/+29
| | | | | | | | | | | | | | | | | | | | | | | | The changes in commit c96fe0b4 (cmake: Add -W options to control deprecation warnings and errors, 2015-07-28) fail to account for -Wdev warnings produced by places in CMake other than message(). This causes a regression in which -Wno-dev fails to suppress such warnings. Revert the feature until it can be revised accordingly.
* | | cmLocalGenerator: Create from already-constructed cmMakefile.Stephen Kelly2015-08-281-8/+10
| | | | | | | | | | | | Don't manage the lifetime of the cmMakefile with cmLocalGenerator.
* | | cmGlobalGenerator: Remove MakeLocalGenerator method.Stephen Kelly2015-08-281-4/+4
| | | | | | | | | | | | Inline implementation to callers.
* | | cmGlobalGenerator: Require a snapshot to create a local generator.Stephen Kelly2015-08-281-4/+8
| | |
* | | cmake: Remove unused cmPolicies member.Stephen Kelly2015-08-231-2/+0
| |/ |/| | | | | | | | | heaptrack showed a 1 byte allocation with the backtrace pointing here, as is the case since commit v3.3.0-rc1~112^2~5 (cmPolicies: Remove unused cmPolicy class., 2015-05-03)
* | cmake: Add support for "--build ." in subdirectory (#15696)Clinton Stimpson2015-08-151-0/+19
| |
* | Merge topic 'bootstrap-no-ninja'Brad King2015-08-111-1/+5
|\ \ | | | | | | | | | | | | 4e3c7725 bootstrap: Do not build Ninja generator
| * | bootstrap: Do not build Ninja generatorBrad King2015-08-101-1/+5
| | | | | | | | | | | | | | | The CMake bootstrap process uses Makefile generators so there is no need to build the Ninja generators during bootstrap.
* | | cmake: Port configure-time code to cmMakefile.Stephen Kelly2015-08-071-1/+1
|/ /
* | Merge topic 'cmake-W-options'Brad King2015-08-041-5/+5
|\ \ | |/ | | | | | | 975426ce cmake: Do not treat developer warnings as errors by default in scripts
| * cmake: Do not treat developer warnings as errors by default in scriptsBrad King2015-08-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | The logic in commit c96fe0b4 (cmake: Add -W options to control deprecation warnings and errors, 2015-07-28) accidentally enables errors on warnings by default in scripts because there is no initialization of CMAKE_SUPPRESS_DEVELOPER_ERRORS to TRUE. Rename internal CMAKE_SUPPRESS_DEVELOPER_ERRORS cache entry to CMAKE_ERROR_DEVELOPER_WARNINGS. Fix the logic in the message() command to treat AUTHOR_WARNING as an error only if the option is explicitly enabled.