-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
43 lines (32 loc) · 1.19 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
cmake_minimum_required(VERSION 3.28)
project(mygo-management C CXX)
set(CMAKE_CXX_STANDARD 17)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_definitions(-DIS_LINUX)
message(STATUS "Configuring on Linux")
# elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
# add_definitions(-DIS_WINDOWS)
# message(STATUS "Configuring on Windows")
else()
message(STATUS "This project is only supported on Linux systems")
return()
endif()
set(TARGET app)
set(PROJECT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
set(THIRD_PARTY_DIR ${PROJECT_ROOT}/third_party)
set(SRC_DIR ${PROJECT_ROOT}/src)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_ROOT}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_ROOT}/bin/debug)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_ROOT}/bin/release)
set(CMAKE_DEBUG_POSTFIX "_d")
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
include_directories(${THIRD_PARTY_DIR}/grpc/include)
include_directories(${THIRD_PARTY_DIR}/cJSON)
include_directories(${SRC_DIR}/thread_pool)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
enable_testing()
add_subdirectory(tests)
endif()
include(${PROJECT_ROOT}/cmake/common.cmake)
add_subdirectory(${THIRD_PARTY_DIR}/cJSON)
add_subdirectory(${SRC_DIR})