summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/string
Commit message (Collapse)AuthorAgeFilesLines
* Tests/RunCMake: Match dots more precisely, part 3AJIOB2025-10-2020-40/+40
|
* Merge topic 'collect-genex-fix' into release-4.2Brad King2025-10-201-0/+4
|\ | | | | | | | | | | | | 6e637b1102 install(PACKAGE_INFO): Fix error when usage requirements contain certain genex Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !11322
| * install(PACKAGE_INFO): Fix error when usage requirements contain certain genexMartin Duffy2025-10-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 13c7bb5b0c (cmGeneratorExpression: Update strip function to collect parsed expressions, 2025-04-08, v4.1.0-rc1~361^2~1), the logic to strip generator expressions would error if the stripped expressions were being collected and an expression without a `:` was found inside an expression with a `:`. This resulted in an error when exporting a target that contained such a generator expression in its link libraries or compile definitions. Address the error by checking whether the latest `$<` proceeded the latest `:`.
* | Tests/RunCMake: Match xxx.cmake file name more preciselyAJIOB2025-10-162-2/+2
| |
* | Tests/RunCMake: Match CMakeLists.txt file name more preciselyHanna Rusakovich2025-10-152-2/+2
| |
* | Merge topic 'genex-strip-nested'Brad King2025-08-142-0/+39
|\ \ | |/ | | | | | | | | | | 8227028e49 string(GENEX_STRIP): Fix regression on nested generator expressions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !11077
| * string(GENEX_STRIP): Fix regression on nested generator expressionsMartin Duffy2025-08-132-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | Since commit 13c7bb5b0c (cmGeneratorExpression: Update strip function to collect parsed expressions, 2025-04-08), the logic to strip generator expressions from a string made incorrect assumptions about the contents of generator expressions, leading certain cases to be stripped incorrectly. Clean up the logic and fix broken behavior, and add test coverage with `string(GENEX_STRIP)`. Fixes: #27133
* | Merge topic 'linux32-time64'Brad King2025-07-211-0/+1
|\ \ | |/ | | | | | | | | | | | | a760a74abf Tests: Optionally skip tests requiring 64-bit time_t 14e21fa992 bootstrap: Compile with 64-bit time_t on 32-bit Linux if possible Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !10951
| * Tests: Optionally skip tests requiring 64-bit time_tBrad King2025-07-161-0/+1
| | | | | | | | | | On some platforms, `time_t` is always 32-bit. Add an explicit option to skip tests that require 64-bit `time_t`.
* | string(JSON): Include invalid JSON in parse errorMartin Duffy2025-07-114-0/+31
|/
* Linux: Compile with 64-bit time_t even on 32-bit architecturesBrad King2025-06-261-3/+0
| | | | | | Extend commit 5b10f96793 (Linux: Compile with _FILE_OFFSET_BITS=64 on 32-bit Linux, 2020-09-23, v3.19.0-rc1~112^2) to cover `time_t` too, by compiling with `_TIME_BITS=64`.
* Tests: Skip string(TIMESTAMP) 2038 case on parisc 32-bit time_tBrad King2025-03-011-1/+1
| | | | | This was missed by commit 74519e1c83 (string(TIMESTAMP): Fix %s placeholder for year 2038 on Windows, 2025-02-23).
* string(TIMESTAMP): Fix %s placeholder for year 2038 on WindowsBrad King2025-02-263-0/+12
| | | | | | | | | | `difftime` returns a `double`, so commit 6727270b75 (CMake: Extend TIMESTAMP sub-commands with new unix time format specifier, 2016-02-16, v3.6.0-rc1~338^2) cast it to `long` to get an integer result. However, in the MSVC ABI, `long` is a 32-bit integer. Use an explicit 64-bit integer type instead. Fixes: #26716
* string: Allow zero-length matches in all REGEX subcommandsNikita Nemkin2025-02-142-0/+144
| | | | | | | | | The semantics mimic other languages like Python, Java, JS, etc. To advance past a zero-length match, the search algorithm first tries to find a non-zero alternative branch. If that fails, it force-advances by 1 character. Fixes: #13790, #13792, #18690, #26629
* regex: Match ^ at most once in repeated searchesNikita Nemkin2025-02-134-10/+103
| | | | | | | | | When doing successive matches, track the input start and current search start positions separately to prevent the `^` anchor from matching in the middle of the string. Add policy CMP0186 to provide compatibility. Issue: #26629 Fixes: #16899
* Tests/RunCMake: Update cmake_minimum_required versions to 3.10Brad King2024-10-031-1/+1
| | | | | For policy-specific tests, use the version before the policy was introduced. Otherwise, use 3.10 where possible.
* Tests/RunCMake: Update cmake_minimum_required versionsBrad King2023-02-113-7/+1
| | | | | | | | For policy-specific tests, use the version before the policy was introduced. Otherwise, use 3.5 where possible. Also, remove `cmake_minimum_required()` and `project()` calls from individual cases where they are handled by `CMakeLists.txt`.
* string(TIMESTAMP): Add %z and %Z for adding time zone stringVasiliy Koyrev2022-10-272-2/+2
| | | | Fixes: #24056
* string(JSON): Fix typo in error messageSean Kahler2022-08-041-3/+3
| | | | `s/then/than/` in a comparison.
* string(JSON): fix error message on invalid modeCarlo Teubner2022-03-301-1/+1
| | | | | | | The `GET_ARRAY` and `MEMBERS` modes were removed during development and review of commit 8eab76eb84 (string(JSON): Adds JSON parsing support to the string command, 2020-08-24, v3.19.0-rc1~159^2), but were accidentally left in an error message.
* string(TIMESTAMP): add %f specifier for microsecondsPeter Würth2022-01-282-2/+2
| | | | | | | | | | | | | | | | | | The %f specified extends the string(TIMESTAMP) and file(TIMESTAMP) commands to output the timestamp with a microsecond resolution. This convention is offered by python's datetime module. Before, the precision was limited to seconds. The implementation is done by extending existing cmTimestamp methods with a `microseconds` parameter. This parameter is optional in order to be backwards compatible. The timestamps are now received in a cross-platform manner using libuv, since the standard C functions like time() don't allow for sub-second precision. This requires libuv 1.28 or higher. We already require higher than that on Windows, so update the required version for other platforms. Implements: #19335
* string(TIMESTAMP): Add %V specifier for ISO 8601 week numberAntons Jeļkins2021-08-022-2/+2
| | | | | | In ISO 8601 weeks begin with Monday. The first week of the year is the week which contains the first Thursday of the year.
* string(JSON): Adds JSON parsing support to the string commandPeter Steneteg2020-09-1615-0/+382
| | | | | | | Adds a set of sub commands to the string command for parsing JSON, the JSON commands are: GET, TYPE, MEMBER, LENGTH, REMOVE, SET, and EQUAL. Closes: #19501
* Tests/RunCMake: Update cmake_minimum_required versionsBrad King2020-06-181-1/+1
| | | | Use 3.3 or 2.8.12 where possible.
* string: Add new HEX sub-commandKyle Edwards2020-02-198-0/+36
|
* string: introduce `REPEAT` sub-commandAlex Turbov2019-04-158-0/+61
|
* Testing: Update hard-coded line numbers to [0-9]+ in some testsKyle Edwards2018-10-1011-11/+11
|
* string: Add JOIN subcommandAlex Turbov2018-02-168-0/+32
| | | | | This is just like CONCAT but accepts a glue string to put between each value. `JOIN ""` is equivalent to `CONCAT`.
* Timestamp: support %A and %BBernhard M. Wiedemann2017-09-072-2/+2
| | | | | | | | These are defined both by [1] and [2] to give full names of a weekday and month. [1] http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html [2] https://msdn.microsoft.com/de-de/library/fe06s4ak.aspx
* Add PREPEND sub-command to string commandSylvain Joubert2017-08-115-0/+67
|
* cmStringCommand: clear intermediate matchesBen Boeckel2017-07-213-0/+33
| | | | | | | | | | | When `string(REGEX REPLACE)` or `string(REGEX MATCHALL)` loop internally, they store their matches, but they do not clear the previous match from an earlier iteration. This can leave the contents of `CMAKE_MATCH_<N>` with bogus values for later matches in the string if they have groups which earlier matched a non-empty string, but now match an empty string. Fixes #17079.
* string: Teach TIMESTAMP to treat %% as %Bernhard M. Wiedemann2017-01-272-2/+2
| | | | This encoding is documented by `strptime`.
* cmTimestamp: Support SOURCE_DATE_EPOCH to override current timeBernhard M. Wiedemann2017-01-2613-0/+25
| | | | | | See https://reproducible-builds.org/ for why this is good and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable.
* string: add APPEND subcommandDaniel Pfeifer2015-07-075-0/+67
|
* file: Teach STRINGS to support UTF-16 and UTF-32 encodingsJustin Borodinsky2015-01-2713-0/+29
|
* test: add a test for clearing regex resultsBen Boeckel2014-12-035-0/+116
|
* StringUuid: Implement new string(UUID) sub-command.Nils Gladitz2014-08-2820-0/+79
|
* string: Add CONCAT sub-commandBrad King2013-10-216-0/+32
Add a string(CONCAT) command to simply concatenate input arguments together. This will be useful for combining strings from different quoting syntaxes. Add a RunCMake.string test covering these cases.