viz: fix precompiled headers definitions
authorAlexander Alekhin <alexander.alekhin@itseez.com>
Mon, 3 Aug 2015 11:36:58 +0000 (14:36 +0300)
committerAlexander Alekhin <alexander.alekhin@itseez.com>
Mon, 3 Aug 2015 11:39:24 +0000 (14:39 +0300)
cmake/OpenCVPCHSupport.cmake

index e5fb90e..1c03f36 100644 (file)
@@ -48,10 +48,16 @@ MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
             LIST(APPEND ${_out_compile_flags} "-fPIC")
         ENDIF()
 
+        GET_PROPERTY(_definitions DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+        if(_definitions)
+          foreach(_def ${_definitions})
+            LIST(APPEND ${_out_compile_flags} "\"-D${_def}\"")
+          endforeach()
+        endif()
         GET_TARGET_PROPERTY(_target_definitions ${_PCH_current_target} COMPILE_DEFINITIONS)
         if(_target_definitions)
           foreach(_def ${_target_definitions})
-            LIST(APPEND ${_out_compile_flags} "-D${_def}")
+            LIST(APPEND ${_out_compile_flags} "\"-D${_def}\"")
           endforeach()
         endif()