CMAKE使用

官方教程

https://cmake.org/cmake-tutorial/

http://www.jianshu.com/p/bbf68f9ddffa

http://www.cnblogs.com/coderfenghc/archive/2013/01/20/2846621.html

 

第三方教程

http://ilcsoft.desy.de/portal/e279/e346/infoboxContent560/CMake_Tutorial.pdf

http://doc.qt.io/qt-5/cmake-manual.html

 

怎样设置条件

option(DEBUG_MODE "to determine whether enable debug code." ON)

>> 方法一:首先cmake生成makefile,然后make edit_cache编辑选项;

>> 方法二:在执行cmake的时候提供参数的值,例如cmake –DDEBUG_MODE=OFF

 

--build <dir>

将Binary Tree导出到什么目录下。

 

add_subdirectory

构建一个子目录下的工程。该子目录必须包含CMakeLists.txt。可以指定SOURCE_DIR和BINARY_DIR。

posted @ 2017-03-01 14:29  lilei9110  阅读(162)  评论(0编辑  收藏  举报