-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
49 lines (39 loc) · 1.12 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
cmake_minimum_required(VERSION 3.24)
project(chapter1-basics LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
## Make the QML modules known in the subdirectory. See for more information also
## https://doc.qt.io/qtcreator/creator-qml-modules-with-plugins.html#importing-qml-modules
set(QML_IMPORT_PATH "${CMAKE_SOURCE_DIR}/qml" CACHE STRING "Additional QML import paths" FORCE)
add_subdirectory(qml/MyQuick)
qt_add_executable(${PROJECT_NAME}
main.cpp
)
set_target_properties(${PROJECT_NAME} PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
MyQuickModuleplugin
PUBLIC
Qt::Quick
Qt::Gui
Qt::Qml
Qt::Core
)
target_include_directories(${PROJECT_NAME}
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/qml/MyQuick")
qt_add_qml_module(${PROJECT_NAME}
URI Charts
VERSION 1.0
QML_FILES
ChartItem.qml
NO_RESOURCE_TARGET_PATH
DEPENDENCIES QtQuick
)
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION "bin"
BUNDLE DESTINATION "bin"
LIBRARY DESTINATION "lib"
)