diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d7c298..b962046 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,11 +29,10 @@ jobs: if: runner.os == 'Windows' run: | if (-Not (Test-Path "./vcpkg")) { - git clone https://github.com/Microsoft/vcpkg.git + git clone https://github.com/microsoft/vcpkg.git ./vcpkg/bootstrap-vcpkg.bat - ./vcpkg/vcpkg integrate install - ./vcpkg/vcpkg install osg - ./vcpkg/vcpkg install gdal + ./vcpkg/vcpkg install osg:x64-windows + ./vcpkg/vcpkg install gdal:x64-windows } else { Write-Host "vcpkg directory exists. Skipping installation." diff --git a/README.md b/README.md index 7b3ace2..345f611 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Introduction [![glTF status](https://img.shields.io/badge/glTF-2%2E0-green.svg?style=flat)](https://github.com/KhronosGroup/glTF) -[![Action status](https://github.com/fanvanzh/3dtiles/actions/workflows/rust.yml/badge.svg)](https://github.com/fanvanzh/3dtiles/actions/workflows/rust.yml) +[![Action status](https://github.com/fanvanzh/3dtiles/actions/workflows/build.yml/badge.svg)](https://github.com/fanvanzh/3dtiles/actions/workflows/build.yml) Tools for 3D-Tiles convertion. @@ -38,11 +38,19 @@ cargo build --release ``` ## Centos ``` - +yum install -y gdal-devel cargo g++ +git clone https://github.com/microsoft/vcpkg.git +./vcpkg/bootstrap-vcpkg.sh +./vcpkg/vcpkg install osg +cargo build --release ``` ## Windows ``` - +git clone https://github.com/microsoft/vcpkg.git +./vcpkg/bootstrap-vcpkg.bat +./vcpkg/vcpkg install osg:x64-windows +./vcpkg/vcpkg install gdal:x64-windows +cargo build --release ``` # Usage diff --git a/build.rs b/build.rs index e9d3463..fb17f22 100644 --- a/build.rs +++ b/build.rs @@ -13,6 +13,7 @@ fn build_win_msvc() { .define("WIN32", None) .define("_WINDOWS", None) .include("./src") + .include("./vcpkg/installed/x64-windows/include") .file("./src/tileset.cpp") .file("./src/shp23dtile.cpp") .file("./src/osgb23dtile.cpp") @@ -20,7 +21,7 @@ fn build_win_msvc() { .file("./src/GeoTransform.cpp") .compile("3dtile"); // ------------- - println!("cargo:rustc-link-search=native=./lib"); + println!("cargo:rustc-link-search=native=./vcpkg/installed/x64-windows/lib"); // ------------- println!("cargo:rustc-link-lib=gdal_i"); println!("cargo:rustc-link-lib=OpenThreads"); @@ -28,19 +29,6 @@ fn build_win_msvc() { println!("cargo:rustc-link-lib=osgDB"); println!("cargo:rustc-link-lib=osgUtil"); println!("cargo:rustc-link-lib=osgViewer"); - - Command::new("cmd") - .args(&[ - "/C", - "xcopy", - r#".\bin"#, - &format!(r#".\target\{}"#, env::var("PROFILE").unwrap()), - "/y", - "/e", - ]) - .stdout(Stdio::inherit()) - .output() - .unwrap(); } fn build_linux_unkonw() { @@ -49,6 +37,7 @@ fn build_linux_unkonw() { .flag("-std=c++11") .warnings(false) .include("./src") + .include("./vcpkg/installed/x64-linux/include") .file("./src/tileset.cpp") .file("./src/shp23dtile.cpp") .file("./src/osgb23dtile.cpp") @@ -57,6 +46,7 @@ fn build_linux_unkonw() { .compile("3dtile"); // ------------- println!("cargo:rustc-link-search=native=/usr/lib/x86_64-linux-gnu"); + println!("cargo:rustc-link-search=native=./vcpkg/installed/x64-linux/lib"); // ------------- println!("cargo:rustc-link-lib=OpenThreads"); println!("cargo:rustc-link-lib=osg");