Fix setting CMAKE_MODULE_PATH to respect the previous content of this variable. Furthermore do not process subdirectories with 3rdparty code even if no libjpeg, libpng or libz was found on the target system.