When asked about where I wanted to be in my career by my boss (boss' boss actually), I was honest about having my resume out there and looking for other opportunities outside my current company. Now, I've heard from other sources a promotion that was possible in my future has been basically pulled.
Honesty is not a good policy. Keep lying.
Everyone says they want the truth, but if you are told you're not doing meaningful work, the justification for your job is vanity metrics, and the guy with less experience than you who does terrible work makes more money than you, how happy would you be?
If you told management, you're using the position and any promotion as a jumping off area for a newer better job at a different company, how happy would management be?
Not happy, and why would they? Flip it around, how happy would you be if you knew they were out there shopping around for your replacement? Only keeping you so long as they didn't find someone better?
The only time it's acceptable IMO is when you're thinking about leaving for an actual, offered role that's much different, eg, "I'm thinking of leaving to be CTO of Startup X, what do you think?"; in any event it's probably OK if the reasons are beyond the company's control (you're moving, etc).