Building osgEarth for Windows using vcpkg
admin
2023-04-06 03:03:06
0

vcpkg is an extremly useful C++ package manager. It works on Windows, Linux and MacOS but for this guide we’ll primarily focus on Windows.

First, download and bootstrap vcpkg following the instructions on the page.

Next install the dependencies required to build a fully functional osgearth

vcpkg install osg:x64-windows sqlite3:x64-windows protobuf:x64-windows poco:x64-windows

This will take awhile the first time you run it as this pulls down lots of dependencies, so go get a cup of coffee.

Once all the dependencies are built, you’ll need to actually build osgearth.

Get the source code

git clone https://github.com/gwaldron/osgearth.git

Create a directory for an out of source build

cd osgearth
mkdir build
cd build

Configure Cmake

vcpkg provides a Cmake toolchain file that helps osgEarth find all of it’s dependencies. You’ll need to specify a different build directory for Release and Debug and specify the build type using -DCMAKE_BUILD_TYPE. This is because some dependencies of osgEarth don’t pick up both debug and release versions without specifying the build type. This should be fixed in future cmake versions. This is for a release build


cmake .. -G "Visual Studio 15 2017 Win64" \
-DCMAKE_BUILD_TYPE=Release \
-DWIN32_USE_MP=ON \
-DCMAKE_TOOLCHAIN_FILE=[vcpkg root]\scripts\buildsystems\vcpkg.cmake

Build and install osgEarth

You can build and install osgEarth on the command line using cmake or you can open up the Visual Studio solution and build it from there.

cmake --build . --target INSTALL --config Release

Setting up your runtime environment

You’ll need to make sure that the vcpkg dependencies and osgEarth are in your path. So do something like this


set PATH=%PATH%;c:\vcpkg\installed\x64-windows\bin
set PATH=%PATH%;c:\vcpkg\installed\x64-windows\tools\osg
set PATH=%PATH%;c:\Program Files\osgEarth\bin

Note: If you don’t want to build osgEarth yourself for your application, you can actually install it using vcpkg as well. Just use

vcpkg install osgearth:x64-windows

相关内容

热门资讯

今日重大发现“胡一把麻将到底有... 有 亲,根据资深记者爆料胡一把麻将是可以开挂的,确实有挂(咨询软件无需打...
腾冲深部构造活动云南省野外科学... 2025年12月24日,腾冲深部构造活动云南省野外科学观测研究站获得云南省科技厅批准。 依托云南省地...
最新引进“乐山游戏中心怎么开挂... 最新引进“乐山游戏中心怎么开挂?”(果然有透视挂)您好,乐山游戏中心这个游戏其实有挂的,确实是有挂的...
微短剧精品创作分享会暨微短剧《... 来源:滚动播报 (来源:文旅中国) 12月27日,微短剧精品创作分享会暨微短剧《“发”家致富》启动仪...
今日重磅消息“微信链接牛牛真的... 网上科普关于“微信链接牛牛有没有挂”话题很是火热,小编也是针对微信链接牛牛作*弊开挂的方法以及开挂对...
【今日要闻】“决战血流麻将究竟... 网上科普关于“决战血流麻将有没有挂”话题很是火热,小编也是针对决战血流麻将作*弊开挂的方法以及开挂对...
【第一资讯】“腾威互娱究竟有挂... 【第一资讯】“腾威互娱究竟有挂吗?”(太坑了果然有挂)您好,腾威互娱这个游戏其实有挂的,确实是有挂的...
我来教教您“微竞斗地主怎么开挂... 家人们!今天小编来为大家解答微竞斗地主透视挂怎么安装这个问题咨询软件客服徽9784099的挂在哪里买...
最新引进“新众亿炸/金/花怎么... 网上科普关于“新众亿炸/金/花有没有挂”话题很是火热,小编也是针对新众亿炸/金/花作*弊开挂的方法以...
终于了解“三三麻将真的有挂吗?... 终于了解“三三麻将真的有挂吗?”(原来真的有挂)您好,三三麻将这个游戏其实有挂的,确实是有挂的,需要...