Trying to apply and configure cpp-library plugin from another script plugin

In my plugin’s customNative.gradle script I have:

class MyCustomCppPlugin implements Plugin<Project> {

	void apply(Project project) {
		project.plugins.apply('cpp-library');
		project.plugins.apply('xcode');
		project.plugins.apply('visual-studio');
		project.convention.plugins.customNativePlugin = new MyCustomNativePluginConvention(project)
		project.extensions.create("customNative", CustomNativePluginExtension)
		project.library {
			targetMachines = [
				machines.windows.x86_64,
				machines.macOS.x86_64,
				machines.linux.x86_64
			]
...

But when I try to use this I get the following error:

Could not get unknown property ‘machines’ for C++ library ‘main’ of type org.gradle.language.cpp.internal.DefaultCppLibrary.

I must be missing something simple.

Figured it out… I needed ‘project.machines.’