简体   繁体   English

Visual Studio cmake 目标平台和平台工具集

[英]Visual Studio cmake target platform and platform toolset

I created a cmake project through MSVS2019 and need to set Target Platform Version to 8.1 (instead of the default 10.0) and Platform Toolset to v140 (as opposed to 142).我通过 MSVS2019 创建了一个 cmake 项目,需要将 Target Platform Version 设置为 8.1(而不是默认的 10.0),将 Platform Toolset 设置为 v140(而不是 142)。

Here are the two settings if I were working with a msvs project (instead of cmake in msvs2019):如果我正在使用 msvs 项目(而不是 msvs2019 中的 cmake),这是两个设置:

在此处输入图像描述

The documentation for cmake on msvs2019 is pretty sparse and wish there was some kind of mapping between visual studio project settings and cmake. msvs2019 上关于 cmake 的文档非常少,希望在 visual studio 项目设置和 cmake 之间有某种映射。

This was working for me:这对我有用:

set_target_properties( MyProjectName 
          PROPERTIES
               VS_PLATFORM_TOOLSET v140 )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 希望使用错误的平台工具集进行构建 - Visual Studio wants to build with wrong platform toolset Visual Studio 平台工具集与 Windows SDK - Visual studio platform toolset vs Windows SDK Visual Studio Platform工具集和运行时库 - Visual Studio Platform toolset and Runtime Library 什么是 Visual Studio 项目中的“平台工具集”设置 - What is "Platform Toolset" setting in visual studio project 如何将Visual Studio 2005的平台工具集添加到较新IDE版本的“Platform Toolset”列表中? - How can I add the platform toolset of Visual Studio 2005 into the `Platform Toolset` list of the newer IDE versions? 使用Visual Studio 2012并使用较旧的平台工具集进行编译? - Use Visual Studio 2012 and compile with older platform toolset? 找不到 Visual Studio Platform 2015 工具集 ='v141' - Visual Studio Platform 2015 Toolset ='v141' cannot be found Visual Studio _MSC_VER与平台工具集 - Visual Studio _MSC_VER versus Platform Toolset Visual Studio:如何使用平台工具集作为预处理器指令? - Visual Studio: How to use platform toolset as preprocessor directive? Visual Studio 未将 WSL 列为平台工具集 - Visual Studio Doesn't List WSL as Platform Toolset
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM