2
0
Эх сурвалжийг харах

As the first example, make copy-paste-answerer work in UWP.

Hanseul Jun 4 жил өмнө
parent
commit
dfc9fdb9b0

+ 1 - 1
CMakeLists.txt

@@ -365,7 +365,7 @@ if(NOT NO_TESTS)
 endif()
 endif()
 
 
 # Examples
 # Examples
-if(NOT NO_EXAMPLES AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+if(NOT NO_EXAMPLES)
 	set(JSON_BuildTests OFF CACHE INTERNAL "")
 	set(JSON_BuildTests OFF CACHE INTERNAL "")
 	add_subdirectory(deps/json)
 	add_subdirectory(deps/json)
 	add_subdirectory(examples/client)
 	add_subdirectory(examples/client)

+ 15 - 1
examples/copy-paste/CMakeLists.txt

@@ -1,12 +1,26 @@
 cmake_minimum_required(VERSION 3.7)
 cmake_minimum_required(VERSION 3.7)
 
 
+set(ANSWERER_UWP_RESOURCES
+	uwp/answerer/Logo.png
+	uwp/answerer/package.appxManifest
+	uwp/answerer/SmallLogo.png
+	uwp/answerer/SmallLogo44x44.png
+	uwp/answerer/SplashScreen.png
+	uwp/answerer/StoreLogo.png
+	uwp/answerer/Windows_TemporaryKey.pfx
+)
+
 add_executable(datachannel-copy-paste-offerer offerer.cpp)
 add_executable(datachannel-copy-paste-offerer offerer.cpp)
 set_target_properties(datachannel-copy-paste-offerer PROPERTIES
 set_target_properties(datachannel-copy-paste-offerer PROPERTIES
 	CXX_STANDARD 17
 	CXX_STANDARD 17
 	OUTPUT_NAME offerer)
 	OUTPUT_NAME offerer)
 target_link_libraries(datachannel-copy-paste-offerer datachannel)
 target_link_libraries(datachannel-copy-paste-offerer datachannel)
 
 
-add_executable(datachannel-copy-paste-answerer answerer.cpp)
+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+  add_executable(datachannel-copy-paste-answerer answerer.cpp ${ANSWERER_UWP_RESOURCES})
+else()
+  add_executable(datachannel-copy-paste-answerer answerer.cpp)
+endif()
 set_target_properties(datachannel-copy-paste-answerer PROPERTIES
 set_target_properties(datachannel-copy-paste-answerer PROPERTIES
 	CXX_STANDARD 17
 	CXX_STANDARD 17
 	OUTPUT_NAME answerer)
 	OUTPUT_NAME answerer)

BIN
examples/copy-paste/uwp/answerer/Logo.png


BIN
examples/copy-paste/uwp/answerer/SmallLogo.png


BIN
examples/copy-paste/uwp/answerer/SmallLogo44x44.png


BIN
examples/copy-paste/uwp/answerer/SplashScreen.png


BIN
examples/copy-paste/uwp/answerer/StoreLogo.png


BIN
examples/copy-paste/uwp/answerer/Windows_TemporaryKey.pfx


+ 42 - 0
examples/copy-paste/uwp/answerer/package.appxManifest

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package
+	xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
+    xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
+	xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+	xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4"
+	xmlns:iot2="http://schemas.microsoft.com/appx/manifest/iot/windows10/2"
+	IgnorableNamespaces="uap mp">
+
+	<Identity Name="86FAC2A3-40CD-393F-9F55-52A30E0D3B8F" Publisher="CN=CMake" Version="1.0.0.0" />
+	<mp:PhoneIdentity PhoneProductId="86FAC2A3-40CD-393F-9F55-52A30E0D3B8F" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
+	<Properties>
+		<DisplayName>datachannel-copy-paste-answerer</DisplayName>
+		<PublisherDisplayName>CMake</PublisherDisplayName>
+		<Logo>StoreLogo.png</Logo>
+	</Properties>
+	<Dependencies>
+		<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
+	</Dependencies>
+	<Resources>
+		<Resource Language="x-generate" />
+	</Resources>
+	<Applications>
+		<Application
+			Id="App"
+			Executable="answerer.exe"
+			EntryPoint="datachannel-copy-paste-answerer.App"
+			desktop4:Subsystem="console"
+			desktop4:SupportsMultipleInstances="true"
+			iot2:Subsystem="console"
+			iot2:SupportsMultipleInstances="true">
+			<uap:VisualElements
+				DisplayName="datachannel-copy-paste-answerer"
+				Description="datachannel-copy-paste-answerer"
+				BackgroundColor="#336699"
+				Square150x150Logo="Logo.png"
+				Square44x44Logo="SmallLogo44x44.png">
+				<uap:SplashScreen Image="SplashScreen.png" />
+			</uap:VisualElements>
+		</Application>
+	</Applications>
+</Package>