summaryrefslogtreecommitdiffstats
path: root/Source/cmProjectCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* project: Warn at top-level if `cmake_minimum_required` wasn't calledfriendlyanon2022-11-111-0/+9
| | | | | | | The top-level project() call will now issue an AUTHOR_WARNING if it wasn't called after cmake_minimum_required(). Fixes: #24071
* cmSystemTools: Fix 'ErrorOccurred' spellingFeRD (Frank Dana)2022-06-131-8/+8
| | | | | | | | Rename the booleans 's_ErrorOccured' and 's_FatalErrorOccured' to 's_ErrorOccurred' and 's_FatalErrorOccurred', respectively. Rename the getters and setters to 'Get[Fatal]ErrorOccurred' and 'Set[Fatal]ErrorOccurred', and fix all uses across the codebase.
* clang-tidy: address `google-readability-casting` lintsBen Boeckel2022-05-241-2/+2
| | | | At least those involving `static_cast`.
* Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-3/+4
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-3/+3
|
* CMP0126: Add control for warningsMarc Chevrier2021-06-291-2/+2
| | | | Fixes: #22353
* project: Define variables indicating whether project is top levelfriendlyanon2021-03-261-0/+5
| | | | | | | | | Define `PROJECT_IS_TOP_LEVEL` and `<PROJECT-NAME>_IS_TOP_LEVEL`. The latter is a STATIC cache entry just like other `<PROJECT-NAME>_*` variables so that it is globally scoped. Issue: #20310 Fixes: #21961
* include: refactor call sites of cmMakefile::ReadDependentFileAsit Dhal2020-10-211-1/+12
| | | | Fixes: #16773
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-4/+5
|
* Source: use cmNonempty()Vitaly Stakhovsky2020-07-281-1/+1
|
* cmMakefile::AddCacheDefinition: Add overload that accepts std::string valueVitaly Stakhovsky2020-03-111-4/+4
|
* Merge topic 'project-version-buffer-overflow'Craig Scott2019-10-281-1/+2
|\ | | | | | | | | | | | | | | 82cdb26c93 project: Fix potential buffer write-past-end for version components 15a0b0d046 Help: math() expressions must be representable as signed 64-bit Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3948
| * project: Fix potential buffer write-past-end for version componentsCraig Scott2019-10-261-1/+2
| | | | | | | | This fixes two errors: not accounting for the trailing null and a misunderstanding of what std::numeric_limits::digits10 means.
* | project: Add variable CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE_BEFOREDeniz Bahadir2019-10-181-0/+5
|/ | | | | | | | | | Follow up commit 0761186949 (project: Add variable CMAKE_PROJECT_INCLUDE_BEFORE, 2019-03-28, v3.15.0-rc1~294^2) with a project-specific variant. This variable will be used similar to the already existing `CMAKE_PROJECT_INCLUDE_BEFORE` and `CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE` variables. Fixes: #19854
* 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.