summaryrefslogtreecommitdiffstats
path: root/Source/cmakemain.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Windows: Use UTF-8 for pipes in CMake, CTest and CPackDāvis Mosāns2016-11-291-0/+2
| | | | | Applications which process CMake output will need to decode it as UTF-8 instead of console's codepage.
* VS: Teach `cmake --build` to reconfigure if needed before buildingYves Frederix2016-11-171-0/+2
| | | | | | | Visual Studio's build system does not cleanly handle itself being re-generated during the build. Teach `cmake --build` to check whether the build system needs to be re-generated before launching the native build tool.
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-0/+1
|
* Enable Unicode output to Windows consolesDāvis Mosāns2016-10-261-0/+8
| | | | | | Use KWSys ConsoleBuf to replace the `streambuf` on `std::cout` and `std::cerr` so that process output can be encoded correctly for display in a Windows console.
* cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-3/+3
| | | | Port dependent code to the change.
* 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.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-4/+9
|
* cmake: Add trivial usage of libuvBrad King2016-08-311-0/+7
| | | | | This will serve to make sure cmake actually compiles and links against libuv.
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-4/+5
|
* Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-2/+2
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-12/+13
|
* cmake: Add an option to control what files needs to be tracedAlex Turbov2016-06-171-0/+2
| | | | | | | | | | 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).
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-209/+139
| | | | | | | | | | | | | 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-5/+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.
* Isolate formatted streaming blocks with clang-format off/onBrad King2016-05-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Drop Visual Studio 6 generatorBrad King2016-03-091-7/+0
| | | | | | This generator has been deprecated since CMake 3.3. Remove it. Update documentation, modules, and tests to drop content specific to this generator.
* cmake: Teach --build to reject multiple --target optionsSebastian Schuberth2016-02-051-1/+13
| | | | | | | | | | Previously we did not clearly document that `--target` is only supported to be specified once. Even worse, specifying it multiple times would silently ignore any previously specified targets and only build the last target. Update the documentation to specify this. Update the implementation to reject multiple `--target` options to prevent user errors.
* cmake: add --trace-expand optionBen Boeckel2015-07-231-0/+1
| | | | | | | | The --trace option is helpful, but sometimes, what you're looking for is deep under many layers of function calls and figuring out what instance of the function call you're looking at is tedious to determine (usually involving patching and message()). Instead, add a --trace-expand option to trace while expanding commands into what CMake actually sees.
* cmake: Fix --build <relative-dir> for VS generators (#15609)Brad King2015-06-111-1/+1
| | | | | | | | | | The VS >= 10 generators need to parse the .sln file from the build directory to locate targets in subdirectories. This occurs after we change the working directory to the build tree. If a relative directory other than "." was given then we would change to it and also refer to the .sln file location with it. Fix this by converting the build tree to a full path always. This will also give a more informative error message when the directory does not exist.
* cmake: Replace CurrentLocalGenerator concept with CurrentMakefile.Stephen Kelly2015-06-041-6/+1
|
* cmMakefile: Rename method to something more appropriate.Stephen Kelly2015-05-191-1/+1
| | | | Allow the name to be used for something more-suitable.
* cmState: Compute and store directory components.Stephen Kelly2015-05-161-0/+6
| | | | | | | | | | | | | 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.
* cmMakefile: Rename GetCurrent{Output,Binary}Directory.Stephen Kelly2015-04-201-1/+1
| | | | Match names used in CMake code.
* cmMakefile: Rename GetCurrent{,Source}Directory.Stephen Kelly2015-04-201-1/+1
| | | | Match the names used in cmake code.
* cmState: Move CacheEntryType enum from cmCacheManager.Stephen Kelly2015-04-131-8/+5
|
* Port to cmState.Stephen Kelly2015-04-131-5/+6
|
* cmCacheManager: Port consumers to non-iterator API.Stephen Kelly2015-04-081-10/+16
| | | | | This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names.
* Revert topic 'refactor-cache-api'Brad King2015-04-071-16/+10
| | | | | | 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.
* cmCacheManager: Port consumers to non-iterator API.Stephen Kelly2015-04-061-10/+16
| | | | | This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names.
* Include cmAlgorithms where it is used.Stephen Kelly2015-03-101-0/+1
|
* Merge branch 'backport-no-global-setlocale' into no-global-setlocaleBrad King2015-02-061-2/+0
|\ | | | | | | Resolve conflict in Source/CMakeLists.txt by taking both changes.
| * Do not call setlocale() globally in CMake applications (#15377)Brad King2015-02-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge topic 'consistent-empty-method'Brad King2015-01-191-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5f69314e Replace foo.length() pattern with !foo.empty(). fd0c036c Replace 'foo.length() >= 1' pattern with !foo.empty() f09fde2d Replace 'foo.length() > 0' pattern with !foo.empty(). 86b5bdfa Replace 'foo.length() == 0' pattern with foo.empty(). fd7b3712 Replace foo.size() pattern with !foo.empty(). aa773035 Replace !foo.size() pattern with foo.empty(). 64592633 cmListCommand: Use empty() and expand whitespace. 607e1938 Replace 'foo.size() != 0' pattern with !foo.empty(). 930bd478 Replace 'foo.size() == 0' pattern with foo.empty(). d92887ef Replace 'foo.size() > 0' pattern with !foo.empty().
| * | Replace 'foo.size() == 0' pattern with foo.empty().Stephen Kelly2015-01-181-1/+1
| |/
* | cmakemain: Initialize vector content with iterators directly.Stephen Kelly2015-01-181-5/+1
| |
* | cmakemain: Use member insert in command line handling code.Stephen Kelly2015-01-181-4/+2
|/
* Merge topic 'cmake-no-args-output'Brad King2014-06-161-0/+16
|\ | | | | | | | | de7c2882 cmake,ccmake: Produce shorter output on no arguments (#14973)
| * cmake,ccmake: Produce shorter output on no arguments (#14973)Adam Strzelecki2014-06-131-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Encoding: Change to only set LC_CTYPE to fix encoding issues with libarchive.Clinton Stimpson2014-06-121-1/+1
|/ | | | | 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.
* Encoding: Add setlocale() to applications.Clinton Stimpson2014-06-041-0/+2
| | | | See also bug #14934 where chinese characters could not be used with cpack.
* cmSystemTools: Rename ErrorCallback to MessageCallbackBrad King2014-05-151-3/+3
| | | | | Clarify that it is the callback for the cmSystemTools::Message API. Rename callback clients too.
* Use Encoding::CommandLineArguments for main() functions.Clinton Stimpson2014-01-041-6/+12
|
* Use new cmHasLiteralPrefix functionStephen Kelly2013-11-211-3/+2
|
* Refactor internal resource location APIs and initializationBrad King2013-11-121-2/+1
| | | | | | | | | | | | | | | | | | | | 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.
* Merge topic 'cmake--build-pipes'Brad King2013-10-221-7/+3
|\ | | | | | | | | bcd5de7 cmake: Always pass through stdout/stderr in --build mode
| * cmake: Always pass through stdout/stderr in --build modeBrad King2013-10-181-7/+3
| | | | | | | | | | | | Enable the --use-stderr behavior by default and ignore the old option. Passing through the pipes allows color terminal output and other things to work as if one ran the native build command directly.
* | cmake: Drop support for "-i" wizard modeBrad King2013-10-181-9/+5
|/ | | | | Tell users to pass cache values with the -D option on the command line or use cmake-gui or ccmake.
* cmake: Simplify -E command line processingBrad King2013-10-171-25/+31
| | | | | | | | | | Check for "cmake -E ..." up front (along with "cmake --build ...") and skip normal command line processing. Drop the special handling for -E from the normal processing to simplify things. Strictly speaking, it was previously possible to invoke command mode with -E anywhere in the command line e.g. "cmake echo -E message" or "cmake echo message -E", but no one should be using it as it was not documented and looks strange.
* Make --help-* options available from all command-line toolsBrad King2013-10-161-21/+0
| | | | | | | | | | | 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.