天天看点

cmakelist.txt文件编写

说明cmake编译的最低版本:

cmake_minimum_required(VERSION 2.8)

设置变量:set(变量名  路径)

添加头文件目录:

include_directories(${variable_1}  ${variable_2})

由源文件生成可执行文件:

add_executable(Exe file1.cpp file2.cpp)

添加链接库文件:

target_link_libraries(Exe  lib_1  lib_2)

copy a file to another location and modify its contents:

configure_file(<input> <output>
               [COPYONLY] [ESCAPE_QUOTES] [@ONLY]
               [NEWLINE_STYLE [UNIX|DOS|WIN32|LF|CRLF] ])      

继续阅读