Fix CMP0043 cmake warning when using cmake 3.0.2

COMPILE_DEFINITIONS_CONFIG has been deprecated, use generator expressions
with plain COMPILE_DEFINITIONS instead (available since 2.8.10)
Fix broken cmake macro

Only the first config in the list was being seen
Fix executable naming for cmake builds
Fix malformed flags
Merge pull request #1064 from bpay/cmake-fixes

CMake fixes