mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-16 01:19:00 +08:00
3a7cb341b8
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
25 lines
694 B
CMake
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)
|