#cmakedefine01 (in config.h.in) sets WITH_OAUTHBEARER_OIDC as either 0 (when disabled) or 1 (when enabled). The problem is that
#ifdef checks if a symbol is defined, not its value. So #ifdef WITH_OAUTHBEARER_OIDC is always true causing curl.h to always be required.