forked from linuxdeepin/deepin-system-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (49 loc) · 1.68 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
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
if (NOT DEFINED VERSION)
set(VERSION 5.9.1000)
endif()
project(deepin_system_monitor_proj)
option(DOTEST "option for test" OFF)
# 是否开启单元测试编译
#set(DOTEST ON)
include(GNUInstallDirs)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr)
endif ()
#compile flags
if (CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wextra")
# Enable Qt builtin debug mode
add_definitions("-DQT_MESSAGELOGCONTEXT")
add_definitions("-DQT_NO_WARNING_OUTPUT")
else()
# -Wl, -O2 Enable linker optimizations
# -Wl, --gc-sections Remove unused code resulting from -fdsta-sections and
# -ffunction-sections
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O2 -Wl,--gc-sections")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O2 -Wl,--gc-sections")
endif()
#判断龙芯架构
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips64")
SET(IS_LOONGARCH_TYPE 1)
elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "__longarch64")
SET(NOT_LOONGARCH_TYPE )
else()
SET(IS_LOONGARCH_TYPE 0)
endif()
#系统监视器主应用
ADD_SUBDIRECTORY(deepin-system-monitor-main)
#系统监视器插件
ADD_SUBDIRECTORY(deepin-system-monitor-plugin)
#系统监视器插件弹出应用
ADD_SUBDIRECTORY(deepin-system-monitor-plugin-popup)
#系统监视器安全等级保护守护应用
ADD_SUBDIRECTORY(deepin-system-monitor-daemon)
#系统监视器提示
ADD_SUBDIRECTORY(deepin-system-monitor-server)
#单元测试
if(DOTEST)
ADD_SUBDIRECTORY(tests)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h)