vcpkg/ports/cppwinrt/cppwinrt-config.cmake.in
Chuck Walbourn 3a7cb341b8
[cppwinrt] Update port for January 2024 release (#37452)
This updates the cppwinrt port to use the latest
Microsoft.Windows.CppWinRT package from NuGet. Includes clean up of the
portfile for modern best practices.

This also cleans up the cmake integration:

* Uses `cppwinrt_FOUND` instead of the nonstandard `CppWinRT_FOUND`
* Provides `CPPWINRT_TOOL` for being able to generate C++/WinRT headers
from .winmd files as custom commands
2024-03-14 12:27:37 -07:00

25 lines
694 B
CMake

get_filename_component(_cppwinrt_root "${CMAKE_CURRENT_LIST_DIR}" PATH)
get_filename_component(_cppwinrt_root "${_cppwinrt_root}" PATH)
set(_cppwinrt_exe "${_cppwinrt_root}/@tool_path@")
if (EXISTS "${_cppwinrt_exe}")
add_library(Microsoft::CppWinRT INTERFACE IMPORTED)
set_target_properties(Microsoft::CppWinRT PROPERTIES
INTERFACE_COMPILE_FEATURES cxx_std_17
INTERFACE_INCLUDE_DIRECTORIES "${_cppwinrt_root}/include"
INTERFACE_LINK_LIBRARIES "${_cppwinrt_root}/lib/@lib_name@"
)
set(cppwinrt_FOUND TRUE)
set(CPPWINRT_TOOL ${_cppwinrt_exe})
else()
set(cppwinrt_FOUND FALSE)
endif()
unset(_cppwinrt_root)
unset(_cppwinrt_exe)