function(AptInstall)
  execute_process(COMMAND dpkg-query -W ${ARGV} OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE MISSING_DEPS)
  if(MISSING_DEPS)
    message(STATUS "Install missing dependencies")
    execute_process(COMMAND sudo apt-get update RESULT_VARIABLE APT_FAILED)
    if(APT_FAILED)
      message(FATAL_ERROR "apt update failed, check the error and try again")
    endif()
    execute_process(COMMAND sudo apt-get install -y ${ARGV} RESULT_VARIABLE APT_FAILED)
    if(APT_FAILED)
      message(FATAL_ERROR "apt install failed, check the error and try again")
    endif()
  endif()
endfunction()
