summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* cmake-server: Report server mode availablitily in CapabilitiesTobias Hunger2016-09-191-8/+4
| | | | | Report the availability of the server-mode in the output of cmake -E capabilities.
* cmake: Fix --find-package mode link line outputBrad King2016-09-161-2/+2
| | | | | | | | | | Refactoring in commit v2.8.10~58^2~2 (Ninja: move -LIBPATH behind -link option, 2012-09-26) added arguments to cmLocalGenerator::GetTargetFlags and updated the call sites. However, in the cmake::FindPackage and cmLocalGenerator::AddBuildTargetRule call sites it added the new arguments in the wrong order. The latter was never used and has been removed. The former remains buggy and prints out compiler flags instead of the link framework/library search paths. Fix its argument order.
* cmake: Make FindCacheFile a static methodBrad King2016-09-141-1/+1
| | | | It does not need access to member data.
* cmake: Factor out method to find the CMakeCache.txt fileTobias Hunger2016-09-121-17/+23
|
* cmake: Introduce ReportCapabilitiesJsonTobias Hunger2016-09-121-5/+12
| | | | | | | Introduce cmake::ReportCapabilitiesJson which returns a the Json object that is serialized in cmake::ReportCapabilities. This allows to re-use the information in cmake-server.
* VS15: Add Visual Studio 15 generatorBrad King2016-09-071-0/+3
| | | | | | | | | | | | | | | | Call the generator "Visual Studio 15" without any year because the preview version of VS 15 does not provide a year in the product name. Copy cmGlobalVisualStudio14Generator to cmGlobalVisualStudio15Generator and update version numbers accordingly. Add the VS15 enumeration value. Note that we do not need to add a MSVC15 variable or v150 toolset because Visual Studio 15 comes with an updated version of the v140 toolset and remains ABI-compatible. Teach tests VSExternalInclude, RunCMake.GeneratorPlatform, and RunCMake.GeneratorToolset to treat VS 15 as they do VS 10-14. Closes: #16143
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-15/+26
|
* cmMessenger: Extract from cmake classStephen Kelly2016-08-251-163/+13
| | | | | | | | This way messages can be issued independent of the cmake instance. It is now possible to make DisplayMessage a virtual interface and override it to handle messages in the cmake-gui or future IDE interaction interfaces.
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-12/+8
|
* Merge topic 'readability-named-parameter'Brad King2016-08-171-2/+3
|\ | | | | | | | | e7b842e1 Make sure unnused parameters are /*named*/
| * Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-2/+3
| |
* | cmake: Add `cmake -E capabilities` modeTobias Hunger2016-08-161-0/+78
| | | | | | | | | | | | | | Add `cmake -E capabilities` to report on generators, cmake version and possibly other static capabilities of cmake. Closes: #15462
* | cmake: Constify cmake::GetRegisteredGeneratorsBrad King2016-08-161-1/+2
|/
* Report more information about extra generators in generator factoriesTobias Hunger2016-08-031-0/+7
|
* Refactor extra generator registration to use factoriesTobias Hunger2016-08-031-59/+86
| | | | | | | | | | | This will allow additional information about the availability and capabilities of extra generators to be queried without actually creating them. Instead of a static NewFactory() method like the main generator factories have, use a static GetFactory() method to get a pointer to a statically allocated extra generator factory. This simplifies memory management.
* Use better KWSys SystemTools::GetEnv and HasEnv signaturesDāvis Mosāns2016-07-181-15/+6
|
* CMake: Report whether generators support platformsTobias Hunger2016-07-141-0/+2
|
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-9/+7
| | | | | | | | | | | | Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to our own implementation adopted from the KWSys auto_ptr implementation. Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers that do not warn about it. Automate the client site conversions: git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \ 's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
* use CM_NULLPTRDaniel Pfeifer2016-06-281-10/+11
|
* cmake: Add an option to control what files needs to be tracedAlex Turbov2016-06-171-0/+5
| | | | | | | | | | Even in relatively small projects using `--trace` (and `--trace-expand`) may produce a lot of output. When developing a custom module usually one is interested in output of only a few particular modules. Add a `--trace-source=<file>` option to enable tracing only a subset of source files. The final output would be only from requested modules, ignoring anything else not matched to given filename(s).
* Remove redundant arguments from fstream constructorsDaniel Pfeifer2016-06-141-1/+1
| | | | Don't pass the default value of the openmode parameter explicitly.
* Merge topic 'fix-cmake-ISP-violation'Brad King2016-06-131-9/+13
|\ | | | | | | | | | | 23f87e81 cmake: Remove force from IssueMessage API 54c65d5f cmake: Extract DisplayMessage API.
| * cmake: Remove force from IssueMessage APIStephen Kelly2016-06-121-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The force parameter is ugly and makes the method harder to reason about (issues the message ... but maybe it doesn't ... but then again you can force it). It is a violation of https://en.wikipedia.org/wiki/Interface_segregation_principle and is the kind of thing described in a recent blog here: http://code.joejag.com/2016/anti-if-the-missing-patterns.html "Any time you see this you actually have two methods bundled into one. That boolean represents an opportunity to name a concept in your code."
| * cmake: Extract DisplayMessage API.Stephen Kelly2016-06-121-0/+6
| |
* | cmake: Issue message independent of cmMakefile definitionStephen Kelly2016-06-121-43/+17
|/ | | | | | | | | | | | | | | | | The makefile is only used when called by the cmMessageCommand, so inline the use of it there. It otherwise creates an undesirable dependency on cmMakefile for issuing messages in the cmake instance, a violation of the Interface Segregation Principle. https://en.wikipedia.org/wiki/Interface_segregation_principle This also makes it more explicit that the variable definitions only affect the message() command. If an AUTHOR_WARNING is issued for any other reason, it is not affected. To affect that, it is necessary to set the cache variable instead of the regular variable. This is an unfortunate interface quirk, but one which can't be fixed easily now.
* Merge topic 'refactor-cmLocalGenerator-flags'Brad King2016-06-091-2/+5
|\ | | | | | | | | b0d3e693 cmLocalGenerator: Pass configuration to GetTargetFlags
| * cmLocalGenerator: Pass configuration to GetTargetFlagsTobias Hunger2016-06-081-2/+5
| | | | | | | | | | Move the configuration lookup to call sites. This will allow multi-configuration callers to use the method.
* | cmake: remove unnused member VerboseDaniel Pfeifer2016-06-081-7/+2
| |
* | cmake: Fix constness of methodsStephen Kelly2016-06-081-7/+8
| |
* | cmake: Make internal method file staticStephen Kelly2016-06-081-2/+2
|/
* 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.