Setting a preprocessor-defined value in Visual Studio Engineering with CMake

Source: Internet
Author: User

Preprocessing values are indispensable when building vs engineering, such as the export configuration of dynamic libraries. When building vs engineering through CMake, you can define it through the cmake command, which says three applications.

character set: The default reload vs project is a multibyte character set, and if you need to use the Unicode character set, you can set it with the following command:

Add_definitions (-dunicode-d_unicode)

Dynamic Library Export : Lib_dll to custom variable names


MFC's use : if you call MFC's functions in your project, you need to configure MFC in a dynamic library or use MFC in a static library, you can use commands:

Add_definitions (-d_afc_dll)

The use of the add_definitions command needs to be pre-defined plus-D to indicate that multiple definitions can be defined in a single command or separately, and the commands are distinguished by spaces

Setting a preprocessor-defined value in Visual Studio Engineering with CMake

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.