diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-12-04 14:12:31 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-12-04 14:12:31 (GMT) |
commit | 24bff45d1bd87f86d442157170ea8c987236318c (patch) | |
tree | d7ac8f1c348ec60ded7a08644cbd4219d0d0a54a /Modules/GetPrerequisites.cmake | |
parent | 81515ba8a58dcaba6f564d6f59bd4abf7235a316 (diff) | |
download | CMake-24bff45d1bd87f86d442157170ea8c987236318c.zip CMake-24bff45d1bd87f86d442157170ea8c987236318c.tar.gz CMake-24bff45d1bd87f86d442157170ea8c987236318c.tar.bz2 |
BUG: make sure list is not size 0 before sort
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-rw-r--r-- | Modules/GetPrerequisites.cmake | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 13a918d..e7457d6 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -568,8 +568,10 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa endif("${candidate}" MATCHES "${gp_regex}") endforeach(candidate) - list(SORT ${prerequisites_var}) - + list(LENGTH ${prerequisites_var} prerequisites_var_length) + if(prerequisites_var_length GREATER 0) + list(SORT ${prerequisites_var}) + endif(prerequisites_var_length GREATER 0) if(${recurse}) set(more_inputs ${unseen_prereqs}) foreach(input ${more_inputs}) |