下载源代码
git clone --depth=1 https://dgithub.xyz/gwaldron/osgearth -b osgearth-3.5
下载子模块
git submodule update --init
如果下载不过来,就手动修改下.git/config文件,将子模块的地址替换成加速地址
(base) yeqiang@yeqiang-Default-string:~/Downloads/src/osgearth$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://dgithub.xyz/gwaldron/osgearth
fetch = +refs/tags/osgearth-3.5:refs/tags/osgearth-3.5
[submodule "src/third_party/imgui"]
active = true
url = https://dgithub.xyz/ocornut/imgui.git
[submodule "src/third_party/lerc"]
active = true
url = https://dgithub.xyz/Esri/lerc.git
[submodule "src/third_party/rapidjson"]
active = true
url = https://dgithub.xyz/Tencent/rapidjson.git
(base) yeqiang@yeqiang-Default-string:~/下载/src/osgearth/src/third_party$ git clone https://dgithub.xyz/google/googletest.git
正克隆到 'googletest'...
remote: Enumerating objects: 27535, done.
remote: Counting objects: 100% (73/73), done.
remote: Compressing objects: 100% (46/46), done.
remote: Total 27535 (delta 29), reused 38 (delta 21), pack-reused 27462
接收对象中: 100% (27535/27535), 12.83 MiB | 325.00 KiB/s, 完成.
处理 delta 中: 100% (20438/20438), 完成.
(base) yeqiang@yeqiang-Default-string:~/下载/src/osgearth/src/third_party$ rm -r rapidjson/thirdparty/gtest
(base) yeqiang@yeqiang-Default-string:~/下载/src/osgearth/src/third_party$ mv googletest rapidjson/thirdparty/gtest
安装编译工具
sudo apt install -y cmake
sudo apt install -y libcurl4-openssl-dev
sudo apt-get install libgdal-dev
sudo apt-get install libopenscenegraph-dev
编译osgEarth
cd osgearth
mkdir build
cd build
cmake ..
make -j$(cat /proc/cpuinfo | grep processor -c)
编译出来的可执行文件