#!/bin/bash

LANG=C

for i in $(find build* -name "*.so"); do

    OUTPUT=$(ldd $i | grep "not found" | grep -v version)

    if [[ $? -eq 0 ]]; then
        if   [[ $i == *qtserialbus* ]]; then
            # continue
            echo -e "\033[31m QtSerialBus: \033[0m"
        elif [[ $i == *qt3d* ]]; then 
            # continue
            echo -e "\033[32m Qt3D: \033[0m"
        elif [[ $i == *qtdeclarative* ]]; then 
            # continue
            echo -e "\033[34m QtDeclarative: \033[0m"
        fi

        echo $(basename $i):
        echo $OUTPUT | sed 's;\(not found\)[ ]*;\1\n;g'
    fi

done

