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

相关内容

热门资讯

伊朗官员:伊美就浓缩铀处置方式... 当地时间11日,总台记者获悉,一名伊朗官员称,伊朗与美国之间的谈判在浓缩铀的处置、暂停铀浓缩活动期限...
沈阳添新地标!超级IP“巨虎东... 万众期待,神兽归沈! 5月10日,沈阳专属超级文旅IP“巨虎东东”圆满完成交付唤醒仪式,正式启程奔赴...
虹软科技:暗光增强等算法已应用... 来源:市场投研资讯 (来源:财闻) 公司前瞻把握AI眼镜作为新一代AI交互入口的战略机遇,凭借深厚的...
全球脑机接口企业已突破800家... 从冰冷的科技设备变为有温度的生命助手 脑机接口“黄金时代”正在到来 5月10日,全国脑机接口科技与...
总面积超2000平方米,上海张... IT之家 5 月 11 日消息,据央视财经,上海张江 AI 应用商店今起正式开门迎客,从能教你弹吉他...
伊朗议长:伊武装部队已做好准备... 当地时间11日,伊朗议会议长卡利巴夫在社交平台上发布消息称,伊朗武装部队已做好准备应对任何侵略行为。...
特朗普声称考虑让委内瑞拉成为美... 据英国《独立报》5月11日报道,美国总统特朗普在接受福克斯新闻采访时表示,正认真考虑采取行动,将委内...
长沙全球研发中心城市建设成型起... 长沙全力建设全球研发中心城市,在全球创新坐标系中稳步进位。 2025年,长沙跃居全球科技集群百强榜第...
【微特稿】AI会取代哪些职业?... 【新华社微特稿】当前,人们日益担忧人工智能(AI)将影响就业市场。美国近期一项研究显示,多个人工智能...
恶意退款退货,不能仅靠“较真”... 近日,河南榴莲卖家程先生因190元订单驱车1600公里跨省维权,引发舆论关注。买家收货后以“发霉”为...