MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0014491 | CMake | (No Category) | public | 2013-10-17 11:02 | 2016-06-10 14:21 |
Reporter | ingolf | ||||
Assigned To | |||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | linux/i386 and x86_64 | OS | ubuntu / openSUSE | OS Version | various |
Product Version | CMake 2.8.10.2 | ||||
Target Version | CMake 3.6 | Fixed in Version | CMake 3.6 | ||
Summary | 0014491: file(GLOB) and file(GLOB_RECURSE) indeterministic | ||||
Description | file(GLOB) and file(GLOB_RECURSE) have indeterministic behavior. Apparently, the ordering of the files which match the specified pattern depends on the sequence in which files are delivered by the file system. While this might be on purpose, this should at least be clearly documented -- together with a proposal to use list(SORT) afterwards if a fixed ordering is desired. Nevertheless, I would expect the cmake output to be reproducible when all the files involved in the project (including the cmake tool itself) as well as the user environment variables have the same content. | ||||
Steps To Reproduce | Create an empty project directory with the following contents (all files can be empty): ./f1.abx ./folder1/8764gh.abb ./folder1/q.ab0 ./folder1/zzzzz.ab_ ./folder2/.abz ./folder2/_bbbb_.abd ./folder2/bea7.96.abc ./folder2/xcx.abcd ./fsbi213.ab ./z.ab5 Then use the following CMakeLists.txt: ----8<----8<----8<----8<----8<----8<----8<----8<---- cmake_minimum_required(VERSION 2.8) file(GLOB FILES_LOCAL RELATIVE ${CMAKE_SOURCE_DIR} *.ab?) message(STATUS "Non-recursive: ${FILES_LOCAL}") file(GLOB_RECURSE FILES_RECURSE RELATIVE ${CMAKE_SOURCE_DIR} *.ab?) message(STATUS "Recursive: ${FILES_RECURSE}") ----8<----8<----8<----8<----8<----8<----8<----8<---- On the same machine (with the same user environment), CMake might output > -- Non-recursive: z.ab5;f1.abx > -- Recursive: z.ab5;folder1/8764gh.abb;folder1/q.ab0;folder1/zzzzz.ab_;f1.abx;folder2/.abz;folder2/bea7.96.abc;folder2/_bbbb_.abd when run in one folder and > -- Non-recursive: f1.abx;z.ab5 > -- Recursive: f1.abx;folder2/_bbbb_.abd;folder2/.abz;folder2/bea7.96.abc;folder1/zzzzz.ab_;folder1/q.ab0;folder1/8764gh.abb;z.ab5 when run in another folder. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2013-10-17 11:02 | ingolf | New Issue | |||
2016-05-18 09:38 | Brad King | Note Added: 0041073 | |||
2016-05-18 09:38 | Brad King | Status | new => resolved | ||
2016-05-18 09:38 | Brad King | Resolution | open => fixed | ||
2016-05-18 09:38 | Brad King | Fixed in Version | => CMake 3.6 | ||
2016-05-18 09:38 | Brad King | Target Version | => CMake 3.6 | ||
2016-06-10 14:21 | Kitware Robot | Note Added: 0041168 | |||
2016-06-10 14:21 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|