summaryrefslogtreecommitdiffstats
path: root/Source/cmProjectCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-1/+2
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* cmProjectCommand: Port away from cmCommandRegina Pfeifer2019-09-211-104/+92
|
* Refactor: Use cmStrCat to construct error stringsAsit Dhal2019-09-181-5/+4
| | | | | Replace string construction using std::stringstream with cmStrCat and cmWrap.
* IWYU: Add missing cstddef includes for size_t and nullptr_tBrad King2019-09-031-0/+1
| | | | The IWYU tool we use for CI now diagnoses these.
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-1/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-22/+20
| | | | | | | | | | | | | | | | 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.
* project: Keep leading `0` in PROJECT_VERSION componentsAlex Turbov2019-07-161-28/+56
| | | | | | | | | Introduce CMake policy `CMP0096` to make `project()` keep leading zeros in version components. As a side effect, it now allows really long version numbers. Fixes: #19421 Co-Author: Brad King <brad.king@kitware.com>
* Refactor: Use raw string literals instead of escapingAlex Turbov2019-07-151-1/+1
|
* Refactor: Use initializer lists instead of `push_back` seriesAlex Turbov2019-07-151-13/+11
|
* Refactor: Add some `const` to varsAlex Turbov2019-07-151-3/+3
|
* Refactor: Replace a "magic" number w/ a named constantAlex Turbov2019-07-151-4/+5
|
* Refactor: Eliminate one-time-used variablesAlex Turbov2019-07-151-12/+6
|
* Refactor: Eliminate `sep` from the loopAlex Turbov2019-07-151-3/+1
|
* Merge topic 'pr.projectbefore'Brad King2019-04-041-0/+4
|\ | | | | | | | | | | | | 0761186949 project: Add variable CMAKE_PROJECT_INCLUDE_BEFORE Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3175
| * project: Add variable CMAKE_PROJECT_INCLUDE_BEFORERuslan Baratov2019-04-011-0/+4
| |
* | Modernize: Enable modernize-raw-string-literal in clang-tidyArtur Ryt2019-04-021-1/+1
|/
* project: Add variable CMAKE_PROJECT_INCLUDERuslan Baratov2019-03-271-11/+31
|
* clang-tidy: Use emplaceRegina Pfeifer2019-01-171-13/+13
|
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-13/+16
| | | | Reduce the number of files relying on `cmake.h`.
* project(): Ensure DESCRIPTION and HOMEPAGE_URL variables are setCraig Scott2018-10-071-12/+8
| | | | | | | | If a project() call does not have DESCRIPTION or HOMEPAGE_URL options, it must still set the relevant variables or else those variables will inherit values from an earlier project() call. That is inconsistent with how VERSION is handled and is likely to be unexpected. The docs were also ambiguous about what should happen in such cases.
* cmMakefile: return directories as const std::string&Vitaly Stakhovsky2018-08-271-6/+6
|
* project: Do not issue CMP0048 warnings on injected callBrad King2018-07-241-2/+7
| | | | Fixes: #18202
* CPack: Use project version as default for `CPACK_PACKAGE_VERSION`Alex Turbov2018-05-021-24/+30
| | | | | | | | | | * Introduce `CMAKE_PROJECT_VERSION` and the corresponsing components: `CMAKE_PROJECT_VERSION_MAJOR`, `CMAKE_PROJECT_VERSION_MINOR`, `CMAKE_PROJECT_VERSION_PATCH` and `CMAKE_PROJECT_VERSION_TWEAK`. * `CPack` module use `CMAKE_PROJECT_VERSION_MAJOR`, `CMAKE_PROJECT_VERSION_MINOR` and `CMAKE_PROJECT_VERSION_PATCH` to initialize corresponsing CPack variables.
* project: Add HOMEPAGE_URL named parameterAlex Turbov2018-03-161-3/+44
| | | | | | | | | This sets variables like PROJECT_HOMEPAGE_URL, which can be used as default values for various things (packaging modules, doxygen defaults, etc.). Some packaging modules have been updated to do this as part of this commit. Co-Author: Craig Scott <craig.scott@crascit.com>
* project: Add <PROJECT-NAME>_DESCRIPTIONCraig Scott2018-03-161-0/+2
| | | | For consistency with the VERSION keyword, also define the <PROJECT-NAME>_DESCRIPTION variable.
* project: warn on metadata arguments missing valuesAlex Turbov2018-03-071-2/+47
| | | | Warn if `DESCRIPTION` or `VERSION` is given without a following value.
* Various typo fixesLuz Paz2018-01-031-1/+1
| | | | Some are user-facing. Others are source comments.
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-5/+4
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Add const-reference qualificationsPavel Solodovnikov2017-05-261-19/+22
|
* Merge topic 'project-description'Brad King2017-04-131-0/+31
|\ | | | | | | | | | | | | 3b484871 project: Add `DESCRIPTION` parameter Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !679
| * project: Add `DESCRIPTION` parameterAlex Turbov2017-04-111-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is quite often the project description has used in a real world software. Examples include: * part of a help screen of the application * builtin resources (`*.rc` files, data for "About" dialog of a GUI app, & etc) * most generators for CPack can use it * it could be used by documentary software (Doxygen, Sphinx) which is usually integrated to CMake based projects via `add_custom_target()` Now `project()` call learned an optional `DESCRIPTION` parameter with a short string describing a project. Being specified, it would set the `PROJECT_DESCRIPTION` variable which could be used in `configure_file()` or whatever user wants. Also `PROJECT_DESCRIPTION` is a default value for `CPACK_PACKAGE_DESCRIPTION_SUMMARY`.
* | Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
|/ | | | | | | | | | | | | 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'
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-0/+10
|
* Separate compilation for commands included in cmBootstrapCommands2Daniel Pfeifer2016-10-211-0/+2
|
* cmState: Move CacheEntryType enum to separate namespaceStephen Kelly2016-10-191-3/+3
| | | | 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.
* use empty method to check for emptynessDaniel Pfeifer2016-09-151-1/+1
|
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-113/+79
| | | | | | | | | | | | | 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.
* cmMakefile: Use std::string in ProjectName API.Stephen Kelly2015-08-251-1/+1
|
* cmMakefile: Move IsRoot API from cmLocalGenerator.Stephen Kelly2015-06-211-1/+1
|
* project(): Remove unused variable.Stephen Kelly2015-06-091-1/+0
|
* Use new top-level check abstraction.Stephen Kelly2015-05-141-1/+1
|
* Port to static cmPolicies API.Stephen Kelly2015-05-041-2/+1
|
* cmMakefile: Rename GetCurrent{Output,Binary}Directory.Stephen Kelly2015-04-201-2/+2
| | | | Match names used in CMake code.
* cmMakefile: Rename GetCurrent{,Source}Directory.Stephen Kelly2015-04-201-2/+2
| | | | Match the names used in cmake code.
* cmMakefile: Add wrapper for reading listfiles which have an origin.Stephen Kelly2015-04-181-2/+1
| | | | | | Such files are delegates from other files, and so they set the CMAKE_PARENT_LIST_FILE to the originator. They also may set a policy scope.
* cmState: Move CacheEntryType enum from cmCacheManager.Stephen Kelly2015-04-131-3/+3
|
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-1/+1
| | | | All compilers hosting CMake support the std class.
* Remove some c_str() calls.Stephen Kelly2014-03-111-13/+13
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.