summaryrefslogtreecommitdiffstats
path: root/Source/cmSetPropertyCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-format-15Kitware Robot2023-01-181-4/+3
| | | | | | | | | | | | | | 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 15. * 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. Fixes: #24315
* target_*: Fix cross-directory call backtracesBrad King2022-08-221-1/+3
| | | | | | | Record the call-site backtrace, not the current backtrace of the target's directory. Fixes: #23873
* Rename cmProp in cmValueMarc Chevrier2021-09-211-2/+3
|
* Refactor: Use new SetProperty signaturesMarc Chevrier2021-08-251-5/+5
|
* clang-tidy: fix `readability-qualified-auto` warningsBen Boeckel2021-01-271-2/+2
|
* clang-tidy: fix `performance-no-automatic-move` warningsBen Boeckel2021-01-271-1/+1
|
* GENERATED prop: Add implementation for policy CMP0118 being set to NEWDeniz Bahadir2020-11-241-1/+1
| | | | | | | | | | | | | | | | | | * Adding implementation for policy CMP0118 being set to `NEW`. * Adding new tests for policy CMP0118 being set to `NEW`. * Checking the `GENERATED` property with `get_source_file_property` or `get_property` now always returns exactly `1` or `0`. No other values will be returned. Note, that this is a backwards-incompatible change, even when policy CMP0118 is unset or set to `OLD`. * Additionally, as `get_source_file_property` and `get_property` now always check if a source-file was marked globally visible, even when CMP0118 is unset or set to `OLD`, they possibly return `1` where they might have returned `0` before the changes introduced by this commit. Note, that this is a backwards-incompatible change, even when policy CMP0118 is unset or set to `OLD`. * As a consequence, the tests for policy CMP0118 being unset or set to `OLD` got slightly adjusted, too, to reflect these changes in behavior.
* GENERATED prop: Check CMP0118 policy and warn in certain situationsDeniz Bahadir2020-11-241-1/+100
| | | | | | | | | | | | | | * Adding tests for CMP0118 being unset (aka set to `WARN`). * Adjusting the (unrelated) RunCMake.CMP0026 test to set CMP0118 to `NEW`, * Adjusting the (unrelated) RunCMake.Ninja test to set CMP0118 to `OLD`. * Adjusting the (unrelated) RunCMake.FileAPI test to set CMP0118 to `OLD`. Note: Setting CMP0118 to `NEW` and modifying the `GENERATED` property with `set_property` or `set_source_files_properties` will currently NOT set that property because the implementation is still to come.
* Fix typo in function nameDeniz Bahadir2020-11-171-2/+2
|
* {get,set}_property: Add support for referencing binary directoriesBrad King2020-09-231-1/+1
| | | | | | | Index directories by their binary directory path in addition to their source directory path. Fixes: #19262
* set_property: Deduplicate source file directory scopesAlexandru Croitor2020-07-131-2/+14
| | | | | | | | | | | | A user could specify the same directory scope to set_property() multiple times, which in conjunction with APPEND would append the property multiple times. Make sure to deduplicate scopes across both DIRECTORY and TARGET_DIRECTORY options, so that a property is only appended once in such a scenario. Fixes: #20941
* set_property: Allow both DIRECTORY and TARGET_DIRECTORY togetherAlexandru Croitor2020-07-091-6/+11
| | | | | | | | | Allow to specify both DIRECTORY and TARGET_DIRECTORY at the same time in `set_source_files_properties()` and `set_property(SOURCE)` commands. Add test cases and update the documentation. Fixes: #20932
* set_property: Fix name of TARGET_DIRECTORY option in error messagesAlexandru Croitor2020-07-091-1/+1
|
* set_source_files_properties: Allow specification of directory scopeAlexandru Croitor2020-05-141-13/+184
| | | | | | | | | | | | | | | | | | | | | | | 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
* Simplify absolute path conversions using CollapseFullPath full signatureBrad King2020-03-241-8/+2
|
* cmState::GetCacheEntryValue: return cmPropVitaly Stakhovsky2020-03-171-1/+1
|
* Source: use std::string overloadsVitaly Stakhovsky2020-03-101-7/+6
|
* AppendProperty: convert value param to std::stringVitaly Stakhovsky2020-01-251-63/+54
|
* Refactor: Use cmStrCat to construct error stringsAsit Dhal2019-09-181-34/+22
| | | | | Replace string construction using std::stringstream with cmStrCat and cmWrap.
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-2/+1
| | | | | | Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: cmSetPropertyCommandGabor Bencze2019-08-201-148/+253
|
* Source sweep: Use cmIsOn instead of cmSystemTools::IsOnSebastian Holtermann2019-08-171-2/+3
| | | | | | | | | This replaces invocations of - `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn` - `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND` - `cmSystemTools::IsOn` with `cmIsOn` - `cmSystemTools::IsOff` with `cmIsOff`
* Modernize: Enable modernize-raw-string-literal in clang-tidyArtur Ryt2019-04-021-1/+1
|
* cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-1/+1
|
* Modernize: Use ranged for-loops when possibleArtur Ryt2019-02-071-17/+18
| | | | | | | Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
* Remove unnecessary c_str() callsVitaly Stakhovsky2018-09-051-2/+2
| | | | Use the new IsOn(),IsOff() overloads.
* 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.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-21/+16
| | | | | | 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
|
* Add const-reference qualificationsPavel Solodovnikov2017-05-261-6/+6
|
* Remove redundant c_str() callsDaniel Pfeifer2016-10-301-1/+1
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-3/+10
|
* Separate compilation for commands included in cmBootstrapCommands2Daniel Pfeifer2016-10-211-0/+4
|
* 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-06-281-5/+5
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-241/+150
| | | | | | | | | | | | | 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-14/+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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* cmGlobalGenerator: Port Find API to cmMakefile.Stephen Kelly2015-08-071-8/+2
|
* Port to cmMakefile::GetGlobalGenerator.Stephen Kelly2015-05-031-2/+1
|
* 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-2/+1
|
* Port to cmState.Stephen Kelly2015-04-131-7/+6
|
* cmCacheManager: Port consumers to non-iterator API.Stephen Kelly2015-04-081-8/+11
| | | | | 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-11/+8
| | | | | | 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-8/+11
| | | | | This simplifies reasoning about the follow-up commit which ports away from cmCacheManager to a class with the same method names.
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-10/+10
| | | | All compilers hosting CMake support the std class.
* strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-1/+1
| | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.