forked from dashandslash/QQuickBgfx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
95 lines (79 loc) · 1.92 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
cmake_minimum_required(VERSION 3.25)
project(BgfxQQuickItemExample LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt6 COMPONENTS Quick Gui REQUIRED)
find_package(bgfx COMPONENTS REQUIRED)
qt_standard_project_setup(REQUIRES 6.5)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(INSTALL_EXAMPLEDIR "BgfxQQuickItemExample")
set(CMAKE_TOOLCHAIN_FILE "./vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
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"
Qt6::Gui
Qt6::Qml
Qt6::Quick
Qt6::QuickPrivate
bgfx::bgfx
bgfx::bimg
)
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
)