diff options
Diffstat (limited to 'tests/ECMInstallIconsTest/check_tree.cmake.in')
-rw-r--r-- | tests/ECMInstallIconsTest/check_tree.cmake.in | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ECMInstallIconsTest/check_tree.cmake.in b/tests/ECMInstallIconsTest/check_tree.cmake.in new file mode 100644 index 00000000..6d14246b --- /dev/null +++ b/tests/ECMInstallIconsTest/check_tree.cmake.in @@ -0,0 +1,23 @@ +set(EXP_TREE "@CMAKE_CURRENT_SOURCE_DIR@/expected-tree") +set(ACTUAL_TREE "@CMAKE_INSTALL_PREFIX@") + +file(GLOB_RECURSE exp_files RELATIVE "${EXP_TREE}" "${EXP_TREE}/*") +file(GLOB_RECURSE actual_files RELATIVE "${ACTUAL_TREE}" "${ACTUAL_TREE}/*") +list(SORT exp_files) +list(SORT actual_files) + +if(NOT exp_files STREQUAL actual_files) + foreach(f ${exp_files}) + list(FIND actual_files "${f}" result) + if(result EQUAL -1) + message(WARNING "${f} was expected, but not found") + endif() + endforeach() + foreach(f ${actual_files}) + list(FIND exp_files "${f}" result) + if(result EQUAL -1) + message(WARNING "${f} was found, but not expected") + endif() + endforeach() + message(FATAL_ERROR "Trees differ!") +endif() |