Skip to content

Commit 70a12f9

Browse files
committed
try to run qt app on ipad
1 parent ffdd45f commit 70a12f9

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "IosCMakeToolchain"]
55
path = IosCMakeToolchain
66
url = https://github.com/OlivierLDff/IosCMakeToolchain
7+
[submodule "QtStaticCMake"]
8+
path = QtStaticCMake
9+
url = https://github.com/OlivierLDff/QtStaticCMake

CMakeLists.txt

+21-5
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,34 @@ find_package(Qt5 COMPONENTS Core Quick REQUIRED)
66

77
set(CMAKE_AUTORCC ON)
88

9-
add_executable(foo main.cpp qml.qrc)
9+
set(addon_SRC)
10+
IF(${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
11+
set(addon_SRC
12+
${CMAKE_CURRENT_BINARY_DIR}/foo_plugin_import.cpp
13+
${CMAKE_CURRENT_BINARY_DIR}/foo_qml_plugin_import.cpp)
14+
ENDIF()
15+
add_executable(foo main.cpp ${addon_SRC} qml.qrc)
1016

1117

1218
target_compile_definitions(foo
1319
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
1420

15-
# conflict with AddQtIosApp.cmake
16-
target_link_libraries(foo PRIVATE Qt5::Core Qt5::Quick)
1721

1822
IF(${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
19-
# set(QT_LIBRARIES Qt5::Core Qt5::Quick)
23+
set(QT_LIBRARIES Qt5::Core Qt5::Quick)
2024
include(QtIosCMake/AddQtIosApp.cmake)
21-
25+
include(QtStaticCMake/QtStaticCMake.cmake)
2226
add_qt_ios_app(foo)
27+
28+
qt_generate_plugin_import(foo
29+
OUTPUT "foo_plugin_import.cpp"
30+
VERBOSE)
31+
32+
qt_generate_qml_plugin_import(foo
33+
QML_SRC "main.qml"
34+
OUTPUT "foo_qml_plugin_import.cpp"
35+
VERBOSE)
36+
ELSE()
37+
# conflict with AddQtIosApp.cmake
38+
target_link_libraries(foo PRIVATE Qt5::Core Qt5::Quick)
2339
ENDIF()

QtStaticCMake

Submodule QtStaticCMake added at adf1286

0 commit comments

Comments
 (0)