Skip to content

"The name 'CMakeTarget' does not exist" when adding to a plugin. #16

@LarsLeferenz

Description

@LarsLeferenz

Hi,
I'm currently trying to add UE4CMake to a plugin I'm developing. The readme briefly states that this should be possible.

Though, when I generate the projects files I get the error
C:\Users\Lars\Documents\Unreal Projects\Test\Plugins\SenSim\Source\SenSim\SenSim.Build.cs(16,3): error CS0103: The name 'CMakeTarget' does not exist in the current context

My Build.cs file:

using UnrealBuildTool;
using System.IO;

public class SenSim : ModuleRules
{
	public SenSim(ReadOnlyTargetRules Target) : base(Target)
	{
		PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
		
		PublicIncludePaths.AddRange(new string[] {});		
		PrivateIncludePaths.AddRange(new string[] {});
		PublicDependencyModuleNames.AddRange(new string[]{"Core",});
		PrivateDependencyModuleNames.AddRange(new string[]{"CoreUObject", "Engine", "Slate", "SlateCore", "CMakeTarget",});
		DynamicallyLoadedModuleNames.AddRange(new string[] {});

		CMakeTarget.add(Target, this, "MAVSDK", Path.Combine(this.ModuleDirectory, "../../Deps/MAVSDK"), "", true);

	}
}

Excerpt from my .uplugin file:

    "Plugins": [
		{
			"Name": "CMakeTarget",
			"Enabled": true
		}
	]

UE4CMake is in my plugins /Plugins folder.
I'm using Unreal 5.2 with this pull request.

I'm pretty inexperienced with the Unreal Build Tool, so help would be appreciated :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions