简体   繁体   中英

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).

Here are the two settings if I were working with a msvs project (instead of cmake in msvs2019):

在此处输入图像描述

The documentation for cmake on msvs2019 is pretty sparse and wish there was some kind of mapping between visual studio project settings and cmake.

This was working for me:

set_target_properties( MyProjectName 
          PROPERTIES
               VS_PLATFORM_TOOLSET v140 )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM