CMake Error: Could not create named generator Visual Studio 16 2019 -A Win64

前言

CMake Error: Could not create named generator Visual Studio 16 2019 -A Win64
在使用vcpkg编译OsgEarth的时候,官方给出的编译方法是:
cmake -S osgearth -B build -G “Visual Studio 15 2017 Win64” -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWIN32_USE_MP=ON -DCMAKE_INSTALL_PREFIX=[installroot] -DCMAKE_TOOLCHAIN_FILE=[vcpkgroot]\scripts\buildsystems\vcpkg.cmake
在这里插入图片描述

在这里插入图片描述
把命令:
cmake -S osgearth -B build -G “Visual Studio 15 2017 Win64” -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWIN32_USE_MP=ON -DCMAKE_INSTALL_PREFIX=[installroot] -DCMAKE_TOOLCHAIN_FILE=[vcpkgroot]\scripts\buildsystems\vcpkg.cmake

改成:
cmake -S osgearth -B build -G “Visual Studio 16 2019” -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWIN32_USE_MP=ON -DCMAKE_INSTALL_PREFIX=E:\osgEarth\vcpkg\vcpkg\build -DCMAKE_TOOLCHAIN_FILE=E:\osgEarth\vcpkg\vcpkg\scripts\buildsystems\vcpkg.cmake

也就是
(1)去掉 Win64
(2)然后把 installroot 改成你的OsgEarth生成工程路径,比如我这里是:要生成OsgEarth.sln工程的路径
在这里插入图片描述
(3)把vcpkg.cmake路径设置对
我这里是:
在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/aoxuestudy/article/details/121314811
今日推荐