caseymcc / UE4CMake

Provides a simple way to add a cmake lib to any Unreal Engine 4 (UE4) or 5 (UE5) project.
MIT License
78 stars 14 forks source link

5.2.1 - ERROR - Does not match the generator used previously: Visual Studio 17 2022 #17

Open Quicksymphony opened 1 year ago

Quicksymphony commented 1 year ago

I noticed an error which comes up for the 5.2.1 packaging steps.

UATHelper: Packaging (Linux): CMake Error: Error: generator : Unix Makefiles UATHelper: Packaging (Linux): Does not match the generator used previously: Visual Studio 17 2022 UATHelper: Packaging (Linux): Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

also:

PackagingResults: Error: Error: generator : Unix Makefiles UATHelper: Packaging (Linux): Failed to create ConsoleBuf! setActiveInputCodepage failed!Failed to create ConsoleBuf! setActiveInputCodepage failed! CMake Error: Error: generator : Unix MakefilesDoes not match the generator used previously: Visual Studio 17 2022 Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory. UATHelper: Packaging (Linux): Cannot configure CMake project. Exited with code: 1

How can I switch this in the main project? Running on the Cross Compile Toolchain from the Unreal Linux Development Requirement.

Visual Studio 2022 is becoming the standard so I was wondering about switching this manually.

Quicksymphony commented 1 year ago

There's a compile reference here which seems to be causing conflicts. https://github.com/caseymcc/UE4CMake/blob/76db68259430c2ecdd0763402a467fd15091c760/Source/CMakeTarget.Build.cs#L356

caseymcc commented 1 year ago

Without the code it will not generate on 5+ as VS2017 (which is VS15 not 17) is no longer supported. You should be able to remove the cmake build directory and run again, however I am not sure about your setup. Are you on linux cross compiling for windows or the other way around? I would have assumed on linux cross compiling for windows that it would use clang either way and Windows cross compiling for linux I would assume clang as well so not sure how VS is being engaged at all (but I have not cross compiled either way)

Quicksymphony commented 1 year ago

Without the code it will not generate on 5+ as VS2017 (which is VS15 not 17) is no longer supported. You should be able to remove the cmake build directory and run again, however I am not sure about your setup. Are you on linux cross compiling for windows or the other way around? I would have assumed on linux cross compiling for windows that it would use clang either way and Windows cross compiling for linux I would assume clang as well so not sure how VS is being engaged at all (but I have not cross compiled either way)

https://docs.unrealengine.com/5.2/en-US/linux-development-requirements-for-unreal-engine/

build chain for 5.2.1: -v21 clang-15.0.1-based

Using the exe provided adds the cross compile toolchain to your environment variables, to it'll be callable in unreal engine under platforms.

you can set it up for the toolchain and package linux from windows platform pretty much, but yeah.

I'm building from windows side using the provided toolchain.

caseymcc commented 1 year ago

I think I need to set the build directory based on the target os, https://github.com/caseymcc/UE4CMake/blob/76db68259430c2ecdd0763402a467fd15091c760/Source/CMakeTarget.Build.cs#L268C57-L268C73

I think what is happening is the cross compile is trying to use the build folder that VS already built to and now that you are using clang to build cmake is confused.

Quicksymphony commented 1 year ago

I think I need to set the build directory based on the target os, https://github.com/caseymcc/UE4CMake/blob/76db68259430c2ecdd0763402a467fd15091c760/Source/CMakeTarget.Build.cs#L268C57-L268C73

I think what is happening is the cross compile is trying to use the build folder that VS already built to and now that you are using clang to build cmake is confused.

Makes the most sense. haha, I can look at some options, but let me know if there's a quick fix for 5.2.1 and I can check the branch.

5.2.1 added many items to different modules or directories. So i'm trying to resolve the solutions at this point.