[CMake] To quote (path) variables or not, and everywhere?

Mateusz Loskot mateusz at loskot.net
Mon Sep 25 07:40:35 EDT 2017


On 25 September 2017 at 12:57, Oleksii Vilchanskyi
<alexvilchansky at yahoo.com> wrote:
> As usually with CMake, there are no recommendations/guidelines.

So, cases with the ammo for CMake sceptics and opponents are not
empty, yet. Pity.

> However, here's my logic:
>
> 1) if it's a path, always quote it
> 2) if it's not a pat, but inside an if() or any similar core language
> structure, quote it as well
> 3) don't quote only if you're sure the string can't have spaces - otherwise
> do quote
> 4) quoting is free and doesn't hurt

That sounds reasonable. Thank you.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the CMake mailing list