summaryrefslogtreecommitdiffstats
path: root/Source/cmCacheManager.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-1/+2
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * 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.
* Replace some uses of sprintf with std::to_stringjrp20142018-04-051-9/+9
|
* Refactor cmCacheManager::LoadCache to use ostringstreamShane Parris2018-02-281-8/+8
|
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-3/+3
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* cmCacheManager: Truncate values containing newlinesKyle Edwards2018-01-151-4/+70
| | | | Fixes #16098.
* Meta: replace empty-string assignments with `clear()`.Pavel Solodovnikov2017-09-151-2/+2
|
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-14/+9
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-5/+5
|
* Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-2/+1
|
* Access string npos without instancePavel Solodovnikov2017-06-011-2/+2
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-2/+2
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-5/+6
|
* cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-17/+17
| | | | 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.
* Merge topic 'else-after-return'Brad King2016-08-231-1/+2
|\ | | | | | | | | | | | | | | 7b6349da CMake: don't use else after return 50ad1e0a CTest: don't use else after return 7f97a6c9 CPack: don't use else after return 4988b914 CursesDialog: don't use else after return
| * CMake: don't use else after returnDaniel Pfeifer2016-08-181-1/+2
| |
* | fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-231-2/+4
|/
* use CM_NULLPTRDaniel Pfeifer2016-06-281-5/+5
|
* Merge topic 'expose-cache-properties'Brad King2016-06-131-0/+10
|\ | | | | | | | | | | | | | | 63c0e92c cmState: Expose list of properties of values in the cache 6eee2463 cmCacheEntry: Retrieve all properties of cache entries 120899c6 cmPropertyList: Add a way to retrieve all properties 7066218e cmake: Kill cmake::CacheManager and its getter
| * cmCacheEntry: Retrieve all properties of cache entriesTobias Hunger2016-06-101-0/+10
| |
* | Add missing braces around statements.Daniel Pfeifer2016-06-101-1/+2
|/ | | | | Apply fixits of clang-tidy's readability-braces-around-statements checker.
* Simplify boolean expressionsDaniel Pfeifer2016-06-021-1/+1
| | | | | | 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.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-288/+185
| | | | | | | | | | | | | 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-13/+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-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+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.
* Print line number of cache parse errors (#11109)Ashley Whetter2016-01-191-2/+8
| | | | | Track the line number while parsing `CMakeCache.txt` files and include it in a parse failure error message.
* cmState: Move ParseCacheEntry from cmCacheManager.Stephen Kelly2015-10-101-85/+1
|
* cmCacheManager: Port away from cmake instance.Stephen Kelly2015-10-101-3/+1
|
* Inline unary LoadCache.Stephen Kelly2015-10-101-6/+0
|
* cmCacheManager: Remove cmMakefile dependency.Stephen Kelly2015-10-101-1/+0
| | | | Update comment.
* cmPropertyMap: Remove chaining logic.Stephen Kelly2015-06-071-6/+1
| | | | | | | The chaining logic doesn't belong to the container, and the CMakeInstance pointer doesn't need to be in cmPropertyMap. Size goes from 56 to 48 bytes with GNU libstdc++-5.1.
* cmPropertyMap: Remove scope parameter from API where not used.Stephen Kelly2015-06-071-2/+2
|
* Use cmSystemTools::GetCMakeCommand() to get path to cmake internallyBrad King2015-05-201-8/+3
| | | | | This is much simpler than finding a way to lookup "CMAKE_COMMAND" everywhere.
* cmState: Move CacheEntryType enum from cmCacheManager.Stephen Kelly2015-04-131-71/+25
|
* cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue.Stephen Kelly2015-04-071-6/+10
| | | | | Being initialized is a requirement for this method to return something, and is what differentiates it from using GetIterator with it.GetValue.
* Merge topic 'refactor-cache-api'Brad King2015-04-071-10/+6
|\ | | | | | | | | 3347c5e4 Revert topic 'refactor-cache-api'
| * Revert topic 'refactor-cache-api'Brad King2015-04-071-10/+6
| | | | | | | | | | | | 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.
* | Merge topic 'refactor-cache-api'Brad King2015-04-071-6/+10
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | 9410e24a cmCacheManager: Port consumers to non-iterator API. 7b7ae3b1 Port QtDialog to non-iterator cache API. 228c629c Port CursesDialog to non-iterator cache API. 2e50f5e7 cmMakefile: Port away from CacheEntry.Initialized. e6224367 cmCacheManager: Add non-iterator-based API. 9ada4c04 cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue. 1fe7f24c Add API for cache loading, deleting and saving to the cmake class. 08c642c6 cmMakefile: Remove cache version accessors. cec8f97e cmMakefile: Simplify GetDefinitions implementation.
| * cmCacheManager: Rename GetCacheValue to GetInitializedCacheValue.Stephen Kelly2015-04-061-6/+10
| | | | | | | | | | Being initialized is a requirement for this method to return something, and is what differentiates it from using GetIterator with it.GetValue.
* | Remove unused includes.Stephen Kelly2015-04-061-1/+0
|/
* cmCacheManager: Remove unused methodStephen Kelly2015-04-051-18/+0
|
* cmCacheManager: Remove unused overloads.Stephen Kelly2015-04-051-19/+0
|
* cmCacheManager: Remove use of intermediate overload.Stephen Kelly2015-04-051-1/+2
|
* cmCacheManager: Replace loop with algorithm.Stephen Kelly2015-02-201-5/+1
|
* Replace foo.size() pattern with !foo.empty().Stephen Kelly2015-01-181-1/+1
|
* Merge topic 'fix--D-command-line-parsing'Brad King2014-10-301-1/+1
|\ | | | | | | | | | | aee7e4a0 cmCacheManager: parse -D flags more strictly 368e8de4 Tests: test -D parsing on the command line
| * cmCacheManager: parse -D flags more strictlyBen Boeckel2014-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In the case of: -DCACHE_VARS=-DEXTERNAL_PROJECT_CMAKE_ARG:BOOL=TRUE the variable is parsed out as: CACHE_VARS=-DEXTERNAL_PROJECT_CMAKE_ARG because the parser allows '=' in the variable name. Disallow such a name on the command line.
* | strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-5/+5
|/ | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.