CMakeLists.txtファイル書き方(10):マクロ定義を明示的に実施
使用方法プレゼンテーション1(文本マクロ):
ADD_DEFINITIONS(-DDEBUG)
使用法プレゼンテーション2(定数マクロ)
ADD_DEFINITIONS(-DVERSION=1)
ADD_DEFINITIONS: Adds -D define flags to the command line of C and C++ compilers.
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.
ADD_DEFINITIONS(-DDEBUG)
使用法プレゼンテーション2(定数マクロ)
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.