-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
102 lines (82 loc) · 2.05 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
99
100
101
cmake_minimum_required(VERSION 3.14)
project(BgfxQQuickItemExample LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(INSTALL_EXAMPLEDIR "BgfxQQuickItemExample")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Qml)
find_package(Qt6 COMPONENTS Quick)
set(SOURCES
main.cpp
src/qquickbgfxitem/qquickbgfxitem.h
src/qquickbgfxitem/qquickbgfxitem.cpp
src/qbgfx.h
src/qbgfx.cpp
src/qquick_bgfx.h
src/qsgbgfxnode/qsgbgfxnode.h
src/qsgbgfxnode/qsgbgfxnode.cpp
)
if(APPLE)
set(SOURCES
${SOURCES}
src/qquick_bgfx.mm
)
endif()
if(WIN32)
set(SOURCES
${SOURCES}
src/qquick_bgfx.cpp
)
endif()
qt_add_executable(BgfxQQuickItemExample
${SOURCES}
)
target_link_libraries(BgfxQQuickItemExample PUBLIC
"-framework Metal"
Qt::Core
Qt::Gui
Qt::Qml
Qt::Quick
Qt::QuickPrivate
bgfx
bimg
example-common
)
target_include_directories(BgfxQQuickItemExample
PUBLIC
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/qquickbgfxitem
)
# Resources:
set(BgfxQQuickItemExample_resource_files
"main.qml"
)
qt6_add_resources(BgfxQQuickItemExample "BgfxQQuickItemExample"
PREFIX
"/BgfxQQuickItemExample"
FILES
${BgfxQQuickItemExample_resource_files}
)
if(MACOS)
target_link_libraries(BgfxQQuickItemExample PUBLIC
"-framework AppKit"
)
endif()
install(TARGETS BgfxQQuickItemExample
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(BgfxQQuickItemExample PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI QQuickBgfx
)
qt_add_qml_module(BgfxQQuickItemExample
URI QQuickBgfx
VERSION 1.0
QML_FILES main.qml
)
add_subdirectory(deps)