栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

linux知识点——CMakeLists.txt中add

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

linux知识点——CMakeLists.txt中add

参考:https://blog.csdn.net/qq_35699473/article/details/115837708

bug1: message

message,编译时打印变量的值。

-- 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/build
bug2: 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

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/997896.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号