diff --git a/compute/CMakeLists.txt b/compute/CMakeLists.txt
index 587c24e77ec1b18487ca7615fe2070c88276a968..be8847e7f504dd5c01c425ac0c6900a0d2ffda4c 100644
--- a/compute/CMakeLists.txt
+++ b/compute/CMakeLists.txt
@@ -42,9 +42,11 @@ set(CHAMELEON_CONTROL
 #    ../control/morsewinthread.c
    )
 
+set(flags_to_add "")
 foreach(_prec ${CHAMELEON_PRECISION})
-    set_source_files_properties(../control/tile.c PROPERTIES COMPILE_FLAGS "-DPRECISION_${_prec}")
+    set(flags_to_add "${flags_to_add} -DPRECISION_${_prec}")
 endforeach()
+set_source_files_properties(../control/tile.c PROPERTIES COMPILE_FLAGS "${flags_to_add}")
 
 # Generate the morse sources for all possible precisions
 # ------------------------------------------------------
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 3687573cc30f1c5bae90c4470c11f29de287e9a5..fae48f518dd3476595b9fa41944a382594464264 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -53,9 +53,11 @@ set(CHAMELEON_HDRS
     ${CHAMELEON_HDRS_GENERATED}
     )
 
+set(flags_to_add "")
 foreach(_prec ${CHAMELEON_PRECISION})
-    set_source_files_properties(runtime.h PROPERTIES COMPILE_FLAGS "-DPRECISION_${_prec}")
+    set(flags_to_add "${flags_to_add} -DPRECISION_${_prec}")
 endforeach()
+set_source_files_properties(runtime.h PROPERTIES COMPILE_FLAGS "${flags_to_add}")
 
 # Force generation of headers
 # ---------------------------
diff --git a/runtime/starpu/CMakeLists.txt b/runtime/starpu/CMakeLists.txt
index 4a0894613c711b805e8601fa25743d25f1fc5fda..2dac50b656eb86ee1b1d456b058bee7ca60502ac 100644
--- a/runtime/starpu/CMakeLists.txt
+++ b/runtime/starpu/CMakeLists.txt
@@ -94,9 +94,11 @@ set(RUNTIME_COMMON
     ${RUNTIME_COMMON_GENERATED}
     )
 
+set(flags_to_add "")
 foreach(_prec ${CHAMELEON_PRECISION})
-    set_source_files_properties(control/profiling.c PROPERTIES COMPILE_FLAGS "-DPRECISION_${_prec}")
+    set(flags_to_add "${flags_to_add} -DPRECISION_${_prec}")
 endforeach()
+set_source_files_properties(control/profiling.c PROPERTIES COMPILE_FLAGS "${flags_to_add}")
 
 # Generate the morse sources for all possible precisions
 # ------------------------------------------------------