def METHOD_NAME(self):
    tc = CMakeToolchain(self)
    tc.variables["ANTLR4_INSTALL"] = True
    tc.variables["WITH_LIBCXX"] = self.settings.compiler.get_safe("libcxx") == "libc++"
    tc.variables["ANTLR_BUILD_CPP_TESTS"] = False
    if is_msvc(self):
        tc.cache_variables["WITH_STATIC_CRT"] = is_msvc_static_runtime(self)
    tc.variables["WITH_DEMO"] = False
    # As of ANTLR 4.12.0, one can choose to build the shared/static library only instead of both of them
    # Related Issue: https://github.com/antlr/antlr4/issues/3993
    # Related PR: https://github.com/antlr/antlr4/pull/3996
    if Version(self.version) >= "4.12":
        tc.variables["ANTLR_BUILD_SHARED"] = self.options.shared
        tc.variables["ANTLR_BUILD_STATIC"] = not self.options.shared
    tc.METHOD_NAME()
    tc = CMakeDeps(self)
    tc.METHOD_NAME()