  A weakly nonlocal extension of ideal fluid dynamics is derived from the
Second Law of thermodynamics. It is proved that in the reversible limit the
additional pressure term can be derived from a potential. The requirement of
the additivity of the specific entropy function determines the quantum
potential uniquely. The relation to other known derivations of Schr\"odinger
equation (stochastic, Fisher information, exact uncertainty) is clarified.
