Last active
June 25, 2018 14:57
-
-
Save FONQRI/17ca8676d7b1f9a199dc89195ff4834a to your computer and use it in GitHub Desktop.
Sample Boost Cmake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8.12) | |
project(UCCP_Server_Boost) | |
set(CMAKE_INCLUDE_CURRENT_DIR ON) | |
set(CMAKE_AUTOMOC ON) | |
include_directories(./src) | |
#seting file pathes | |
file(GLOB Headers ./src/*.h) | |
file(GLOB Cpp ./src/*.cpp) | |
#library | |
add_library(Server | |
${Headers} | |
${Cpp} | |
) | |
set (CMAKE_CXX_STANDARD 14) | |
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++14 -D__STRICT_ANSI__") | |
find_package (Threads) | |
find_package(Boost 1.58 REQUIRED COMPONENTS | |
date_time | |
filesystem | |
iostreams | |
thread) | |
if(Boost_FOUND) | |
include_directories(${Boost_INCLUDE_DIRS}) | |
add_executable(${PROJECT_NAME} "posix_main.cpp" ) | |
target_link_libraries(${PROJECT_NAME} | |
Boost::date_time | |
Boost::filesystem | |
Boost::iostreams | |
Boost::thread | |
${CMAKE_THREAD_LIBS_INIT} | |
Server | |
) | |
endif(Boost_FOUND) | |
set(Boost_USE_STATIC_LIBS ON) # only find static libs | |
set(Boost_USE_MULTITHREADED ON) | |
set(Boost_USE_STATIC_RUNTIME OFF) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment