I’ve been working on a project that’s half-using CMake at the moment - a ‘core’ library is built using CMake, and then
include_external_msproject is used to include a Visual Studio project that builds a C++/WinRT library (winmd file + dll.)
This is proving difficult to make work across every developer’s device, difficult to retarget to new versions and different architectures, and especially difficult to automate, so we’d like to move toward a full CMake setup. Thing is, I can’t figure out how to set up a C++/WinRT project from CMake.
I’ve tried things along these lines to make a simple test command-line C++/WinRT program build:
cmake_minimum_required(VERSION 3.19) project(TEST) set(CMAKE_CXX_STANDARD 17) add_executable(TEST main.cpp pch.h) set_target_properties(TEST PROPERTIES VS_WINRT_COMPONENT TRUE)
I’ve also tried adding NuGet package references, etc. (And of course modifying the environment / toolchain.) No matter what, upon running, it has issues finding dozens of DLLs.
Is there a good way to set up a C++/WinRT project (Command-line app + separate winmd library, ideally) with CMake?