summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
Commit message (Collapse)AuthorAgeFilesLines
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-9/+17
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-9/+10
|
* cmake: Add `cmake -E capabilities` modeTobias Hunger2016-08-161-0/+12
| | | | | | | Add `cmake -E capabilities` to report on generators, cmake version and possibly other static capabilities of cmake. Closes: #15462
* Use better KWSys SystemTools::GetEnv and HasEnv signaturesDāvis Mosāns2016-07-181-10/+6
|
* cmake: Fix -E env_vs8_wince implementationBrad King2016-07-111-2/+2
| | | | | | | | | This code has accidentally not been compiled since commit v3.0.0-rc1~556^2 (cmake: Split -E command implementation into separate source file, 2013-10-03) because CMAKE_HAVE_VS_GENERATORS was local to `cmake.cxx`. Fixes #16195.
* cmake: Drop unused -E cmake_call_visual_studio_macro codeBrad King2016-07-111-24/+0
| | | | | | This code has not been compiled since commit v3.0.0-rc1~556^2 (cmake: Split -E command implementation into separate source file, 2013-10-03). It appears the code was never used since it was added anyway.
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-3/+2
| | | | | | | | | | | | 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-16/+23
|
* Add options to run `ldd -u -r` as a "link-what-you-use" toolBill Hoffman2016-06-171-4/+31
| | | | | | | Create a LINK_WHAT_YOU_USE target property and corresponding CMAKE_LINK_WHAT_YOU_USE variable to enable this behavior. Extend link commands by running `ldd -u -r` to detect shared libraries that are linked but not needed.
* Simplify boolean expressionsDaniel Pfeifer2016-06-021-6/+2
| | | | | | 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.
* Remove redundant c_str() calls.Daniel Pfeifer2016-05-261-2/+1
| | | | | Run clang-tidy's readability-redundant-string-cstr checker. Ignore findings in kwsys.
* Improve string find: prefer character overloads.Daniel Pfeifer2016-05-241-1/+1
| | | | | Apply fix-its from clang-tidy's performance-faster-string-find checker. Ignore findings in kwsys.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-822/+507
| | | | | | | | | | | | | 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-7/+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/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Help: Improve 'cmake -E md5sum' documentationBartosz Kosiorek2016-05-021-1/+1
|
* Merge topic 'clang-format-include-order'Brad King2016-05-021-4/+5
|\ | | | | | | | | | | | | | | | | | | | | e1c77472 Format include directive blocks and ordering with clang-format 180538c7 Source: Stabilize include order 0e7bca92 Utilities/Release: Stabilize include order in WiX custom action eb817be0 Tests: Stabilize include order in MFC, VSXaml, and VSWinStorePhone eda313b4 Tests: Stabilize include order in StringFileTest 7110b754 CursesDialog: add missing cmState include d7a5f255 Modules: Remove unused CMakeTestWatcomVersion.c file
| * Format include directive blocks and ordering with clang-formatBrad King2016-04-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Clang-Tidy: Give entire compiler command line to clant-tidy toolDaniel Pfeifer2016-04-281-2/+4
|/ | | | | The tool expects the entire compiler command, including `cc`. It will automatically skip that and extract the options it needs.
* Clang-Tidy: copy stdout to sterr; ignore original stderrDaniel Pfeifer2016-04-271-3/+7
| | | | | | | | | | | Clang-Tidy writes the number of warnings, the number of suppressed warnings, and instructions on how to suppress warnings to stderr. Since each source file is checked individually, this repetitive information is disturbing and should be suppressed. The actual warning messages are written to stdout. Some IDEs (eg. QtCreator) analyze only stderr for issues. Redirecting Clang-Tidy's stdout to stderr makes sure the warnings are correctly displayed.
* Add options to run clang-tidy with the compilerDaniel Pfeifer2016-04-131-21/+59
| | | | | | Create a <LANG>_CLANG_TIDY target property (initialized by a CMAKE_<LANG>_CLANG_TIDY variable) to specify a clang-tidy command line to be run along with the compiler.
* Fix dependency scanning configuration in subdirectoriesBrad King2016-02-051-4/+2
| | | | | | | | | | | | | | | Refactoring in commit v3.5.0-rc1~347^2~2 (Set the current dirs on the snapshot before creating the cmMakefile) accidentally changed the source and binary directories configured in `cmake -E cmake_depends` for use during dependency scanning. This can cause the wrong directory information to be loaded. It also breaks Fortran module dependency scanning for modules provided by targets in subdirectories that do not have Fortran_MODULE_DIRECTORY set. Fix the dependency scanning directory configuration and add a test to cover the Fortran module case in which the breakage was observed. Reported-by: Kelly Thompson <kgt@lanl.gov>
* cmake: Fix `-E time` argument passing to childBrad King2016-01-201-2/+2
| | | | | | | | | | Since this command was introduced in 2002 it has incorrectly constructed the child process command line by concatenating arguments separated by spaces with no quoting. Fix this by passing the command argument vector directly to RunSingleCommand without an intermediate quoting and re-parsing step. Reported-by: Andrey Pokrovskiy <wonder.mice@gmail.com>
* cmcmd.cxx: Remove unused code in __run_iwyu implementationBrad King2016-01-191-3/+2
| | | | | Do not try to capture stderr with OUTPUT_PASSTHROUGH. RunSingleCommand will never populate it.
* cmake: Change `-E chdir` to pass through stdout/stderr directlyBrad King2016-01-191-1/+1
| | | | | Use OUTPUT_PASSTHROUGH instead of OUTPUT_NORMAL in order to avoid buffering the output just to re-print it.
* cmake: Teach -E make_directory to support multiple input directoriesBartosz Kosiorek2015-12-101-7/+12
|
* cmake: Teach -E copy_directory to support multiple input directoriesBartosz Kosiorek2015-12-071-9/+15
|
* cmake: Refine -E copy_if_different implementation indentationBartosz Kosiorek2015-12-071-2/+2
|
* cmake: Refine -E chdir documentationBartosz Kosiorek2015-12-071-1/+1
|
* cmake: Teach -E copy[_if_different] to support multiple files (#15703)Bartosz Kosiorek2015-12-041-15/+46
| | | | | | If multiple input files are provided then the destination must be a directory. If only one input file is provided then destination may be either a file or directory.
* cmake: Improve '-E' help message formattingBartosz Kosiorek2015-12-041-6/+6
|
* Merge topic 'fix-ms-manifest-no-linker'Brad King2015-11-191-1/+3
|\ | | | | | | | | ca263d1d MSVC: Fix linking with /MANIFEST:NO option
| * MSVC: Fix linking with /MANIFEST:NO optionBrad King2015-11-181-1/+3
| | | | | | | | | | | | Refactoring in commit v3.4.0-rc1~74^2~1 (MSVC: Rewrite manifest file handling with Makefile and Ninja, 2015-09-15) broke handling of this option. Fix it and add a test case.
* | De-duplicate symbols listed in generated module definition filesBill Hoffman2015-11-181-3/+5
| | | | | | | | | | | | | | MS tools have a limit on the number of symbols that can be listed in a `.def` file. If multiple `.obj` files provide a symbol then avoid listing it more than once in the generated `.def` file to avoid counting toward the limit.
* | cmState: Initialize default definitions immediately.Stephen Kelly2015-10-131-0/+1
| | | | | | | | Don't leave this as cmMakefile responsibility.
* | Set the current dirs on the snapshot before creating the cmMakefile.Stephen Kelly2015-10-071-2/+4
|/ | | | | | 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.
* Add support for *.manifest source files with MSVC toolsBrad King2015-09-171-5/+16
| | | | | | | | Classify .manifest sources separately, add dependencies on them, and pass them to the MS manifest tool to merge with linker-generated manifest files. Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
* MSVC: Rewrite manifest file handling with Makefile and NinjaBrad King2015-09-171-184/+221
| | | | | | | | | Add a helper class private to "cmcmd.cxx" to contain the implementation. Update the link logic to use the intermediate files directory for each target to hold manifest and resource files before embedding into the binary. Preserve the old behavior of placing the .manifest file next to the binary when not linking incrementally even though it will be embedded.
* cmLocalGenerator: Create from already-constructed cmMakefile.Stephen Kelly2015-08-281-1/+2
| | | | Don't manage the lifetime of the cmMakefile with cmLocalGenerator.
* cmGlobalGenerator: Remove MakeLocalGenerator method.Stephen Kelly2015-08-281-1/+1
| | | | Inline implementation to callers.
* cmGlobalGenerator: Require a snapshot to create a local generator.Stephen Kelly2015-08-281-1/+3
|
* cmcmd: Improve error handling when executing a process.James Johnston2015-08-081-5/+14
|
* cmAlgorithms: Rename cmRange to cmMakeRange.Stephen Kelly2015-07-221-4/+5
|
* Windows: Optionally generate DLL module definition files automaticallyBill Hoffman2015-07-061-0/+39
| | | | | | | Create target property WINDOWS_EXPORT_ALL_SYMBOLS to automatically generate a module definition file from MS-compatible .obj files and give it to the linker in order to export all symbols from the .dll part of a SHARED library.
* Merge topic 'run-include-what-you-use'Brad King2015-05-211-0/+82
|\ | | | | | | | | | | ada5ffce Add options to run include-what-you-use with the compiler 67fa3da9 cmake: Add internal -E mode to run include-what-you-use with the compiler
| * cmake: Add internal -E mode to run include-what-you-use with the compilerBill Hoffman2015-05-191-0/+82
| | | | | | | | | | | | | | | | Add an internal "cmake -E __run_iwyu" mode to wrap the compiler call. Run a given include-what-you-use command line with the compiler options and report a warning if it finds anything. Then run the real compiler. Co-Author: Brad King <brad.king@kitware.com>
* | cmGlobalGenerator: Add NVI wrapper to create local generator.Stephen Kelly2015-05-161-1/+1
|/
* Merge topic 'clean-up-cmMakefile'Brad King2015-04-211-5/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8dc3a67c cmMakefile: Out-of-line the directory methods. 0f3c8cfa cmMakefile: Use method abstraction to access directories. b288a997 cmMakefile: Rename SetStart* directory API to SetCurrent*. 932d53bc cmMakefile: Remove redundant method duplication. 32b8f03a cmMakefile: Port users of GetStart* methods to new names. 54d6a918 cmMakefile: Rename GetCurrent{Output,Binary}Directory. 55d80d0a cmMakefile: Rename GetCurrent{,Source}Directory. b23cf06f cmake: Remove redundant start directories. fcf246ac cmMakefile: Populate Home directories on initialize. 8878bea7 cmake: Initialize Home directories on cmake for find-package mode. 044dc815 Use the Home directories from the cmake class where intended. d67e8f24 cmake: Fix directory used to find the cache 1ea085d1 cmMakefile: Initialize dir definitions early. f034bb2f Remove redundant calls to MakeStartDirectoriesCurrent. 3a68c323 cmMakefile: Fix wrong parameter names.
| * cmMakefile: Rename SetStart* directory API to SetCurrent*.Stephen Kelly2015-04-201-2/+2
| |