cmake使用(CMakeList.txt)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
#CMAKE_INCLUDE_CURRENT_DIR equal to INCLUDE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
CMAKE_INCLUDE_CURRENT_DIR
Automatically add the current source- and build directories to the include path.
If this variable is enabled, CMake automatically adds in each directory ${CMAKE_CURRENT_SOURCE_DIR} and ${CMAKE_CURRENT_BINARY_DIR} to the include path for this directory. These additional include directories do not propagate down to subdirectories. This is useful mainly for out-of-source builds, where files generated into the build tree are included by files located in the source tree.
By default CMAKE_INCLUDE_CURRENT_DIR is OFF.
--------------------------------------------------------------------------------
set(CMAKE_AUTOMOC ON)
CMAKE_AUTOMOC: This variable is used to initialize the AUTOMOC property on all the targets
AUTOMOC is a boolean specifying whether CMake will handle the Qt moc preprocessor automatically
qt中moc的作用
Qt 将源代码交给标准 C++ 编译器,如 gcc 之前,需要事先将这些扩展的语法去除掉。完成这一操作的就是 moc。
moc 全称是 Meta-Object Compiler,也就是“元对象编译器”。Qt 程序在交由标准编译器编译之前,先要使用 moc 分析 C++ 源文件。如果它发现在一个头文件中包含了宏 Q_OBJECT,则会生成另外一个 C++ 源文件。这个源文件中包含了 Q_OBJECT 宏的实现代码。这个新的文件名字将会是原文件名前面加上 moc_ 构成。这个新的文件同样将进入编译系统,最终被链接到二进制代码中去。因此我们可以知道,这个新的文件不是“替换”掉旧的文件,而是与原文件一起参与编译。另外,我们还可以看出一点,moc 的执行是在预处理器之前。因为预处理器执行之后,Q_OBJECT 宏就不存在了。
在命令行下输入moc yourfilename.h -o moc_youfilename.cpp生成不带Q_OBJENT的源文件。
cmake使用(CMakeList.txt)的更多相关文章
- ROS初级教程 cmake cmakelist.txt 的编写教程
有很多 的时候我们使用别人的程序包.然后添加东西的时候缺少什么东西,会使程序编译不过去,甚至无法运行,接下来介绍一下cmakelist.txt 的每一行的作用.为了以后添加和修改方便. 2.整体结构和 ...
- CMake 使用方法 & CMakeList.txt<转>
CMake 使用方法 & CMakeList.txt cmake 简介 CMake是一个跨平台的安装(编译)工具,可以用简单的语句来描述所有平台的安装(编译过程).他能够输出各种各样的make ...
- CMakeList.txt设置OpenCv路径
源文件imageBasics.cpp #include <iostream> #include <chrono> using namespace std; #include & ...
- 单个源文件下CmakeList.txt
单个源文件下CmakeList.txt 1. main.c代码 & CmakeLists.txt 文件内容 在任意自己选定的目录下(t1/)编写main.c 与 CmakeLists.txt ...
- CMake之CMakeLists.txt编写入门
自定义变量 主要有隐式定义和显式定义两种. 隐式定义的一个例子是PROJECT指令,它会隐式的定义< projectname >_BINARY_DIR和< projectname & ...
- CMake Intro - CMakeLists.txt
Notes: directory structure: cmake, cmake/Tutorial, cmake/Tutorial/MathLibs 1. File lists in cmake/ ...
- rhel7 编写CMakeList.txt编译运行MySQL官方例子代码
注:若需要参考rhel7上安装MySQL 请 点击此处 1.下面MySQL链接库版本用到了boost(若需要请到官网下载最新链接库和文档和C++连接数据库操作示例) Red Hat Enterpris ...
- CMake 基本用法--写CMakeList.txt
http://techbase.kde.org/Development/Tutorials/CMake_(zh_CN) http://www.cmake.org/Wiki/CMake 这一章将从软件开 ...
- CMakeList.txt(3): 一个cmake实例
介绍一个比较实用的例子,即包含生成静态库又包含引入外部头文件和链接库的cmake demo. 先按照工程规范建立工程目录,并编写代码,以下面的工程目录为例进行解释这个例子,工程的目录结构为: 1. 编 ...
随机推荐
- settings.py常规配置项
settings.py常见配置项 1. 配置Django_Admin依照中文界面显示 LANGUAGE_CODE = 'zh-hans' 2. 数据库配置(默认使用sqlite3) 使用MySQL的配 ...
- Ubuntu安装sogou拼音输入法
1.更新系统:sudo apt-get update 2.更新相关依赖 sudo apt-get install fcitx -f 2.安装fcitx:sudo apt-get install fci ...
- pyqt设计
pyqt是python设计GUI的第三方包 作为一个小白,我觉得这篇博客贼好,我就是按照这个博客写的. 这个博客一共分5步,每一步都特别详细. pyqt 打包exe时遇到的问题(我的python环境是 ...
- IDEA入门学习笔记1:资料收集
IDEA2018软件下载 :https://mp.weixin.qq.com/s?__biz=MzIwMjE1MjMyMw==&mid=2650200056&idx=1&sn= ...
- leetcode-22-string
521. Longest Uncommon Subsequence I find the longest uncommon subsequence of this group of two strin ...
- leetcode-11-dfs
DFS算法: explore(G, v) visited(v) = trueprevisit(v) for each edge(v, u) in E: if not visited(u): explo ...
- ACM训练联盟周赛 A. Teemo's bad day
65536K Today is a bad day. Teemo is scolded badly by his teacher because he didn't do his homework ...
- Setting title-center on "< h1> " element on Android does not work, fix
app.scss: h1.title-center{ text-align: center!important; }
- luogu3371 【模板】单源最短路径 dijkstra堆优化
#include <algorithm> #include <iostream> #include <cstring> #include <cstdio> ...
- JSONP分享-- 在JavaScript中跨域请求
如果你正在开发一个现代的基于web的应用程序,那么你: 在客户端使用JavaScript. 需要集成那些没有完全在你控制之下的服务(或者那些来自不同的域). 在你的浏览器控制台中遇到过这个错误信息: ...