CMAKE_TOOLCHAIN_FILE

This variable is specified on the command line when cross-compiling with CMake. It is the path to a file which is read early in the CMake run and which specifies locations for compilers and toolchain utilities, and other target platform and compiler related information. 指定编译器,toolchain utilities的路径,其他目标平台和编译器的相关信息。

toolchain utilities 一套编译工具的集合

比如:make, 编译器,汇编器,链接器等等。

set 将一个CMAKE变量设置为给定值。

set(<variable> <value> [[CACHE <type> <docstring> [FORCE]] | PARENT_SCOPE])
  将变量<variable>的值设置为<value>。在<variable>被设置之前,<value>会被展开。如果有CACHE选项,那么<variable>就会添加到cache中;这时<type>和<docstring>是必需的。<type>被CMake GUI用来选择一个窗口,让用户设置值。<type>可以是下述值中的一个:

FILEPATH = 文件选择对话框。
PATH = 路径选择对话框。
STRING = 任意的字符串。
BOOL = 布尔值选择复选框。
INTERNAL = 不需要GUI输入端。(适用于永久保存的变量)。

CMAKE_BINARY_DIR

This is the full path to the top level of the current CMake build tree. For an in-source build, this would be the same as CMAKE_SOURCE_DIR.

养成喜欢进行外部编译(out-of-source build) 而不是in-source build
out-of-source build一般在源文件的顶层目录中 新建build目录
对于命令行可以 cd build

然后 cmake .. -G"MinGW Makefiles"即可

这样所有的临时文件 都会放在build目录下不会和source有任何的瓜噶。

get_filename_component

Get a specific component of a full filename.

get_filename_component(<VAR> <FileName> <COMP> [CACHE])
Set <VAR> to a component of <FileName>, where <COMP> is one of: 将var设置为filename的某一部分

DIRECTORY = Directory without file name
NAME = File name without directory
EXT = File name longest extension (.b.c from d/a.b.c)
NAME_WE = File name without directory or longest extension
ABSOLUTE = Full path to file
REALPATH = Full path to existing file with symlinks resolved
PATH = Legacy alias for DIRECTORY (use for CMake <= 2.8.11)

find_file

https://cmake.org/cmake/help/v3.4/command/find_file.html

message

Display a message to the user.

message([<mode>] "message to display" ...)
The optional <mode> keyword determines the type of message:

(none) = Important information
STATUS = Incidental information  对STATUS的信息用stdout输出,其他的用stderr数据
WARNING = CMake Warning, continue processing
AUTHOR_WARNING = CMake Warning (dev), continue processing
SEND_ERROR = CMake Error, continue processing,
but skip generation
FATAL_ERROR = CMake Error, stop processing and generation
DEPRECATION = CMake Deprecation Error or Warning if variable
CMAKE_ERROR_DEPRECATED or CMAKE_WARN_DEPRECATED
is enabled, respectively, else no message.
The CMake command-line tool displays STATUS messages on stdout and all other message types on stderr. The CMake GUI displays all messages in its log area. The interactive dialogs (ccmake and CMakeSetup) show STATUS messages one at a time on a status line and other messages in interactive pop-up boxes.

CMake Warning and Error message text displays using a simple markup language. Non-indented text is formatted in line-wrapped paragraphs delimited by newlines. Indented text is considered pre-formatted.

ncnn阅读 - CMakeLists.txt的更多相关文章

  1. px4的CMakelists.txt阅读

    ############################################################################ # # Copyright (c) PX4 D ...

  2. Cmake知识----编写CMakeLists.txt文件编译C/C++程序

    1.CMake编译原理 CMake是一种跨平台编译工具,比make更为高级,使用起来要方便得多.CMake主要是编写CMakeLists.txt文件,然后用cmake命令将CMakeLists.txt ...

  3. 阅读 CMakeLists

    新手,入门阅读 CMakeLists,希望读者能给点建议 发现两篇文章,我感觉很好~ <阅读 CMakeLists>(下面只copy此篇)文章来源:http://blog.sina.com ...

  4. CMake之CMakeLists.txt编写入门

    自定义变量 主要有隐式定义和显式定义两种. 隐式定义的一个例子是PROJECT指令,它会隐式的定义< projectname >_BINARY_DIR和< projectname & ...

  5. Ubuntu 16.04源码编译boost库 编写CMakeLists.txt | compile boost 1.66.0 from source on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/d5d4a460/,欢迎阅读! compile boost 1.66.0 from source on ubuntu 16.04 G ...

  6. [Windows篇] 在windows 10上源码编译gtest 并编写CMakeLists.txt

    本文首发于个人博客https://kezunlin.me/post/aca50ff8/,欢迎阅读! compile gtest on windows 10 Guide compile gtest on ...

  7. ubuntu 16.04上源码编译和安装cgal并编写CMakeLists.txt | compile and install cgal on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/39ab7ed9/,欢迎阅读最新内容! compile and install cgal on ubuntu 16.04 Guide ...

  8. Ubuntu 16.04上源码编译和安装pytorch教程,并编写C++ Demo CMakeLists.txt | tutorial to compile and use pytorch on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/54e7a3d8/,欢迎阅读最新内容! tutorial to compile and use pytorch on ubuntu ...

  9. Cmake知识----编写CMakeLists.txt文件编译C/C++程序(转)

    1.CMake编译原理 CMake是一种跨平台编译工具,比make更为高级,使用起来要方便得多.CMake主要是编写CMakeLists.txt文件,然后用cmake命令将CMakeLists.txt ...

随机推荐

  1. 腻子脚本polyfill

    腻子脚本 具体是指一段可以给老版本浏览器(ie9以前的版本)带来新特性的javascript脚本代码.如轻量级的脚本代码或Modernizr,Modernizr除了能让ie支持html5新元素之外,还 ...

  2. Port-knocking 简单教程

    0. "port knocking" 如字面意思,类似'敲门',只是这里敲的是'端口',而且需要按照顺序'敲'端口.如果敲击规则匹配,则可以让防火墙实时更改策略.从而达到开关防火墙 ...

  3. mysql增删

    create table msg (id int, name varchar(10)); 插入语句 insert into msg values(1,'root'); insert into msg( ...

  4. Perl6 Bailador框架(2):路径设置

    use v6; use Bailador; =begin pod get表示是get发送 post表示是post发送 get/post 后面的 '/name' 表示是路径 => sub {} 是 ...

  5. 【Python学习笔记】Coursera之PY4E学习笔记——File

    1.打开文件 使用handle=open(filename,mode)打开文件.这一函数将会返回一个handle(应该翻译为“柄”吧)用来操控文件,参数filename是一个字符串.参数mode是可选 ...

  6. ThinkPHP5 正则验证中有“|”时提示“规则错误”的解决方案

    正则规则中有“|”时,会引起解析错误: 'regex:\d{3,4}[\s,-]?\d{7,8}|1[3,4,5,8]\d[\s,-]?\d{4}[\s,-]?\d{4}' 使用数组语法可以解决: [ ...

  7. Oracle例外定义

    例外名 ORA-XXXXX SQLCODE ACCESS_INTO_NULL ORA-06530 -6530 CASE_NOT_FOUND ORA-06592 -6592 COLLECTION_IS_ ...

  8. tableView选中行的调用顺序/ 取消选中Cell

    UITableViewCell它有两个属性highLighted.selected.很明显一个是高亮状态, 一个是选中状态. UITableViewCell, 对应的2个方法 // 高亮状态调用的方法 ...

  9. vue 同页面不同参数

    项目:详情页中有一个模块为更多产品,点击也是跳转到详情页,也就是相同路由,不同参数. 试过的方法:用this.$router.push,并没有任何反应,没有任何请求,页面也未重新加载,用this.$e ...

  10. ConcurrentMap.putIfAbsent(key,value) 用法讨论

    ConcurrentMap.putIfAbsent(key,value) 用法讨论 http://wxl24life.iteye.com/blog/1746794