diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index cdaea1e2a3..d90c5edadf 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -210,7 +210,12 @@ function(interrogate_sources target output database language_flags) # in the same way that they are passed to the compiler so that Interrogate # will preprocess each file in the same way. set(_compile_defs "$") - set(define_flags "$<$:-D'$'>") + if(NOT CMAKE_HOST_WIN32) + # Win32's command-line parser doesn't understand "'" + # that's fine, it also ignores '"' + set(_q "'") + endif() + set(define_flags "$<$:-D${_q}$${_q}>") # If this is a release build that has NDEBUG defined, we need that too: foreach(build_type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE})