Guard against empty cmake generator expressions

COMPILER_DEFINITIONS can contain cmake generator expressions that evaluate to an empty string.
gcc fails when you pass -D without an expression as an argument.