CMakeLists.txt文件写法(10):显式实施宏定义

用法演示一(文本宏):

ADD_DEFINITIONS(-DDEBUG)

用法演示二(常量宏)

ADD_DEFINITIONS(-DVERSION=1)

 

 

 ADD_DEFINITIONS: Adds -D define flags to the command line of C and C++ compilers.

  ADD_DEFINITIONS(-DFOO -DBAR ...)

Adds flags to command line of C and C++ compilers. This command can be used to add any flag to a compile line, but the -D flag is accepted most C/C++ compilers. Other flags may not be as portable.

你可能感兴趣的:(CMake相关)