summaryrefslogtreecommitdiff
path: root/src/fqterm/CMakeLists.txt
blob: 72f9fa71512fb4c775bf4fc5354273729a95ceea (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
set(CMAKE_AUTOMOC ON)

set(fqterm_SRCS
  fqterm_frame.h
  fqterm_screen.h
  fqterm_window.h
  fqterm_wndmgr.h
  fqterm_frame.cpp
  fqterm_screen.cpp
  fqterm_window.cpp
  fqterm_wndmgr.cpp
  fqterm_python.h
  fqterm_python.cpp
  fqterm_scriptengine.h
  fqterm_scriptengine.cpp
)

IF(IMAGE_USE_PICFLOW)
  ADD_DEFINITIONS(-DIMAGE_USE_PICFLOW)
ELSE(IMAGE_USE_PICFLOW)
ENDIF(IMAGE_USE_PICFLOW)

IF(GLOBAL_HOTKEY EQUAL 1)
IF(WIN32)
  set(global_shortcut_impl_SRCS 3rdparty/qxtglobalshortcut_win.cpp)
ELSE(WIN32)
  IF(APPLE)
    set(global_shortcut_impl_SRCS 3rdparty/qxtglobalshortcut_mac.cpp)
  ELSE(APPLE)
    set(global_shortcut_impl_SRCS 3rdparty/qxtglobalshortcut_x11.cpp)
    find_package(Qt5X11Extras REQUIRED)
    set(QXTLIB Qt5::X11Extras)
  ENDIF(APPLE)
ENDIF(WIN32)
set(GLOBAL_SHORTCUT_SRC
  ${global_shortcut_impl_SRCS}
  3rdparty/qxtglobalshortcut.cpp
  3rdparty/qxtglobalshortcut.h
  3rdparty/qxtglobalshortcut_p.h
  3rdparty/qxtglobal.h
)
ADD_DEFINITIONS(-DUSE_GLOBAL_HOTKEY)
ENDIF(GLOBAL_HOTKEY EQUAL 1)
  

set(3rdparty_SRCS
  3rdparty/dotnetstyle.cpp
  3rdparty/dotnetstyle.h
  3rdparty/uaocodec.h
  3rdparty/uaocodec.cpp
  ${GLOBAL_SHORTCUT_SRC}
)

find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Script REQUIRED)

qt5_create_translation(fqterm_qm_file
  ${fqterm_SRCS}
  ${CMAKE_SOURCE_DIR}/res/dict/fqterm_zh_CN.ts
  )

include_directories(
  ${QT_INCLUDE_DIR}
  ${QT_QTCORE_INCLUDE_DIR}
  ${QT_QTGUI_INCLUDE_DIR}
  ${QT_QTNETWORK_INCLUDE_DIR}
  ${QT_QTSCRIPT_INCLUDE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/../common
  ${CMAKE_CURRENT_SOURCE_DIR}/../protocol
  ${CMAKE_CURRENT_SOURCE_DIR}/../terminal
  ${CMAKE_CURRENT_SOURCE_DIR}/../utilities
  ${CMAKE_CURRENT_SOURCE_DIR}/../ui
  ${CMAKE_CURRENT_SOURCE_DIR}/../ui/imageviewer
  ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty
  ${CMAKE_CURRENT_BINARY_DIR}/../ui
  ${CMAKE_CURRENT_BINARY_DIR}
)

add_library(fqterm_main
  ${fqterm_SRCS}
  ${3rdparty_SRCS}
)

add_dependencies(fqterm_main
  fqterm_common
  fqterm_terminal
  fqterm_protocol
  fqterm_ui
  fqterm_utilities
)

target_link_libraries(
  fqterm_main
  Qt5::Core
  Qt5::Widgets
  Qt5::Network
  Qt5::Script
  ${QXTLIB}
  )