Skip to content

Commit f800971

Browse files
committed
vcpkg
1 parent d3962d6 commit f800971

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

.github/workflows/build.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ jobs:
2929
if: runner.os == 'Windows'
3030
run: |
3131
if (-Not (Test-Path "./vcpkg")) {
32-
git clone https://github.com/Microsoft/vcpkg.git
32+
git clone https://github.com/microsoft/vcpkg.git
3333
./vcpkg/bootstrap-vcpkg.bat
34-
./vcpkg/vcpkg integrate install
35-
./vcpkg/vcpkg install osg
36-
./vcpkg/vcpkg install gdal
34+
./vcpkg/vcpkg install osg:x64-windows
35+
./vcpkg/vcpkg install gdal:x64-windows
3736
}
3837
else {
3938
Write-Host "vcpkg directory exists. Skipping installation."

README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Introduction
44

55
[![glTF status](https://img.shields.io/badge/glTF-2%2E0-green.svg?style=flat)](https://github.com/KhronosGroup/glTF)
6-
[![Action status](https://github.com/fanvanzh/3dtiles/actions/workflows/rust.yml/badge.svg)](https://github.com/fanvanzh/3dtiles/actions/workflows/rust.yml)
6+
[![Action status](https://github.com/fanvanzh/3dtiles/actions/workflows/build.yml/badge.svg)](https://github.com/fanvanzh/3dtiles/actions/workflows/build.yml)
77

88
Tools for 3D-Tiles convertion.
99

@@ -38,11 +38,19 @@ cargo build --release
3838
```
3939
## Centos
4040
```
41-
41+
yum install -y gdal-devel cargo g++
42+
git clone https://github.com/microsoft/vcpkg.git
43+
./vcpkg/bootstrap-vcpkg.sh
44+
./vcpkg/vcpkg install osg
45+
cargo build --release
4246
```
4347
## Windows
4448
```
45-
49+
git clone https://github.com/microsoft/vcpkg.git
50+
./vcpkg/bootstrap-vcpkg.bat
51+
./vcpkg/vcpkg install osg:x64-windows
52+
./vcpkg/vcpkg install gdal:x64-windows
53+
cargo build --release
4654
```
4755
# Usage
4856

build.rs

+4-14
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,22 @@ fn build_win_msvc() {
1313
.define("WIN32", None)
1414
.define("_WINDOWS", None)
1515
.include("./src")
16+
.include("./vcpkg/installed/x64-windows/include")
1617
.file("./src/tileset.cpp")
1718
.file("./src/shp23dtile.cpp")
1819
.file("./src/osgb23dtile.cpp")
1920
.file("./src/dxt_img.cpp")
2021
.file("./src/GeoTransform.cpp")
2122
.compile("3dtile");
2223
// -------------
23-
println!("cargo:rustc-link-search=native=./lib");
24+
println!("cargo:rustc-link-search=native=./vcpkg/installed/x64-windows/lib");
2425
// -------------
2526
println!("cargo:rustc-link-lib=gdal_i");
2627
println!("cargo:rustc-link-lib=OpenThreads");
2728
println!("cargo:rustc-link-lib=osg");
2829
println!("cargo:rustc-link-lib=osgDB");
2930
println!("cargo:rustc-link-lib=osgUtil");
3031
println!("cargo:rustc-link-lib=osgViewer");
31-
32-
Command::new("cmd")
33-
.args(&[
34-
"/C",
35-
"xcopy",
36-
r#".\bin"#,
37-
&format!(r#".\target\{}"#, env::var("PROFILE").unwrap()),
38-
"/y",
39-
"/e",
40-
])
41-
.stdout(Stdio::inherit())
42-
.output()
43-
.unwrap();
4432
}
4533

4634
fn build_linux_unkonw() {
@@ -49,6 +37,7 @@ fn build_linux_unkonw() {
4937
.flag("-std=c++11")
5038
.warnings(false)
5139
.include("./src")
40+
.include("./vcpkg/installed/x64-linux/include")
5241
.file("./src/tileset.cpp")
5342
.file("./src/shp23dtile.cpp")
5443
.file("./src/osgb23dtile.cpp")
@@ -57,6 +46,7 @@ fn build_linux_unkonw() {
5746
.compile("3dtile");
5847
// -------------
5948
println!("cargo:rustc-link-search=native=/usr/lib/x86_64-linux-gnu");
49+
println!("cargo:rustc-link-search=native=./vcpkg/installed/x64-linux/lib");
6050
// -------------
6151
println!("cargo:rustc-link-lib=OpenThreads");
6252
println!("cargo:rustc-link-lib=osg");

0 commit comments

Comments
 (0)