summaryrefslogtreecommitdiffstats
path: root/Source/cmCacheManager.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.
* 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.
* Merge topic 'fix-cache-self-assignment'Brad King2014-05-281-5/+1
|\ | | | | | | | | | | 1cd37527 cmCacheManager: Avoid cache entry self-assignment 326d15a3 cmake: Tolerate missing HELPSTRING on compiler change
| * cmCacheManager: Avoid cache entry self-assignmentBrad King2014-05-271-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit bef93dc5 (Couple of changes: cache variables now have a map of properties, 2002-09-11) the cmCacheManager::AddCacheDefinition method accesses its map entry by reference. However, the commit left the original entry assignment at the end of the method. With Apple Clang 5.1 and libc++ this self-assignment destroys the cache entry property map. Drop the self assignment. Also drop the condition around the call to UnwatchUnusedCli since it was a self-comparison that must always have been true.
* | Remove c_str calls when using stream APIs.Stephen Kelly2014-03-111-2/+2
| | | | | | | | | | Use an ad-hoc clang tool for matching the calls which should be ported.
* | stringapi: Miscellaneous char* parametersBen Boeckel2014-03-081-2/+2
| |
* | strings: Remove cmStdString referencesBen Boeckel2014-03-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
* | stringapi: Use strings for cache paths as argumentsBen Boeckel2014-03-081-6/+6
| |
* | stringapi: Use strings for variable namesBen Boeckel2014-03-081-5/+6
| | | | | | | | Variable names are always generated by CMake and should never be NULL.
* | stringapi: Use strings for property namesBen Boeckel2014-03-081-15/+19
|/ | | | Property names are always generated by CMake and should never be NULL.
* cmVersion: Fix CMake_VERSION_ENCODE for date in patch levelBrad King2014-02-101-1/+1
| | | | | | | | | Use a uint64_t to store encoded version numbers so we have plenty of bits available. Encode with room for up to 1000 minor releases between major releases and to encode dates until the year 10000 in the patch level. This is necessary because CMake development versions prior to release 2.8.0 used the date in the patch level, and this practice may be restored after the 3.0 release.
* Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-3/+3
| | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* Drop builtin property documentationBrad King2013-10-161-62/+0
| | | | | | Drop all DefineProperty calls for non-chained properties. Drop the documentation from the chained ones. The documentation for all properties is now in Help/prop_*/*.rst files.
* CLI: Suppress the unused warning if the key value pair is cached.Stephen Kelly2013-06-041-0/+4
| | | | | | | | | | | | | | | It is common to specify a CMAKE_TOOLCHAIN_FILE and get a warning for using it despite it not being used. The WarnUnusedCliUnused test relies on the warning being emitted each time cmake is run on an existing build. That behavior is changed by this patch to warn only on the first invokation of CMake, and not on subsequent invokations (because the variable is in the cache with the same value). For that test, a clean target is added which clears the cache and cause the warning to be emitted each time. As the Ninja generator does not support the feature needed to test this, it is not tested with that generator.
* Fix spelling and typos (affecting binary data / module messages)Andreas Mohr2013-05-071-1/+1
|