Closed connorjak closed 2 years ago
CMakeTarget.add(Target, this, "{lib's cmake target name}", "{location to cmake lib source}", "-DCMAKE_TOOLCHAIN_FILE=...");
If I get a chance I will see if I can test UE5, however on the toolchain it might be better to build the toolchain file based on information from the build tools (if it is possible) that way the ue build and the cmake build agree on the build info.
My particular use case for this is sharing a vcpkg installation of a few libraries including GDAL, which is accomplished by vcpkg supplying the toolchain that fulfills find_package
calls in CMake.
ah, never used vcpkg. seems a little invasive to use the toolchain option like that but would have to spend some time with it to get an idea for sure. Likely a plug-in that used vcpkg directly would be better than ue->cmake->vcpkg. Also if hunter has the packages you need it might work better in this case, it's what I use with my ue projects
vcpkg has its own package download / update tooling but the build configuration stuff is all CMake-based. The way I use it with my team actually removes most of the "vcpkg" parts by generating a vcpkg-export
set of binaries. The toolchain file populates the package .cmake
files so the application can find the installed libraries.
Closing till a UE5 issue shows up
Looks like there were a few issues with UE5 (mainly removal of target platforms). Those should be fixed with https://github.com/caseymcc/UE4CMake/pull/4
I use vcpkg / CMake for my separate server application, and upgrading to UE5 broke UnrealGDAL (https://github.com/TensorWorks/UnrealGDAL), so I'm considering transitioning to UE_CMake instead to be able to share a
gdal
installation between the codebases. I have some questions:-DCMAKE_TOOLCHAIN_FILE...
)?