-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
131 lines (97 loc) · 3.23 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
cmake_minimum_required(VERSION 3.0)
include(trainServer/cmake/HunterGate.cmake)
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.28.tar.gz"
SHA1 "6c79b36253a8e8bcba48927e9f3be65a3a81e6ec"
)
project(OpenHabAI)
# Include cmake modules
include(trainServer/cmake/buildHelper.cmake)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "cmake")
# ------------------------------------
# -- Project infos
# Meta information about the project
setMetaProject(
"OpenHabAI" "OPENHAB_AI" # name, name in headerfile,
"ai for openhab" # descrition
"Joshua Johannson" # author
)
# set project name and output dir
project(${META_PROJECT_NAME})
# ------------------------------------
# -- Project options
option(OPTION_TESTS "do tests." ON)
option(OPTION_BUILD_DEPS "Build dependencies." ON)
option(OPTION_USE_SEASOCKS "use seasocks lib for websocket comunication" OFF)
# -----------------------------
# -- set BUILD out dirs
setOutDir(
build # general
build # bin
build/lib # lib
build/include # include
build/lib # archiv
build/pack # package / installer / app
)
# ----------------------------
# c++ options
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
# -----------------------------
# -- set INSTALL out dirs
set(INSTALL_BIN bin)
set(INSTALL_LIB lib)
set(INSTALL_INCLUDE include)
set(INSTALL_COMPONENTS applications libraries headers)
# -----------------------------
# -- default SOURCE dirs for targets
set(SOURCE_DIR source/)
set(TEST_DIR_GLOB ${CMAKE_CURRENT_SOURCE_DIR}/test/)
set(INCLUDE_DIR include/)
# -------------------------------------------------
# -- Dependences
add_subdirectory(trainServer/dependencies)
# -- BOOST
hunter_add_package(Boost COMPONENTS filesystem program_options)
find_package(Boost CONFIG REQUIRED system filesystem program_options)
# -- GTEST
hunter_add_package(GTest)
find_package(GTest CONFIG REQUIRED)
# ------------------------
link_directories(
#lib/
${DEPENDENCIES_MXNET_DIR}
${DEPENDENCIES_UWEBSOCKETS_DIR}
)
# default headers, libs
set(DEFAULT_INCLUDE_DIRECTORIES
${DEPENDENCIES_JSON_INCLUDE}
${DEPENDENCIES_MXNET_INCLUDE}
${OUTPUT_INCLUDE}
${DEPENDENCIES_EXPRTK_INCLUDE}
${DEPENDENCIES_UWEBSOCKETS_INCLUDE}
)
set(DEFAULT_LIBRARIES
${DEPENDENCIES_TENSORFLOW_LIB}
${DEPENDENCIES_SEASOCKS_LIB}
${DEPENDENCIES_MXNET_LIB}
${DEPENDENCIES_UWEBSOCKETS_LIB}
pthread
Boost::filesystem
Boost::system
Boost::program_options
)
set(DEFAULT_DEPENDENCIES
mxnet_external
uWebSockets_external
${DEPENDENCIES_SEASOCKS_LIB_EXTERNAL}
)
set(DEFAUT_DEFINITIONS
${DEPENDENCIES_SEASOCKS_DEFINITIONS})
# --------------------------------------------------
# -- subdirs
add_subdirectory(catflow/cpp)
add_subdirectory(catflow/example)
add_subdirectory(frontend)
add_subdirectory(trainServer)