The flags we were defining for _DEBUG and _RELEASE were similar to the default
CMake flags for those types, which get appended to CMAKE_CXX_FLAGS, so we only
need to customize the latter.
The final flags will be for e.g. RelWithDebInfo:
${CMAKE_CXX_FLAGS} ${CXXFLAGS} ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
with ${CXXFLAGS} taken from the environment.
### CMake config
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 --std=c++11")
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-parentheses -pedantic -g -pg --std=c++11")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wno-parentheses -O2 -std=c++11")
+set(CMAKE_CXX_FLAGS "-Wall -Wno-parentheses --std=c++11 ${CMAKE_CXX_FLAGS}")
if(APPLE)
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX")