参考:https://blog.csdn.net/qq_35699473/article/details/115837708
bug1: messagemessage,编译时打印变量的值。
-- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done ON itisON -- Configuring done -- Generating done -- Build files have been written to: /home/wuhd/wuhd/code/mydemo/add_definitions/buildbug2: option
CMake中的option用于控制编译流程,相当于C语言中的宏条件编译。
options基本格式如下:
option(" " [value])
variable:定义选项名称
help_text:说明选项的含义
value:定义选项默认状态,一般是OFF或者ON,除去ON之外,其他所有值都为认为是OFF
option(TEST_IT_CMAKE "test" ON)
这里test是注释说明的作用,TEST_IT_CMAKE这里是一个变量,定义为ON;
通过add_definitions将其转换为#define TEST_IT_CMAKE ON



