-
Notifications
You must be signed in to change notification settings - Fork 28
/
CMakeLists.txt
98 lines (84 loc) · 2.69 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
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
project(fqterm)
set(FQTERM_VERSION "0.9.10.1")
set(CMAKE_VERBOSE_MAKEFILE ON)
cmake_minimum_required(VERSION 3.9)
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake
)
set(CMAKE_COLOR_MAKEFILE ON)
IF (("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wno-error=deprecated-declarations")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Werror -Wno-error=deprecated-declarations")
ENDIF ()
include(GetGitRevisionDescription)
git_describe(MCGGIT_WC_REVISION)
IF(MCGGIT_WC_REVISION MATCHES "NOTFOUND")
message("Version: " ${FQTERM_VERSION})
ELSE(MCGGIT_WC_REVISION MATCHES "NOTFOUND")
message("Git revision: " ${MCGGIT_WC_REVISION})
ENDIF(MCGGIT_WC_REVISION MATCHES "NOTFOUND")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5LinguistTools REQUIRED)
qt5_add_translation(fqterm_qm_files
${CMAKE_SOURCE_DIR}/res/dict/fqterm_zh_CN.ts
${CMAKE_SOURCE_DIR}/res/dict/ui_zh_CN.ts
${CMAKE_SOURCE_DIR}/res/dict/protocol_zh_CN.ts
${CMAKE_SOURCE_DIR}/res/dict/common_zh_CN.ts
)
add_custom_target(fqterm_qm_target
DEPENDS ${fqterm_qm_files}
)
FIND_PACKAGE(PythonLibs)
if (PYTHONLIBS_FOUND)
SET(PYTHON_LIB ${PYTHON_LIBRARIES})
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
ADD_DEFINITIONS(-DFOUND_PYTHON)
else (PYTHONLIBS_FOUND)
SET(PYTHON_LIB)
endif (PYTHONLIBS_FOUND)
SET(SUB_CMAKELIST "UNKNOWN")
ADD_DEFINITIONS(-D "FQTERM_VERSION_STRING=\\\"${FQTERM_VERSION}\\\"")
# Before adding src directory, make sure all the necessary definitions
# are added
add_subdirectory(src)
set(FQTERM_LIBS
fqterm_main
fqterm_terminal
fqterm_protocol
fqterm_utilities
fqterm_ui
fqterm_imageviewer
fqterm_common
)
IF(WIN32)
IF(MINGW)
SET(SUB_CMAKELIST "CMakeLists.txt.mingw")
ELSE(MINGW)
SET(SUB_CMAKELIST "CMakeLists.txt.win32")
ENDIF(MINGW)
ELSE(WIN32)
IF(APPLE)
SET(SUB_CMAKELIST "CMakeLists.txt.macos")
ELSE(APPLE)
IF(UNIX)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD")
SET(SUB_CMAKELIST "CMakeLists.txt.linux")
ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD")
IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
SET(SUB_CMAKELIST "CMakeLists.txt.freebsd")
ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD")
ENDIF(UNIX)
ENDIF(APPLE)
ENDIF(WIN32)
IF(CMAKE_SYSTEM_NAME MATCHES "GNU")
SET(SUB_CMAKELIST "CMakeLists.txt.linux")
ENDIF(CMAKE_SYSTEM_NAME MATCHES "GNU")
IF(SUB_CMAKELIST MATCHES "UNKNOWN")
MESSAGE(FATAL_ERROR "Unsupported system type detected!")
ELSE(SUB_CMAKELIST MATCHES "UNKNOWN")
INCLUDE("${SUB_CMAKELIST}")
ENDIF(SUB_CMAKELIST MATCHES "UNKNOWN")