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

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

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

失败了

依赖库

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

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

2025.06.21检测

名称版本vcpkg名称vcpkg版本使用
curl7.79.1curl8.14.1
freetype2.9.1freetype2.13.3
ffmpeg4.2.4ffmpeg7.1.1
gdal3.3.2gdal3.11.0
geos3.5.1geos3.13.0
gsl2.1gsl2.8
gtest1.8.0gtest1.17.0
jpeg9dlibjpeg-turbo3.1.0
libpng1.6.37libpng1.6.48
osg3.6.3osg3.6.5
osgEarth2.10.1osgEarth3.7.2
proj8.1.1proj9.6.2
protobuf3.6.1/3.7.1/3.9.1protobuf5.29.3
pybind112.6.2pybind112.13.6
qt5.12.11qt55.15.16
sdl2.0.16sdl22.32.8
sqlite3.32.3sqlite33.49.2
tiff4.3.0tiff4.7.0
tinyxml27.1.0tinyxml211.0.0
yasm1.3.0yasm1.3.0#7
zlib1.2.11zlib1.3.1
zmq4.3.1/4.3.2cppzmq4.10.0

流程

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

编译

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

编译与安装

1
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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 变量
$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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# 变量
$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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# 变量
$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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# 变量
$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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 变量
$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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# 变量
$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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# 变量
$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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# 变量
$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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 变量
$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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# 变量
$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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# 变量
$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:更新所有依赖库版本
https://blog.jackeylea.com/afsim/how-to-update-all-library-version-in-afsim/
作者
JackeyLea
发布于
2025年8月1日
许可协议