- boost
- protobuf
- gflags
- glog
- cityhash
- sparsehash
- thrift
- libevent
- gperftools
- eigen
- first search package in local machine
- if not exist, download package and build
- automatically compile proto files when building
- automatically compile thrift files when building
mkdir cmake_build_tmp && cd cmake_build_tmp
cmake ..
make
./hello --logtostderr=1
-
copy
third_party
to your project -
load third dependency cmake file in your
CMakeLists.txt
# third party dependencies cmake list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/third_party) # boost find_package(Boost COMPONENTS system program_options) # cityhash find_package(Cityhash) # gflags find_package(Gflags) # glog find_package(Glog) # protobuf find_package(Protobuf)
-
proto
auto compile# compile pb include(proto/CMakeLists.txt) set_source_files_properties(${PB_SOURCES} ${PB_HEADERS} PROPERTIES GENERATED TRUE) # add pb dependency add_dependencies(your_target ${PB_TARGETS})