Refactor c++ compile flags in own cmake file