Since the variable might be empty and `add_dependencies()` requires more than one argument you should always check the variable before:

    if(ublox_msgs_EXPORTED_TARGETS)
      add_dependencies(ublox_gps ${ublox_msgs_EXPORTED_TARGETS})
    endif()