aboutsummaryrefslogtreecommitdiff
path: root/tests/ECMInstallIconsTest/check_tree.cmake.in
blob: 6d14246b94bbfa801c497af92878cff9cb979184 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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()