for me, setting only CMAKE_CXX_FLAGS did not do the trick when I was trying to compile everyting with libstdc++'s debug mode enabled. (it caused linker errors because opm-parser was not linked against std::debug in this case.) Maybe I got something wrong, though...