-add_compile_options($<$<CONFIG:PROFILING>:-g>)
-add_compile_options($<$<CONFIG:PROFILING>:-O0>)
-add_compile_options($<$<CONFIG:PROFILING>:-pg>)
-add_compile_options($<$<CONFIG:PROFILING>:-Wp,-U_FORTIFY_SOURCE>)
-
-add_compile_options($<$<CONFIG:DEBUG>:-g>)
-add_compile_options($<$<CONFIG:DEBUG>:-ggdb>)
-add_compile_options($<$<CONFIG:DEBUG>:-Wp,-U_FORTIFY_SOURCE>)
-
-add_compile_options($<$<CONFIG:CCOV>:-g>)
-add_compile_options($<$<CONFIG:CCOV>:-O2>)
-add_compile_options($<$<CONFIG:CCOV>:--coverage>)
+set(PROFILING_COMPILE_OPTIONS "-g" "-O0" "-pg" "-Wp,-U_FORTIFY_SOURCE" CACHE STRING "Compilation flags for PROFILING build type.")
+set(DEBUG_COMPILE_OPTIONS "-g" "-ggdb" "-Wp,-U_FORTIFY_SOURCE" CACHE STRING "Compilation flags for DEBUG build type.")
+set(CCOV_COMPILE_OPTIONS "-g" "-O2" "--coverage" CACHE STRING "Compilation flags for CCOV build type.")
+set(RELEASE_COMPILE_OPTIONS "-g" "-O2" CACHE STRING "Compilation flags for RELEASE build type.")
+foreach(option ${PROFILING_COMPILE_OPTIONS})
+ add_compile_options($<$<CONFIG:PROFILING>:${option}>)
+endforeach()
+foreach(option ${DEBUG_COMPILE_OPTIONS})
+ add_compile_options($<$<CONFIG:PROFILING>:${option}>)
+endforeach()
+foreach(option ${CCOV_COMPILE_OPTIONS})
+ add_compile_options($<$<CONFIG:PROFILING>:${option}>)
+endforeach()
+foreach(option ${RELEASE_COMPILE_OPTIONS})
+ add_compile_options($<$<CONFIG:PROFILING>:${option}>)
+endforeach()