Linux中使用boost
程序员文章站
2022-05-31 22:09:21
...
环境安装
$ sudo apt-get install libboost-all-dev
CMakeLists.txt的编写
cmake_minimum_required(VERSION 2.8)
set(APPNAME demo)
project(${APPNAME})
find_package(gflags REQUIRED)
find_package(Boost REQUIRED COMPONENTS system thread filesystem)
SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -g -Wall")
aux_source_directory(. DIRSRCS)
include_directories(${Boost_INCLUDE_DIRS})
include_directories(
./config
)
add_executable(${APPNAME}
${DIRSRCS}
)
target_link_libraries(${APPNAME} gflags libglog.a ${Boost_LIBRARIES})