--- a/cmake/setup_ult_global_flags.cmake
+++ b/cmake/setup_ult_global_flags.cmake
@@ -15,1 +15,1 @@
-    string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_upper)
+    string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_upper)
@@ -18,1 +18,1 @@
-    string(REGEX REPLACE "-O[1-3]" "" CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_upper} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_upper}})
+    string(REGEX REPLACE "-O[1-3]" "" CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_upper} "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_upper}}")
