qml demo
This commit is contained in:
@@ -5,14 +5,44 @@ project(sonobulus LANGUAGES CXX)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# add_library(sonobulus_core STATIC
|
||||
# # empty
|
||||
# )
|
||||
find_package(Qt6 REQUIRED COMPONENTS
|
||||
Core
|
||||
Quick
|
||||
)
|
||||
|
||||
add_executable(sonobulus
|
||||
qt_standard_project_setup()
|
||||
|
||||
add_library(sonobulus_core STATIC
|
||||
src/TimerComponent.cpp
|
||||
)
|
||||
target_link_libraries(sonobulus_core PRIVATE
|
||||
Qt6::Core
|
||||
Qt6::Quick
|
||||
)
|
||||
|
||||
qt_add_executable(sonobulus
|
||||
src/main.cpp
|
||||
)
|
||||
|
||||
# target_link_libraries(sonobulus
|
||||
# sonobulus_core
|
||||
# )
|
||||
qt_add_qml_module(sonobulus
|
||||
URI sonobulus
|
||||
VERSION 1.0
|
||||
QML_FILES src/Main.qml
|
||||
)
|
||||
|
||||
target_link_libraries(sonobulus PRIVATE
|
||||
sonobulus_core
|
||||
Qt6::Core
|
||||
Qt6::Quick
|
||||
)
|
||||
|
||||
install(TARGETS sonobulus)
|
||||
|
||||
if (WIN32)
|
||||
add_custom_command(
|
||||
TARGET sonobulus POST_BUILD
|
||||
COMMAND powershell -c "${Qt6_DIR}/../../../bin/windeployqt6.exe --qmldir . $<TARGET_FILE:sonobulus>"
|
||||
COMMENT "windeployqt..."
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user