forked from slankdev/poac
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
45 lines (39 loc) · 1.35 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required(VERSION 3.0)
project(poac)
# Preprocessor definitions
add_definitions( -DPOAC_AUTO_DEF_PROJECT_ROOT="${CMAKE_SOURCE_DIR}" )
add_definitions( -DPOAC_VERSION="0.3.0-beta" )
add_definitions( -fdiagnostics-color -Wall -Werror -Wextra )
# Check of c++17
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
if(COMPILER_SUPPORTS_CXX17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler.")
endif()
# Boost
find_package(Boost 1.62 REQUIRED COMPONENTS system filesystem timer unit_test_framework)
if (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIR})
else()
message(WARNING "The Boost was not found.")
endif()
# CURL
add_definitions(-DCURL_STATICLIB)
find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIR})
# yaml-cpp
find_package( yaml-cpp REQUIRED )
include_directories( ${YAML_CPP_INCLUDE_DIR} )
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_TIMER_LIBRARY}
${Boost_CHRONO_LIBRARY}
${CURL_LIBRARIES}
${YAML_CPP_LIBRARIES}
)
install(TARGETS poac DESTINATION bin)