You can easily generate definitions for existing declarations by pressing &shortcut:CIDR.Lang.Cpp.GenerateDefinitions; (Code | Generate Definitions).
CLion is able to adapt to the patterns you are using in your project. It can detect and support three possible patterns:
If you switch from one of these patterns to another (by using Generate in-place option), CLion will pick up on that and behave accordingly next time you use code generation.
