Procházet zdrojové kódy

modified: CMakeLists.txt for Windows x64

Satoshi Yoneda před 3 týdny
rodič
revize
f5612853c2

+ 22 - 2
CMakeLists.txt

@@ -1,5 +1,5 @@
 cmake_minimum_required(VERSION 3.21)
-project(DupFind VERSION 0.1.0 LANGUAGES CXX)
+project(DupFind VERSION 0.3.0 LANGUAGES CXX)
 
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -84,6 +84,16 @@ if(WIN32)
 
     set(DEPLOY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Deploy/DupFind")
 
+    # Appx Manifest Generation
+    configure_file(
+        "${CMAKE_CURRENT_SOURCE_DIR}/Deploy/AppxManifest.xml.in"
+        "${CMAKE_CURRENT_BINARY_DIR}/AppxManifest.xml"
+        @ONLY
+    )
+
+    # Path to makeappx.exe (Windows SDK Build Tools)
+    set(MAKEAPPX_EXECUTABLE "C:/Program Files (x86)/Microsoft Visual Studio/Shared/NuGetPackages/microsoft.windows.sdk.buildtools/10.0.26100.1742/bin/10.0.26100.0/x64/makeappx.exe")
+
     # `cmake --build build --target deploy` で起動する専用ターゲット
     add_custom_target(deploy
         # 1. 展開用ディレクトリの作成
@@ -105,7 +115,17 @@ if(WIN32)
         # 5. windeployqt による Qt DLL (--compiler-runtime) の自動収集
         COMMAND "${WINDEPLOYQT_EXECUTABLE}" --no-translations --dir "${DEPLOY_DIR}" "${DEPLOY_DIR}/$<TARGET_FILE_NAME:${PROJECT_NAME}>"
         
+        # 6. vc_redist.x64.exe の削除 (Appxには不要)
+        COMMAND ${CMAKE_COMMAND} -E rm -f "${DEPLOY_DIR}/vc_redist.x64.exe"
+
+        # 7. Appx用リソースとManifestのコピー
+        COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/AppxManifest.xml" "${DEPLOY_DIR}/"
+        COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/Deploy/Assets" "${DEPLOY_DIR}/Assets"
+
+        # 8. Appxパッケージの作成
+        COMMAND "${MAKEAPPX_EXECUTABLE}" pack /d "${DEPLOY_DIR}" /p "${CMAKE_CURRENT_SOURCE_DIR}/Deploy/DupFind.appx" /l /o
+
         DEPENDS ${PROJECT_NAME} DupFindCmd
-        COMMENT "Deploying and bundling all dependencies into ${DEPLOY_DIR}..."
+        COMMENT "Deploying and creating Appx package in ${CMAKE_CURRENT_SOURCE_DIR}/Deploy/DupFind.appx..."
     )
 endif()

+ 86 - 0
Deploy/AppxManifest.xml.in

@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Package
+  xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
+  xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
+  xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
+  xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" 
+  xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
+  IgnorableNamespaces="uap uap3 desktop rescap">
+
+  <!-- ============================================== -->
+  <!-- 1. パッケージの識別情報                        -->
+  <!-- ============================================== -->
+  <Identity
+    Name="Satoyon.DupFind"
+    Publisher="CN=Satoyon"
+    Version="@PROJECT_VERSION@.0"
+    ProcessorArchitecture="x64" />
+
+  <!-- ============================================== -->
+  <!-- 2. アプリの基本的なプロパティ設定              -->
+  <!-- ============================================== -->
+  <Properties>
+    <DisplayName>DupFind</DisplayName>
+    <PublisherDisplayName>Satoyon</PublisherDisplayName>
+    <Logo>Assets\StoreLogo.png</Logo>
+  </Properties>
+
+  <!-- ============================================== -->
+  <!-- 3. 動作環境 (Windows 10/11 Desktop)            -->
+  <!-- ============================================== -->
+  <Dependencies>
+    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.22000.0" />
+  </Dependencies>
+
+  <!-- ============================================== -->
+  <!-- 4. 対応言語                                    -->
+  <!-- ============================================== -->
+  <Resources>
+    <Resource Language="ja-jp" />
+    <Resource Language="en-us" />
+  </Resources>
+
+  <!-- ============================================== -->
+  <!-- 5. エントリポイントとスタートメニュー設定      -->
+  <!-- ============================================== -->
+<Applications>
+    <Application Id="DupFind" Executable="DupFind.exe" EntryPoint="Windows.FullTrustApplication">
+      <uap:VisualElements
+        DisplayName="DupFind"
+        Description="GUI version of Duplicate Image Finder"
+        BackgroundColor="transparent"
+        Square150x150Logo="Assets\Square150x150Logo.png"
+        Square44x44Logo="Assets\Square44x44Logo.png">
+        <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
+        <uap:SplashScreen Image="Assets\SplashScreen.png" />
+      </uap:VisualElements>
+    </Application>
+
+    <Application Id="DupFindCmd" Executable="DupFindCmd.exe" EntryPoint="Windows.FullTrustApplication">
+      <uap:VisualElements
+        DisplayName="DupFind CLI"
+        Description="Command line interface for DupFind"
+        BackgroundColor="transparent"
+        AppListEntry="none" 
+        Square150x150Logo="Assets\Square150x150Logo.png"
+        Square44x44Logo="Assets\Square44x44Logo.png">
+        </uap:VisualElements>
+
+      <Extensions>
+        <uap3:Extension Category="windows.appExecutionAlias">
+          <uap3:AppExecutionAlias>
+          <desktop:ExecutionAlias Alias="DupFindCmd.exe" />
+          </uap3:AppExecutionAlias>
+      </uap3:Extension>      </Extensions>
+    </Application>
+  </Applications>
+
+  <!-- ============================================== -->
+  <!-- 6. 既存のWin32APIをフルに使用するための権限  -->
+  <!-- ============================================== -->
+  <Capabilities>
+    <rescap:Capability Name="runFullTrust" />
+    <rescap:Capability Name="broadFileSystemAccess" />
+  </Capabilities>
+
+</Package>

binární
Deploy/Assets/SplashScreen.png.png


binární
Deploy/Assets/Square150x150Logo.png


binární
Deploy/Assets/Square44x44Logo.png


binární
Deploy/Assets/StoreLogo.png


binární
Deploy/Assets/Wide310x150Logo.png