forked from nemomobile/qtquickcontrols-nemo
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
58 lines (44 loc) · 1.44 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
cmake_minimum_required(VERSION 3.6.0)
project(qtquickcontrols-nemo
VERSION 6.0.0
DESCRIPTION "Nemo.Controls")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include(FeatureSummary)
include(GNUInstallDirs)
set(INSTALL_QML_IMPORT_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/qt/qml"
CACHE PATH "Custom QML import installation directory")
set(QT_MIN_VERSION "6.2.0")
set(CMAKE_INSTALL_PREFIX /usr)
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(Qt6 COMPONENTS Core Gui Qml Quick ShaderTools REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(MLITE mlite6 IMPORTED_TARGET)
pkg_check_modules(GLACIER glacierapp6 IMPORTED_TARGET)
### Sets QT_INSTALL_QML to the directory where QML Plugins should be installed
function(FindQtInstallQml)
find_program(QMAKE NAMES qmake6 qmake)
if(NOT QMAKE)
message(FATAL_ERROR "qmake not found")
endif()
execute_process(
COMMAND ${QMAKE} -query QT_INSTALL_QML
OUTPUT_VARIABLE PROC_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(QT_INSTALL_QML ${PROC_RESULT} PARENT_SCOPE)
endfunction()
FindQtInstallQml()
option(BUILD_CONTROLS "Build the controls" ON)
option(BUILD_EXAMPLES "Build the example projects" OFF)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(BUILD_CONTROLS)
add_subdirectory(src)
endif()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)