forked from antler119/system_tray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
51 lines (44 loc) · 1.47 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
cmake_minimum_required(VERSION 3.10)
set(PROJECT_NAME "system_tray")
project(${PROJECT_NAME} LANGUAGES CXX)
# This value is used when generating builds using this plugin, so it must
# not be changed
set(PLUGIN_NAME "${PROJECT_NAME}_plugin")
find_package(PkgConfig REQUIRED)
add_library(${PLUGIN_NAME} SHARED
"system_tray_plugin.cc"
"app_window.cc"
"menu_manager.cc"
"menu.cc"
"tray.cc"
"errors.cc"
)
pkg_check_modules(APPINDICATOR IMPORTED_TARGET ayatana-appindicator3-0.1)
if(APPINDICATOR_FOUND)
target_compile_definitions(${PLUGIN_NAME} PRIVATE HAVE_AYATANA)
else()
pkg_check_modules(APPINDICATOR IMPORTED_TARGET appindicator3-0.1)
endif()
if(APPINDICATOR_FOUND)
target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::APPINDICATOR)
else()
message(
FATAL_ERROR
"\n"
"The `system_tray` package requires ayatana-appindicator3-0.1 or appindicator3-0.1."
)
endif()
apply_standard_settings(${PLUGIN_NAME})
set_target_properties(${PLUGIN_NAME} PROPERTIES
CXX_VISIBILITY_PRESET hidden)
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
target_include_directories(${PLUGIN_NAME} INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter)
target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK)
target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::APPINDICATOR)
# List of absolute paths to libraries that should be bundled with the plugin
set(system_tray_bundled_libraries
""
PARENT_SCOPE
)