forked from linuxdeepin/dde-network-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
63 lines (51 loc) · 1.98 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
cmake_minimum_required(VERSION 3.7)
set(VERSION "2.0.18" CACHE STRING "define project version")
project(dde-network-core
VERSION ${VERSION}
DESCRIPTION "DDE Network Core"
HOMEPAGE_URL "https://github.com/linuxdeepin/dde-network-core"
LANGUAGES CXX C
)
# 增加安全编译参数
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-all")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z relro -z now -z noexecstack -pie")
option(ENABLE_DEEPIN_NMQT "enable nmqt patch on deepin" OFF)
set(DDE-Network-Core_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/src-old")
set(DDE-Network-Core_LIBRARIES dde-network-core)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LibNM REQUIRED IMPORTED_TARGET libnm)
include_directories(${LibNM_INCLUDE_DIRS})
pkg_check_modules(Gio REQUIRED gio-2.0)
include_directories(${Gio_INCLUDE_DIRS})
pkg_search_module(GLIB REQUIRED glib-2.0)
include_directories(${GLIB_INCLUDE_DIRS})
link_directories(${GLIB_LIBRARY_DIRS})
if (QT_DEBUG)
message(" KF5_QT_INCLUDE_DIRS : " ${KF5_QT_INCLUDE_DIRS})
message(" GLIB_INCLUDE_DIRS :" ${GLIB_INCLUDE_DIRS})
message(" CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR})
message(STATUS ${result})
endif()
if (ENABLE_DEEPIN_NMQT)
add_definitions(-DUSE_DEEPIN_NMQT)
endif()
message(STATUS DEEPIN_NMQT_TEST ": ${DEEPIN_NMQT_TEST}")
set(INTERFACE_VERSION "2.0")
add_definitions(-DINTERFACE_VERSION="${INTERFACE_VERSION}")
message("Interface Version: " ${INTERFACE_VERSION})
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/usr")
endif()
include(GNUInstallDirs)
add_subdirectory("src")
add_subdirectory("src-old")
add_subdirectory("dcc-network-plugin")
add_subdirectory("dcc-network")
add_subdirectory("tests")
add_subdirectory("example")
#add_subdirectory("dock-network-plugin")
add_subdirectory("dss-network-plugin")
add_subdirectory("dss_example")
#add_subdirectory("dock-example")
add_subdirectory("network-service-plugin")