-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
63 lines (48 loc) · 1.63 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
cmake_minimum_required(VERSION 3.0)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.15.33.tar.gz"
SHA1 "7849ccc2607964afd5fc8b48130473a133665670"
# LOCAL # <----- Use local config.cmake
)
project(sms_gate)
# project version
set(VERSION_MAJOR 0)
set(VERSION_MINOR 2)
set(VERSION_PATCH 0)
set(BIN_DIR ${PROJECT_SOURCE_DIR}/build)
set(SRC_DIR ${PROJECT_SOURCE_DIR}/src)
set(EXT_DIR ${PROJECT_SOURCE_DIR}/external)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${BIN_DIR}")
# set c++11 compiler flags
# add_definitions(-std=c++11) - for all files, error for mongoose.c -std=c++11 not allowed with C/ObjC
set (CMAKE_CXX_STANDARD 11)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# location of additional cmake modules
#set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# get git hash
include("cmake/git_revision.cmake")
# configure header file
configure_file(
${PROJECT_SOURCE_DIR}/cmake/config.h.in
${SRC_DIR}/config.h
)
hunter_add_package(Boost COMPONENTS program_options)
find_package(Boost 1.60 CONFIG REQUIRED COMPONENTS program_options)
include_directories(${Boost_INCLUDE_DIRS})
hunter_add_package(fmt)
find_package(fmt CONFIG REQUIRED)
hunter_add_package(spdlog)
find_package(spdlog CONFIG REQUIRED)
# header only
include_directories(${EXT_DIR}/mongoose)
add_subdirectory(${SRC_DIR})
include_directories(${SRC_DIR})
add_subdirectory(${PROJECT_SOURCE_DIR}/tests)
# target to update git submodules
add_custom_target(
update_submodules
COMMAND git submodule init
COMMAND git submodule update
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)