forked from owent/libatbus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
52 lines (39 loc) · 2 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
cmake_minimum_required(VERSION 3.1.0)
cmake_policy(SET CMP0054 NEW)
project(libatbus)
# 准备下载依赖组件
include ("${CMAKE_CURRENT_LIST_DIR}/3rd_party/atframe_utils/libatframe_utils.prepare.cmake")
########################################################################
# CMake 模块 (递归包含模块, 带颜色输出模块, 平台检测模块)
set (PROJECT_CMAKE_MODULE_DIR "${3RD_PARTY_ATFRAME_UTILS_PKG_DIR}/project/cmake")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_CMAKE_MODULE_DIR}/modules")
include("${PROJECT_CMAKE_MODULE_DIR}/modules/IncludeDirectoryRecurse.cmake")
include("${PROJECT_CMAKE_MODULE_DIR}/modules/EchoWithColor.cmake")
include("${PROJECT_CMAKE_MODULE_DIR}/modules/FindConfigurePackage.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/project/cmake/ProjectBuildOption.cmake")
include("${PROJECT_CMAKE_MODULE_DIR}/FindPlatform.cmake")
include("${PROJECT_CMAKE_MODULE_DIR}/ProjectTools.cmake")
#####################################################################
# 导入编译器和编译选项配置
include("${PROJECT_CMAKE_MODULE_DIR}/CompilerOption.cmake")
include("${PROJECT_CMAKE_MODULE_DIR}/TargetOption.cmake")
EchoWithColor(COLOR GREEN "-- Build Type: ${CMAKE_BUILD_TYPE}")
########################################################################
# 导入项目配置
## 导入所有 macro 定义
include_macro_recurse(${CMAKE_CURRENT_LIST_DIR})
## 导入工程项目
if ( "${CMAKE_CURRENT_LIST_DIR}/3rd_party/atframe_utils/repo" STREQUAL ${3RD_PARTY_ATFRAME_UTILS_PKG_DIR})
add_subdirectory(${3RD_PARTY_ATFRAME_UTILS_PKG_DIR})
endif()
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/src")
if (PROJECT_ENABLE_SAMPLE)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/sample")
endif()
if (PROJECT_ENABLE_UNITTEST)
include ("${3RD_PARTY_ATFRAME_UTILS_PKG_DIR}/test/test.utils-macro.cmake")
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/test")
endif()
if (PROJECT_ENABLE_TOOLS)
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/tools")
endif()