summaryrefslogtreecommitdiff
path: root/Source/cmGetPropertyCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo in function nameDeniz Bahadir2020-11-171-1/+1
|
* Reduce the scope of temporary cmProp variables and other improvementsVitaly Stakhovsky2020-11-051-9/+9
|
* cmSourceFile::GetPropertyForUser: return cmPropVitaly Stakhovsky2020-11-041-1/+1
| | | | also fix GetSafeProperty() return type
* Refactor: Use cmToCStr()Vitaly Stakhovsky2020-09-031-6/+3
|
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-2/+3
|
* Remove filtering of allowed INTERFACE library propertiesBrad King2020-08-031-7/+3
| | | | | | | | | | | Previously we disallowed use of arbitrary properties on INTERFACE libraries. The goal was to future-proof projects using them by not allowing properties to be set that may affect their future inclusion in the generated buildsystem. In order to prepare to actually include INTERFACE libraries in the generated buildsystem, drop the filter and allow arbitrary properties to be set. Issue: #19145
* add_library/add_executable: allow local alias to imported targetsMarc Chevrier2020-06-021-3/+13
| | | | Fixes: #20641
* set_source_files_properties: Allow specification of directory scopeAlexandru Croitor2020-05-141-7/+54
| | | | | | | | | | | | | | | | | | | | | | | Both set_source_files_properties() and set_property(SOURCE) now accept two new optional arguments: DIRECTORY and TARGET_DIRECTORY. The DIRECTORY option takes a list of relative or absolute paths pointing to processed source directories (add_subdirectory was already called on them). These paths specify directory scopes where the source file properties will be set. Previously the scope was always the currently processed source directory. Similarly TARGET_DIRECTORY takes a list of targets, whose source directories will be used as the list of scopes where to set the source file properties. get_property() and get_source_file_property() also get the same new arguments, except only one value can be specified instead of a list. Fixes: #20128
* cmMakefile::GetProperty: return cmPropVitaly Stakhovsky2020-04-011-1/+2
|
* cmTarget::GetProperty: return cmPropVitaly Stakhovsky2020-03-301-2/+3
|
* Merge topic 'cmprop-getglobalprop'Brad King2020-03-271-1/+2
|\ | | | | | | | | | | | | c84cf42897 cmState::GetGlobalProperty: return cmProp Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4521
| * cmState::GetGlobalProperty: return cmPropVitaly Stakhovsky2020-03-251-1/+2
| |
* | Merge topic 'cmprop-state'Brad King2020-03-271-2/+3
|\ \ | | | | | | | | | | | | | | | | | | a7f2ff16a4 cmState::GetCacheEntryProperty: return cmProp Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4522
| * | cmState::GetCacheEntryProperty: return cmPropVitaly Stakhovsky2020-03-251-2/+3
| |/
* | Simplify absolute path conversions using CollapseFullPath full signatureBrad King2020-03-241-8/+2
|/
* Refactor: Use cmStrCat to construct error stringsAsit Dhal2019-09-181-23/+13
| | | | | Replace string construction using std::stringstream with cmStrCat and cmWrap.
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* cmCommand_refactor: cmGetPropertyCommandGabor Bencze2019-08-201-112/+184
|
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-2/+2
| | | | | | | | | | | | | | | | This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value argument instead of a `const char *`. Benefits are: - `std::string` can be passed to `cmMakefile::AddDefinition` directly without the `c_str()` plus string length recomputation fallback. - Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at compile time. In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid `std::string::c_str` calls and the `std::string` is passed directly. Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-1/+2
| | | | Reduce the number of files relying on `cmake.h`.
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-1/+1
| | | | | | | | | | * 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.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-4/+4
|
* Provide and use CM_FALLTHROUGHDaniel Pfeifer2017-06-031-0/+1
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-1/+12
|
* Merge topic 'clang-tidy'Brad King2016-10-201-1/+1
|\ | | | | | | | | | | effa6c83 fix more issues reported by clang-tidy fb461cac silence selected clang-tidy violations
| * fix more issues reported by clang-tidyDaniel Pfeifer2016-10-201-1/+1
| |
* | cmListFileCache: Remove cmState header includeStephen Kelly2016-10-191-0/+1
| | | | | | | | | | Include it in dependents which have previously relied on it transitively.
* | cmState: Port dependents to new cmStateTypes headerStephen Kelly2016-10-191-1/+1
|/
* cmTarget: Move sanity checks and computed property access to callersStephen Kelly2016-10-161-2/+13
| | | | | | | | | | | | | | | The GetProperty method is now just accessing contained data, meaning it can be implemented in cmState. Remove the cmMakefile context from the signature as a result and remove the overload with the same signature. Add a GetComputedProperty to cmTarget so that templates can be properly instantiated. Otherwise the Commands would need to be able to reach the specializations which are currently in cmTarget.cxx. As a side-effect, the CMP0026 warning now gives a backtrace to the target when issued from a generator expression.
* 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.
* Use CM_NULLPTRDaniel Pfeifer2016-09-161-1/+1
|
* Avoid else after returnDaniel Pfeifer2016-09-161-20/+14
|
* Do not report ALIASED_TARGET as always set (#15783)Gregor Jasny2016-07-161-1/+1
| | | | | | | | | The cmGetPropertyCommand::StoreResult expects NULL for unset properties. Make ALIASED_TARGET align with that expectation. Additional corrections to the unit tests are necessary because get_property removes variables for unset properties (in contrast to get_target_property which stores a -NOTFOUND value).
* Merge branch 'unknown-aliased-target' into compiler-featuresBrad King2016-06-281-6/+5
|\
| * Validate target name in ALIASED_TARGET property getterGregor Jasny2016-06-261-6/+5
| |
* | use CM_NULLPTRDaniel Pfeifer2016-06-281-2/+2
|/
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-199/+128
| | | | | | | | | | | | | 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-11/+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.
* 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>
* Remove unused cmLocalGenerator include.Stephen Kelly2015-10-051-1/+0
|
* cmGlobalGenerator: Port Find API to cmMakefile.Stephen Kelly2015-08-071-7/+2
|
* cmMakefile: Move CMP0059 handling to command code.Stephen Kelly2015-06-081-0/+16
| | | | | | | | Don't pay a penalty for it in all GetProperty calls. Additionally, the storage of properties will eventually move to cmState, which should only contain state and not logic for policies like this.
* Constify property definition API.Stephen Kelly2015-06-071-4/+2
|
* Port to cmMakefile::GetGlobalGenerator.Stephen Kelly2015-05-031-2/+1
|
* cmMakefile: Rename GetCurrent{,Source}Directory.Stephen Kelly2015-04-211-1/+1
| | | | Match the names used in cmake code.
* Port Global property interaction to cmState.Stephen Kelly2015-04-151-1/+2
|
* Move property definition to cmState.Stephen Kelly2015-04-131-3/+3
|
* Port to cmState.Stephen Kelly2015-04-131-2/+3
|
* cmCacheManager: Port consumers to non-iterator API.Stephen Kelly2015-04-081-4/+3
| | | | | 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-3/+4
| | | | | | 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.