Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LarsLeferenz opened this issue Jul 13, 2023 · 2 comments
Open

Comments

@LarsLeferenz
Copy link

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 :)

@caseymcc
Copy link
Owner

On quick glance the above looks correct, however calling it from a plugin may be an invalid assumption (I haven't actually tested it, just assumed it would work). It may be that they don't actually include the cs project when calling from a plugin and only forward it to the project using the plugin. If this is the case may have to find another work around to include it. When I get a chance I will see if I can find something.

@keegean
Copy link

keegean commented May 24, 2024

I'm also seeing this issue. I'm still able to compile and build my plugin and the third-party library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants