MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0009851 | CMake | CMake | public | 2009-11-06 03:14 | 2010-11-05 12:13 |
Reporter | Marcel Loose | ||||
Assigned To | David Cole | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | CMake-2-6 | ||||
Target Version | Fixed in Version | CMake 2.8.3 | |||
Summary | 0009851: string(RANDOM) does not produce random string within a CMake run | ||||
Description | I expected that string(RANDOM...) would produce a different string each time it is invoked. Turns out that this string is only different between different cmake runs. This is not what I expected. IMHO this is a bug, either in the code, or in the documentation. $ cat ../CMakeLists.txt project(Dummy NONE) cmake_minimum_required(VERSION 2.6) string(RANDOM a) string(RANDOM b) message(STATUS "a=${a}") message(STATUS "b=${b}") $ cmake .. -- a=PgDGb -- b=PgDGb -- Configuring done -- Generating done -- Build files have been written to: /tmp/loose/cmake/build | ||||
Steps To Reproduce | |||||
Additional Information | According to David Cole this is caused by the fact that the random generator is seeded on every call to string(RANDOM...) using a one-second resolution time value as seed. Solution: only seed the random generator once. | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2009-11-06 03:14 | Marcel Loose | New Issue | |||
2009-11-06 09:27 | Bill Hoffman | Status | new => assigned | ||
2009-11-06 09:27 | Bill Hoffman | Assigned To | => David Cole | ||
2009-11-06 10:20 | David Cole | Note Added: 0018362 | |||
2009-11-06 10:20 | David Cole | Status | assigned => resolved | ||
2009-11-06 10:20 | David Cole | Resolution | open => fixed | ||
2010-11-05 12:13 | Marcel Loose | Note Added: 0022899 | |||
2010-11-05 12:13 | Marcel Loose | Status | resolved => closed | ||
2010-11-05 12:13 | Marcel Loose | Fixed in Version | => CMake 2.8.3 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|