forked from linuxdeepin/qt5platform-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (52 loc) · 1.58 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
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
cmake_minimum_required(VERSION 3.13)
set(DTK_VERSION
"5.6.8"
CACHE STRING "define project version"
)
project(qt5platform-plugins
VERSION ${DTK_VERSION}
DESCRIPTION "DTK platform plugin module"
HOMEPAGE_URL "https://github.com/linuxdeepin/qt5platform-plugins"
LANGUAGES CXX C
)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr)
endif ()
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
option(BUILD_TESTING "Build tests" ON)
if("${PROJECT_VERSION_MAJOR}" STREQUAL "5")
set(QT_VERSION_MAJOR "5")
elseif("${PROJECT_VERSION_MAJOR}" STREQUAL "6")
set(QT_VERSION_MAJOR "6")
set(DTK_VERSION_MAJOR "6")
else()
message(SEND_ERROR "not support Prject Version ${PROJECT_VERSION}.")
endif()
message(${PROJECT_VERSION_MAJOR})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(REQUIRED_QT_VERSION 5.15.0)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(BUILD_TESTING ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -fno-omit-frame-pointer")
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Ofast")
endif ()
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/plugins/platforms)
add_subdirectory(xcb)
if("${PROJECT_VERSION_MAJOR}" STREQUAL "5")
add_subdirectory(wayland)
endif()
if(BUILD_TESTING)
enable_testing()
add_subdirectory(tests)
endif()
message(${PROJECT_VERSION_MAJOR})