编译动态库的模板
add_library
生成可执行程序换成add_executable
不需要调试信息的去掉 -g
不需要警告信息的去掉 -Wall
这应该是 -W all的组合
cmake_minimum_required(VERSION 2.5)
project(mytest)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11 -fPIC -Wall")
aux_source_directory(. src_files)
add_library(mymuduo SHARED ${src_files})
标签:CMakeLists,set,library,add,txt,模板
From: https://www.cnblogs.com/lxzbky/p/17142684.html