AFSIM入门教程03.03:更新所有依赖库版本

系列索引:AFSIM入门教程索引

上一篇中更新了tiff库版本,本文将更新所有使用到的依赖库版本。

失败了

依赖库

首先获取哪些库被使用了。打开源码目录,搜索# Configure the 3rd_party,可以看到调用第三方库的代码。

官方提供的依赖库名称、版本;vcpkg对应名称、版本;库使用情况如下表所示。

2025.06.21检测

名称 版本 vcpkg名称 vcpkg版本 使用
curl 7.79.1 curl 8.14.1
freetype 2.9.1 freetype 2.13.3
ffmpeg 4.2.4 ffmpeg 7.1.1
gdal 3.3.2 gdal 3.11.0
geos 3.5.1 geos 3.13.0
gsl 2.1 gsl 2.8
gtest 1.8.0 gtest 1.17.0
jpeg 9d libjpeg-turbo 3.1.0
libpng 1.6.37 libpng 1.6.48
osg 3.6.3 osg 3.6.5
osgEarth 2.10.1 osgEarth 3.7.2
proj 8.1.1 proj 9.6.2
protobuf 3.6.1/3.7.1/3.9.1 protobuf 5.29.3
pybind11 2.6.2 pybind11 2.13.6
qt 5.12.11 qt5 5.15.16
sdl 2.0.16 sdl2 2.32.8
sqlite 3.32.3 sqlite3 3.49.2
tiff 4.3.0 tiff 4.7.0
tinyxml2 7.1.0 tinyxml2 11.0.0
yasm 1.3.0 yasm 1.3.0#7
zlib 1.2.11 zlib 1.3.1
zmq 4.3.1/4.3.2 cppzmq 4.10.0

流程

  • 使用vcpkg+vs2022编译依赖库
  • 使用脚本整理和打包依赖库
  • 使用新版本依赖库替换官方源码中旧版本依赖库
  • 修改源码中依赖库版本
  • 编译源码

编译

为了简化编译过程,Windows下使用vcpkg工具,基于VS2022编译。

编译与安装

bash 复制代码
vcpkg install tiff[cxx] tinyxml2 sqlite3 sdl2 proj geos gdal gtest:x64-windows-static-md ffmpeg osg osgearth qt5-base qt5-winextras

整理、压缩

使用vcpkg编译软件依赖库后,使用脚本根据依赖库的结构进行整理、打包,批量操作ps脚本如下:

ffmpeg

Linux限定

gdal

ps1 复制代码
# 变量
$vcpkgRoot = "C:\vcpkg"
$outputRoot = "D:\"
$archiveFile = "gdal-3.11.1-x64-vs2022"
$fmt = ".tar.gz"

# 清理已有文件
if(Test-Path $outputRoot$archiveFile){
    Remove-Item $outputRoot$archiveFile -Recurse -Force
    Remove-Item $outputRoot$archiveFile$fmt -Force
}

# 创建目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile -Force | Out-Null

# 复制debug文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\gdald.dll -Destination $outputRoot$archiveFile\debug -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\gdald.lib -Destination $outputRoot$archiveFile\debug -Force

# 复制release文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\gdal.dll -Destination $outputRoot$archiveFile\release -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\gdal.lib -Destination $outputRoot$archiveFile\release -Force

# 复制头文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\cpl*.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\gdal*.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\memdataset.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\ogr*.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\ogrsf_frmts.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\spatialite.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\vrtdataset.h -Destination $outputRoot$archiveFile\include -Force

# 复制授权文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\license -Force | Out-Null

# 压缩文件
if(Get-Command tar -ErrorAction SilentlyContinue){
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
    
    Set-Location $outputRoot$archiveFile
    tar -cvzf $outputRoot$archiveFile$fmt debug release license include
    
    Write-Host "已创建压缩包: $outputRoot$archiveFile$fmt"
}
else {
    Write-Error "未找到tar命令,请确保:"
    Write-Error "1. Windows版本 >= 1709 (Windows 10 Fall Creators Update)"
    Write-Error "2. 在'程序和功能'中启用了'Tar'功能"
    exit 1
}

geos

ps1 复制代码
# 变量
$vcpkgRoot = "C:\vcpkg"
$outputRoot = "D:\"
$archiveFile = "geos-3.13.1-x64-vs2022"
$fmt = ".tar.gz"

# 清理已有文件
if(Test-Path $outputRoot$archiveFile){
    Remove-Item $outputRoot$archiveFile -Recurse -Force
    Remove-Item $outputRoot$archiveFile$fmt -Force
}

# 创建目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile -Force | Out-Null

# 复制debug文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\geos.dll -Destination $outputRoot$archiveFile\debug\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\geos_c.dll -Destination $outputRoot$archiveFile\debug\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\geos.lib -Destination $outputRoot$archiveFile\debug\lib -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\geos_c.lib -Destination $outputRoot$archiveFile\debug\lib -Force

# 复制release文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\geos.dll -Destination $outputRoot$archiveFile\release\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\geos_c.dll -Destination $outputRoot$archiveFile\release\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\geos.lib -Destination $outputRoot$archiveFile\release\lib -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\geos_c.lib -Destination $outputRoot$archiveFile\release\lib -Force

# 复制头文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\geos.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\geos_c.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\geos -Destination $outputRoot$archiveFile\include -Force -Recurse

# 复制授权文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\license -Force | Out-Null

# 压缩文件
if(Get-Command tar -ErrorAction SilentlyContinue){
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
    
    Set-Location $outputRoot$archiveFile
    tar -cvzf $outputRoot$archiveFile$fmt debug release license include
    
    Write-Host "已创建压缩包: $outputRoot$archiveFile$fmt"
}
else {
    Write-Error "未找到tar命令,请确保:"
    Write-Error "1. Windows版本 >= 1709 (Windows 10 Fall Creators Update)"
    Write-Error "2. 在'程序和功能'中启用了'Tar'功能"
    exit 1
}

gtest

ps1 复制代码
# 变量
$vcpkgRoot = "C:\vcpkg"
$outputRoot = "D:\"
$archiveFile = "gtest-1.17.0-x64-vs2022"
$fmt = ".tar.gz"

# 清理已有文件
if(Test-Path $outputRoot$archiveFile){
    Remove-Item $outputRoot$archiveFile -Recurse -Force
    Remove-Item $outputRoot$archiveFile$fmt -Force
}

# 创建目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile -Force | Out-Null

# 复制debug文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\gmock.dll -Destination $outputRoot$archiveFile\debug\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\gmock_main.dll -Destination $outputRoot$archiveFile\debug\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\gtest.dll -Destination $outputRoot$archiveFile\debug\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\gtest_main.dll -Destination $outputRoot$archiveFile\debug\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\gmock.lib -Destination $outputRoot$archiveFile\debug\lib -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\gtest.lib -Destination $outputRoot$archiveFile\debug\lib -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib\pkgconfig -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\pkgconfig\gmock.pc -Destination $outputRoot$archiveFile\debug\lib\pkgconfig -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\pkgconfig\gmock_main.pc -Destination $outputRoot$archiveFile\debug\lib\pkgconfig -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\pkgconfig\gtest.pc -Destination $outputRoot$archiveFile\debug\lib\pkgconfig -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\pkgconfig\gtest_main.pc -Destination $outputRoot$archiveFile\debug\lib\pkgconfig -Force
# 复制release文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\gmock.dll -Destination $outputRoot$archiveFile\release\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\gmock_main.dll -Destination $outputRoot$archiveFile\release\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\gtest.dll -Destination $outputRoot$archiveFile\release\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\gtest_main.dll -Destination $outputRoot$archiveFile\release\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\gmock.lib -Destination $outputRoot$archiveFile\release\lib -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\gtest.lib -Destination $outputRoot$archiveFile\release\lib -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib\pkgconfig -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\pkgconfig\gmock.pc -Destination $outputRoot$archiveFile\release\lib\pkgconfig -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\pkgconfig\gmock_main.pc -Destination $outputRoot$archiveFile\release\lib\pkgconfig -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\pkgconfig\gtest.pc -Destination $outputRoot$archiveFile\release\lib\pkgconfig -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\pkgconfig\gtest_main.pc -Destination $outputRoot$archiveFile\release\lib\pkgconfig -Force

# 复制头文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\gmock -Destination $outputRoot$archiveFile\include -Force -Recurse
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\gtest -Destination $outputRoot$archiveFile\include -Force -Recurse

# 压缩文件
if(Get-Command tar -ErrorAction SilentlyContinue){
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
    
    Set-Location $outputRoot$archiveFile
    tar -cvzf $outputRoot$archiveFile$fmt debug release include
    
    Write-Host "已创建压缩包: $outputRoot$archiveFile$fmt"
}
else {
    Write-Error "未找到tar命令,请确保:"
    Write-Error "1. Windows版本 >= 1709 (Windows 10 Fall Creators Update)"
    Write-Error "2. 在'程序和功能'中启用了'Tar'功能"
    exit 1
}

osg

ps1 复制代码
# 变量
$vcpkgRoot = "C:\vcpkg"
$outputRoot = "D:\"
$archiveFile = "osg-3.6.5-x64-vs2022"
$fmt = ".tar.gz"

# 清理已有文件
if(Test-Path $outputRoot$archiveFile){
    Remove-Item $outputRoot$archiveFile -Recurse -Force
    Remove-Item $outputRoot$archiveFile$fmt -Force
}

# 创建目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile -Force | Out-Null

# 复制debug文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\osg*.dll -Destination $outputRoot$archiveFile\debug\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\OpenThreadsd.dll -Destination $outputRoot$archiveFile\debug\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\plugins\osgPlugins-3.6.5\*.dll -Destination $outputRoot$archiveFile\debug\bin -Force -Recurse

# 复制release文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\osg*.dll -Destination $outputRoot$archiveFile\release\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\OpenThreads.dll -Destination $outputRoot$archiveFile\release\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\plugins\osgPlugins-3.6.5\*.dll -Destination $outputRoot$archiveFile\release\bin -Force -Recurse

# 复制头文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\OpenThreads -Destination $outputRoot$archiveFile\include -Force -Recurse
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\osg* -Destination $outputRoot$archiveFile\include -Force -Recurse

# 复制授权文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\license -Force | Out-Null

# 压缩文件
if(Get-Command tar -ErrorAction SilentlyContinue){
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
    
    Set-Location $outputRoot$archiveFile
    tar -cvzf $outputRoot$archiveFile$fmt debug release license include
    
    Write-Host "已创建压缩包: $outputRoot$archiveFile$fmt"
}
else {
    Write-Error "未找到tar命令,请确保:"
    Write-Error "1. Windows版本 >= 1709 (Windows 10 Fall Creators Update)"
    Write-Error "2. 在'程序和功能'中启用了'Tar'功能"
    exit 1
}

osgearth

ps1 复制代码
# 变量
$vcpkgRoot = "C:\vcpkg"
$outputRoot = "D:\"
$archiveFile = "osgEarth-3.7.2-x64-vs2022"
$fmt = ".tar.gz"

# 清理已有文件
if(Test-Path $outputRoot$archiveFile){
    Remove-Item $outputRoot$archiveFile -Recurse -Force
    Remove-Item $outputRoot$archiveFile$fmt -Force
}

# 创建目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile -Force | Out-Null

# 复制debug文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\osgEarth*.dll -Destination $outputRoot$archiveFile\debug\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\plugins\osgPlugins-3.6.5\*.dll -Destination $outputRoot$archiveFile\debug\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\osgEarth*.dll -Destination $outputRoot$archiveFile\debug\lib -Force

# 复制release文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\osgEarth*.dll -Destination $outputRoot$archiveFile\release\bin -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\plugins\osgPlugins-3.6.5\*.dll -Destination $outputRoot$archiveFile\release\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\osgEarth*.dll -Destination $outputRoot$archiveFile\release\lib -Force

# 复制头文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\osgEarth* -Destination $outputRoot$archiveFile\include -Force -Recurse

# 复制授权文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\license -Force | Out-Null

# 压缩文件
if(Get-Command tar -ErrorAction SilentlyContinue){
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
    
    Set-Location $outputRoot$archiveFile
    tar -cvzf $outputRoot$archiveFile$fmt debug release license include
    
    Write-Host "已创建压缩包: $outputRoot$archiveFile$fmt"
}
else {
    Write-Error "未找到tar命令,请确保:"
    Write-Error "1. Windows版本 >= 1709 (Windows 10 Fall Creators Update)"
    Write-Error "2. 在'程序和功能'中启用了'Tar'功能"
    exit 1
}

proj

ps1 复制代码
# 变量
$vcpkgRoot = "C:\vcpkg"
$outputRoot = "D:\"
$archiveFile = "proj-9.6.2-x64-vs2022"
$fmt = ".tar.gz"

# 清理已有文件
if(Test-Path $outputRoot$archiveFile){
    Remove-Item $outputRoot$archiveFile -Recurse -Force
    Remove-Item $outputRoot$archiveFile$fmt -Force
}

# 创建目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile -Force | Out-Null

# 复制debug文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\proj_9_d.dll -Destination $outputRoot$archiveFile\debug\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\proj_d.lib -Destination $outputRoot$archiveFile\debug\lib -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib\cmake -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib\cmake\proj -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj4-targets.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj4-targets-debug.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj-config.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj-config-version.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj-targets.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj-targets-debug.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib\cmake\proj4 -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj4-targets.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj4 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj4-targets-debug.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj4 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj4-config.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj4-config-version.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj4 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj-targets.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj4 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj-targets-debug.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\proj4 -Force

# 复制release文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\proj_9.dll -Destination $outputRoot$archiveFile\release\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\proj.lib -Destination $outputRoot$archiveFile\release\lib -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib\cmake -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib\cmake\proj -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj4-targets.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj4-targets-release.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj-config.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj-config-version.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj-targets.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj\proj-targets-release.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib\cmake\proj4 -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj4-targets.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj4 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj4-targets-release.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj4 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj4-config.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj4-config-version.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj4 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj-targets.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj4 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\proj4\proj-targets-release.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\proj4 -Force

# 复制头文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\geodesic.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\proj.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\proj_constants.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\proj_experimental.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\proj -Destination $outputRoot$archiveFile\include -Force -Recurse

# 复制授权文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\license -Force | Out-Null

# 复制参考手册文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\share -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\share\man -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\share\man\man1 -Force | Out-Null

# 压缩文件
if(Get-Command tar -ErrorAction SilentlyContinue){
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
    
    Set-Location $outputRoot$archiveFile
    tar -cvzf $outputRoot$archiveFile$fmt debug release share license include
    
    Write-Host "已创建压缩包: $outputRoot$archiveFile$fmt"
}
else {
    Write-Error "未找到tar命令,请确保:"
    Write-Error "1. Windows版本 >= 1709 (Windows 10 Fall Creators Update)"
    Write-Error "2. 在'程序和功能'中启用了'Tar'功能"
    exit 1
}

qt

ps1 复制代码
# 变量
$vcpkgRoot = "C:\vcpkg"
$outputRoot = "D:\"
$archiveFile = "qt-5.15.16-x64-vs2022"
$fmt = ".tar.gz"

# 清理已有文件
if(Test-Path $outputRoot$archiveFile){
    Remove-Item $outputRoot$archiveFile -Recurse -Force
    Remove-Item $outputRoot$archiveFile$fmt -Force
}

# 创建目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile -Force | Out-Null

# bin
New-Item -ItemType Directory -Path $outputRoot$archiveFile\bin -Force | Out-Null
Copy-Item $vcpkgRoot\installed\x64-windows\bin\Qt5*.dll $outputRoot$archiveFile\bin -Force -Recurse | Out-Null
Copy-Item $vcpkgRoot\installed\x64-windows\debug\bin\Qt5*.dll $outputRoot$archiveFile\bin -Force -Recurse | Out-Null

# doc
New-Item -ItemType Directory -Path $outputRoot$archiveFile\doc -Force | Out-Null

# include
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include -Force | Out-Null
Copy-Item $vcpkgRoot\installed\x64-windows\include\qt5 $outputRoot$archiveFile\include -Force -Recurse | Out-Null

# lib
New-Item -ItemType Directory -Path $outputRoot$archiveFile\lib -Force | Out-Null
Copy-Item $vcpkgRoot\installed\x64-windows\lib\Qt5*.lib $outputRoot$archiveFile\lib -Force -Recurse | Out-Null
Copy-Item $vcpkgRoot\installed\x64-windows\lib\Qt5*.prl $outputRoot$archiveFile\lib -Force -Recurse | Out-Null
Copy-Item $vcpkgRoot\installed\x64-windows\debug\lib\Qt5*.lib $outputRoot$archiveFile\lib -Force -Recurse | Out-Null
Copy-Item $vcpkgRoot\installed\x64-windows\debug\lib\Qt5*.prl $outputRoot$archiveFile\lib -Force -Recurse | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\lib\cmake -Force | Out-Null
Copy-Item $vcpkgRoot\installed\x64-windows\share\cmake $outputRoot$archiveFile\lib -Force -Recurse | Out-Null

# license
New-Item -ItemType Directory -Path $outputRoot$archiveFile\license -Force | Out-Null

# mkspecs
New-Item -ItemType Directory -Path $outputRoot$archiveFile\mkspecs -Force | Out-Null

# phrasebooks
New-Item -ItemType Directory -Path $outputRoot$archiveFile\phrasebooks -Force | Out-Null

# plugins
New-Item -ItemType Directory -Path $outputRoot$archiveFile\plugins -Force | Out-Null
Copy-Item $vcpkgRoot\installed\x64-windows\plugins\*.dll $outputRoot$archiveFile\plugins -Force -Recurse | Out-Null
Copy-Item $vcpkgRoot\installed\x64-windows\debug\plugins\*.dll $outputRoot$archiveFile\plugins -Force -Recurse | Out-Null

# translations
New-Item -ItemType Directory -Path $outputRoot$archiveFile\translations -Force | Out-Null

# tools
New-Item -ItemType Directory -Path $outputRoot$archiveFile\tools -Force | Out-Null
Copy-Item $vcpkgRoot\installed\x64-windows\tools\qt5 $outputRoot$archiveFile\tools -Force -Recurse | Out-Null

# 压缩文件
if(Get-Command tar -ErrorAction SilentlyContinue){
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
    
    Set-Location $outputRoot$archiveFile
    tar -cvzf $outputRoot$archiveFile$fmt bin doc include lib license mkspecs phrasebooks plugins translations tools
    
    Write-Host "已创建压缩包: $outputRoot$archiveFile$fmt"
}
else {
    Write-Error "未找到tar命令,请确保:"
    Write-Error "1. Windows版本 >= 1709 (Windows 10 Fall Creators Update)"
    Write-Error "2. 在'程序和功能'中启用了'Tar'功能"
    exit 1
}

sdl

ps1 复制代码
# 变量
$vcpkgRoot = "C:\vcpkg"
$outputRoot = "D:\"
$archiveFile = "sdl-2.32.8-x64-vs2022"
$fmt = ".tar.gz"

# 清理已有文件
if(Test-Path $outputRoot$archiveFile){
    Remove-Item $outputRoot$archiveFile -Recurse -Force
    Remove-Item $outputRoot$archiveFile$fmt -Force
}

# 创建目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile -Force | Out-Null

# cmake目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile\cmake -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\sdl2\SDL2Config.cmake -Destination $outputRoot$archiveFile\cmake -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\sdl2\SDL2ConfigVersion.cmake -Destination $outputRoot$archiveFile\cmake -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\sdl2\SDL2Targets.cmake -Destination $outputRoot$archiveFile\cmake -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\sdl2\SDL2Targets-debug.cmake -Destination $outputRoot$archiveFile\cmake -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\sdl2\SDL2Targets-release.cmake -Destination $outputRoot$archiveFile\cmake -Force

# 复制debug文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\SDL2d.dll -Destination $outputRoot$archiveFile\debug\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\SDL2d.lib -Destination $outputRoot$archiveFile\debug\lib -Force

# 复制release文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\SDL2.dll -Destination $outputRoot$archiveFile\release\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\SDL2.lib -Destination $outputRoot$archiveFile\release\lib -Force

# 复制头文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include\SDL2 -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\SDL2 -Destination $outputRoot$archiveFile\include -Force -Recurse

# 复制授权文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\license -Force | Out-Null
$copyParams = @{
    Path = "$vcpkgRoot\installed\x64-windows\licenses\SDL2\LICENSE.txt"
    Destination = "$outputRoot$archiveFile\license\sdl-2.32.8.txt"
}
Copy-Item @copyParams

# 压缩文件
if(Get-Command tar -ErrorAction SilentlyContinue){
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
    
    Set-Location $outputRoot$archiveFile
    tar -cvzf $outputRoot$archiveFile$fmt cmake debug release license include
    
    Write-Host "已创建压缩包: $outputRoot$archiveFile$fmt"
}
else {
    Write-Error "未找到tar命令,请确保:"
    Write-Error "1. Windows版本 >= 1709 (Windows 10 Fall Creators Update)"
    Write-Error "2. 在'程序和功能'中启用了'Tar'功能"
    exit 1
}

sqlite3

ps1 复制代码
# 变量
$vcpkgRoot = "C:\vcpkg"
$outputRoot = "D:\"
$archiveFile = "sqlite-3.50.2-x64-vs2022"
$fmt = ".tar.gz"

# 清理已有文件
if(Test-Path $outputRoot$archiveFile){
    Remove-Item $outputRoot$archiveFile -Recurse -Force
    Remove-Item $outputRoot$archiveFile$fmt -Force
}

# 创建目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile -Force | Out-Null

# 复制debug文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\sqlite3.dll -Destination $outputRoot$archiveFile\debug -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\sqlite3.lib -Destination $outputRoot$archiveFile\debug -Force

# 复制release文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\sqlite3.dll -Destination $outputRoot$archiveFile\release -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\sqlite3.lib -Destination $outputRoot$archiveFile\release -Force

# 复制头文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\sqlite3.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\sqlite3ext.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\sqlite3-vcpkg-config.h -Destination $outputRoot$archiveFile\include -Force

# 复制授权文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\license -Force | Out-Null

# 压缩文件
if(Get-Command tar -ErrorAction SilentlyContinue){
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
    
    Set-Location $outputRoot$archiveFile
    tar -cvzf $outputRoot$archiveFile$fmt debug release license include
    
    Write-Host "已创建压缩包: $outputRoot$archiveFile$fmt"
}
else {
    Write-Error "未找到tar命令,请确保:"
    Write-Error "1. Windows版本 >= 1709 (Windows 10 Fall Creators Update)"
    Write-Error "2. 在'程序和功能'中启用了'Tar'功能"
    exit 1
}

tiff

ps1 复制代码
# 变量
$vcpkgRoot = "C:\vcpkg"
$outputRoot = "D:\"
$archiveFile = "tiff-4.7.0-x64-vs2022"
$fmt = ".tar.gz"

# 清理已有文件
if(Test-Path $outputRoot$archiveFile){
    Remove-Item $outputRoot$archiveFile -Recurse -Force
    Remove-Item $outputRoot$archiveFile$fmt -Force
}

# 创建目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile -Force | Out-Null

# 复制debug文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\bin\tiffd.dll -Destination $outputRoot$archiveFile\debug\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\tiffd.lib -Destination $outputRoot$archiveFile\debug\lib -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib\pkgconfig -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\pkgconfig/libtiff-4.pc -Destination $outputRoot$archiveFile\debug\lib\pkgconfig -Force

# 复制release文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\tiff.dll -Destination $outputRoot$archiveFile\release\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\tiff.lib -Destination $outputRoot$archiveFile\release\lib -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib\pkgconfig -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\pkgconfig/libtiff-4.pc -Destination $outputRoot$archiveFile\release\lib\pkgconfig -Force

# 复制头文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\tiff.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\tiffconf.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\tiffio.h -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\tiffio.hxx -Destination $outputRoot$archiveFile\include -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\tiffvers.h -Destination $outputRoot$archiveFile\include -Force

# 复制授权文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\license -Force | Out-Null

# 复制参考手册文件
New-Item -ItemType Directory -Path $outputRoot$archiveFile\share -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\share\man -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\share\man\man1 -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\share\man\man3 -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\share\doc -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\share\doc\tiff -Force | Out-Null

# 压缩文件
if(Get-Command tar -ErrorAction SilentlyContinue){
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
    
    Set-Location $outputRoot$archiveFile
    tar -cvzf $outputRoot$archiveFile$fmt debug release share license include
    
    Write-Host "已创建压缩包: $outputRoot$archiveFile$fmt"
}
else {
    Write-Error "未找到tar命令,请确保:"
    Write-Error "1. Windows版本 >= 1709 (Windows 10 Fall Creators Update)"
    Write-Error "2. 在'程序和功能'中启用了'Tar'功能"
    exit 1
}

tinyxml2

ps1 复制代码
# 变量
$vcpkgRoot = "C:\vcpkg"
$outputRoot = "D:\"
$archiveFile = "tinyxml2-11.0.0-x64-vs2022"
$fmt = ".tar.gz"

# 清理已有文件
if(Test-Path $outputRoot$archiveFile){
    Remove-Item $outputRoot$archiveFile -Recurse -Force
    Remove-Item $outputRoot$archiveFile$fmt -Force
}

# 创建目录
New-Item -ItemType Directory -Path $outputRoot$archiveFile -Force | Out-Null

# debug
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\bin -Force | Out-Null
$copyParams = @{
    Path = "$vcpkgRoot\installed\x64-windows\debug\bin\tinyxml2.dll"
    Destination = "$outputRoot$archiveFile\debug\bin\tinyxml2d.dll"
}
Copy-Item @copyParams
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\tinyxml2.lib -Destination $outputRoot$archiveFile\debug\lib\tinyxml2d.lib -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib\cmake -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib\cmake\tinyxml2 -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\tinyxml2\tinyxml2-config.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\tinyxml2 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\tinyxml2\tinyxml2-config-version.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\tinyxml2 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\tinyxml2\tinyxml2-shared-targets.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\tinyxml2 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\tinyxml2\tinyxml2-shared-targets-debug.cmake -Destination $outputRoot$archiveFile\debug\lib\cmake\tinyxml2 -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\debug\lib\pkgconfig -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\debug\lib\pkgconfig\tinyxml2.pc -Destination $outputRoot$archiveFile\debug\lib\pkgconfig -Force

# release
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\bin -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\bin\tinyxml2.dll -Destination $outputRoot$archiveFile\release\bin -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\tinyxml2.lib -Destination $outputRoot$archiveFile\release\lib -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib\cmake -Force | Out-Null
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib\cmake\tinyxml2 -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\tinyxml2\tinyxml2-config.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\tinyxml2 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\tinyxml2\tinyxml2-config-version.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\tinyxml2 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\tinyxml2\tinyxml2-shared-targets.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\tinyxml2 -Force
Copy-Item -Path $vcpkgRoot\installed\x64-windows\share\tinyxml2\tinyxml2-shared-targets-release.cmake -Destination $outputRoot$archiveFile\release\lib\cmake\tinyxml2 -Force
New-Item -ItemType Directory -Path $outputRoot$archiveFile\release\lib\pkgconfig -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\lib\pkgconfig\tinyxml2.pc -Destination $outputRoot$archiveFile\release\lib\pkgconfig -Force

# include
New-Item -ItemType Directory -Path $outputRoot$archiveFile\include -Force | Out-Null
Copy-Item -Path $vcpkgRoot\installed\x64-windows\include\tinyxml2.h -Destination $outputRoot$archiveFile\include -Force

# 压缩文件
if(Get-Command tar -ErrorAction SilentlyContinue){
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
    
    Set-Location $outputRoot$archiveFile
    tar -cvzf $outputRoot$archiveFile$fmt debug release include
    
    Write-Host "已创建压缩包: $outputRoot$archiveFile$fmt"
}
else {
    Write-Error "未找到tar命令,请确保:"
    Write-Error "1. Windows版本 >= 1709 (Windows 10 Fall Creators Update)"
    Write-Error "2. 在'程序和功能'中启用了'Tar'功能"
    exit 1
}

使用脚本自动打包,vcpkg库版本更新后可以快速更新。同时可以作为Linux下依赖库更新的参考。

替换

将压缩包文件复制到源码对应位置,如果名称相同就替换。

修改源码

更新源码中各个依赖库的版本字符串。

  • 各目录中的CMakeLists.txt文件中的SWDEV_XXX_PACKAGE对应版本。
  • swdev/src/tools/3rd_parth-cmake/目录下的文件名版本。

编译

按照AFSIM入门教程03.01:Windows下编译中的步骤,编译源码。

编译时解决编译过程中出现的所有问题。

我这里遇到一个大问题,osgEarth的API变化很大,而我又是刚接触,不敢更新API接口。编译到此结束,等我熟悉了以后再继续。

尽量不要更新官方依赖库版本。

本文首发于:AFSIM入门教程03.03:更新所有依赖库版本

相关推荐
AA陈超20 分钟前
虚幻引擎5 GAS开发俯视角RPG游戏 P04-12 可缩放浮点数的曲线表
c++·游戏·ue5·游戏引擎·虚幻
旭意29 分钟前
C++微基础备战蓝桥杯之数组篇10.1
开发语言·c++·蓝桥杯
青草地溪水旁2 小时前
VSCode C/C++ 构建任务配置文件 `tasks.json` 全字段深度解析
c语言·c++·vscode
扶尔魔ocy2 小时前
【QT常用技术讲解】opencv实现摄像头图像检测并裁剪物体
开发语言·qt·opencv
爱和冰阔落4 小时前
C++模板进阶 非类型模板参数 模板的特化 分离编译的深入探索
c++·面试·编译原理·模板
ajassi20009 小时前
开源 C++ QT QML 开发(二)工程结构
linux·qt·qml
charlie11451419110 小时前
精读C++20设计模式:行为型设计模式:中介者模式
c++·学习·设计模式·c++20·中介者模式
楼田莉子10 小时前
Qt开发学习——QtCreator深度介绍/程序运行/开发规范/对象树
开发语言·前端·c++·qt·学习
oioihoii10 小时前
超越 std::unique_ptr:探讨自定义删除器的真正力量
c++
Gohldg11 小时前
C++算法·贪心例题讲解
c++·数学·算法·贪心算法