I have a C++ application I'm developing. I want to release a free version and a paid version, with the production version adding features on top of the existing free version.

What's the best way to compile features depending on the release type? Ideally I would pass a flag to CMake so while building the binary it would also include any code I need in the production version.