-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
51 lines (47 loc) · 1.86 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
project(SearchYa CXX)
cmake_minimum_required(VERSION 3.0)
set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_COLOR_MAKEFILE ON)
set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fPIC)
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "Default build type 'Debug'")
set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "" FORCE )
else()
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
endif()
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
list(APPEND CMAKE_PREFIX_PATH ${EXTERNAL_PROJECT_DIR})
if(3RD_PARTY_INSTALL_STEP)
find_package(Redis REQUIRED)
find_package(HIRedis REQUIRED)
find_package(SpdLog REQUIRED)
find_package(ProtoBuf REQUIRED)
find_package(Grpc REQUIRED)
find_package(Mesos REQUIRED)
find_package(Grpcc REQUIRED)
find_package(Cppkin REQUIRED)
include(installThirdParty)
add_custom_target(PROTO_BUILD COMMAND ${PROJECT_DIR}/Communication/IDL/BuildProto.bash ${PROJECT_DIR}/Communication)
endif()
if(COMPILATION_STEP)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_DIR}/bin)
set(CMAKE_BINARY_DIR ${PROJECT_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_DIR}/bin)
set(PROJECT_3RD_LOC ${CMAKE_CURRENT_SOURCE_DIR}/Third_Party)
set(MESOS_3RD_PARTY ${PROJECT_3RD_LOC}/src/Mesos/build/3rdparty)
#Pre build step
set(CORE_NO_3RD_PARTY True)
set(CORE_NO_GLOBAL_HANDLING True)
add_subdirectory(${PROJECT_DIR}/Core)
add_subdirectory(${PROJECT_DIR}/Communication)
add_subdirectory(${PROJECT_DIR}/ClusterManager)
add_subdirectory(${PROJECT_DIR}/RedisSearchModule)
add_subdirectory(${PROJECT_DIR}/IndexBuilder)
endif()