-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
71 lines (59 loc) · 2.19 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
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
set(QTERM_VERSION_MAJOR 0)
set(QTERM_VERSION_MINOR 8)
set(QTERM_VERSION_RELEASE 2)
set(QTERM_VERSION "${QTERM_VERSION_MAJOR}.${QTERM_VERSION_MINOR}.${QTERM_VERSION_RELEASE}" )
project(qterm VERSION ${QTERM_VERSION} LANGUAGES CXX)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(CTest)
include(FeatureSummary)
set(CMAKE_AUTOMOC ON)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR}
COMPONENTS Gui Widgets Xml Network PrintSupport LinguistTools Help
OPTIONAL_COMPONENTS Script ScriptTools Multimedia
QUIET)
IF (${QT_VERSION_MAJOR} VERSION_EQUAL 6)
find_package(Qt6 COMPONENTS Tools Core5Compat REQUIRED)
ENDIF()
set(CMAKE_AUTOUIC TRUE)
set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/src/ui)
include(ECMQueryQt)
IF(NOT QT_BINARY_DIR)
ecm_query_qt(QT_BINARY_DIR QT_INSTALL_BINS)
ENDIF()
IF(NOT QT_LIBRARY_DIR)
ecm_query_qt(QT_LIBRARY_DIR QT_INSTALL_LIBS)
ENDIF()
IF(NOT QT_PLUGINS_DIR)
ecm_query_qt(QT_PLUGINS_DIR QT_INSTALL_PLUGINS)
ENDIF()
IF(WIN32 AND MSVC)
ADD_DEFINITIONS (/D _CRT_SECURE_NO_WARNINGS)
ENDIF(WIN32 AND MSVC)
IF(APPLE)
SET (PROGRAME QTerm)
SET (MACOSX_BUNDLE_BUNDLE_NAME ${PROGRAME})
SET (MACOSX_BUNDLE_GUI_IDENTIFIER "org.qterm")
SET (MACOSX_BUNDLE_INFO_STRING "${PROGRAME} ${QTERM_VERSION}")
SET (MACOSX_BUNDLE_BUNDLE_VERSION ${QTERM_VERSION})
SET (MACOSX_BUNDLE_LONG_VERSION_STRING ${QTERM_VERSION})
SET (MACOSX_BUNDLE_SHORT_VERSION_STRING "${QTERM_VERSION_MAJOR}.${QTERM_VERSION_MINOR}")
SET (MACOSX_BUNDLE_ICON_FILE QTerm.icns)
SET (MACOSX_BUNDLE_COPYRIGHT "The QTerm Project")
ELSE(APPLE)
SET (PROGRAME qterm)
ENDIF(APPLE)
include("package.cmake")
add_subdirectory(src)
add_subdirectory(icons)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
if (NOT TARGET uninstall)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
endif(NOT TARGET uninstall)
feature_summary(WHAT ALL)