# This will set the flags only if the user didn't explicitly choose them with -DCMAKE_CXX_FLAGSif(NOTCMAKE_CXX_FLAGS)if(CMAKE_BUILD_TYPESTREQUAL"Debug")if(MSVC)list(APPENDCMAKE_CXX_FLAGS"/O0")else()list(APPENDCMAKE_CXX_FLAGS"-O0")endif()else()if(MSVC)list(APPENDCMAKE_CXX_FLAGS"/O2")else()list(APPENDCMAKE_CXX_FLAGS"-O2")endif()endif()message("Setting CXX flags to default for ${CMAKE_BUILD_TYPE} mode (${CMAKE_CXX_FLAGS})")else()message("CXX flags are already set to ${CMAKE_CXX_FLAGS}")endif()