diff options
author | Brad King <brad.king@kitware.com> | 2016-10-01 12:20:30 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-10-01 12:20:30 (GMT) |
commit | de486a68950677512f33ce832e80ab334b501a61 (patch) | |
tree | a7af0576c3ebb7301f6bdd8c33f50ac2d405f019 /Source | |
parent | b4235b7590554af75ea84a765f82a996ba4de1f8 (diff) | |
parent | 50b27de4219e2afa665f31a505439e6b9526bb02 (diff) | |
download | CMake-de486a68950677512f33ce832e80ab334b501a61.zip CMake-de486a68950677512f33ce832e80ab334b501a61.tar.gz CMake-de486a68950677512f33ce832e80ab334b501a61.tar.bz2 |
Merge topic 'aux_source_directory-sort'
50b27de4 aux_source_directory: Sort results to make it deterministic
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmAuxSourceDirectoryCommand.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index fed4d5b..6655911 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -32,6 +32,8 @@ bool cmAuxSourceDirectoryCommand::InitialPass( sourceListValue = def; } + std::vector<std::string> files; + // Load all the files in the directory cmsys::Directory dir; if (dir.Load(tdir.c_str())) { @@ -55,14 +57,16 @@ bool cmAuxSourceDirectoryCommand::InitialPass( // depends can be done cmSourceFile* sf = this->Makefile->GetOrCreateSource(fullname); sf->SetProperty("ABSTRACT", "0"); - if (!sourceListValue.empty()) { - sourceListValue += ";"; - } - sourceListValue += fullname; + files.push_back(fullname); } } } } + std::sort(files.begin(), files.end()); + if (!sourceListValue.empty()) { + sourceListValue += ";"; + } + sourceListValue += cmJoin(files, ";"); this->Makefile->AddDefinition(args[1], sourceListValue.c_str()); return true; } |