How to enable preprocessor defines when installing a formulae?

Some libraries have conditional builds enabled by preprocessor defines, say, #define ENABLE_THIS_FEATURE . How do we enable features like this with Homebrew?

With vcpkg , we could tweak CMake through vcpkg facilities. It’s unclear to me how to do so with Homebrew.

Please help.

This depends on the software in question, but typically the build system will have options for this; e.g., for autotools it might be ./configure --enable-this-feature, or for CMake it might look like cmake -DENABLE_THIS_FEATURE.

OK. So say if the package is built through CMakej, would it be possible to specify cmake -DENABLE_THIS_FEATURE through the brew install command?

No, it’ll have to be defined inside the formula.