cmakeLists.txt编写
1.cmake的最低版本设定
cmake_minimum_required(VERSION 2.8)
2.项目名
project(test)
3.生成文件类型设置
add_executable(demo demo.cpp) # 生成可执行文件
add_library(common STATIC util.cpp) # 生成静态库
add_library(common SHARED util.cpp) # 生成动态库或共享库
其中也包含要编译的文件
一个简单的CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
set(projectname "demo")
project(${projectname})
aux_source_directory(. SRC_LIST)
add_executable(${projectname} ${SRC_LIST})

