main
zhuzihcu 2023-04-27 14:30:10 +08:00
parent 430fac2f77
commit 7a25a48fdb
3 changed files with 9 additions and 6 deletions

2
.gitignore vendored
View File

@ -35,3 +35,5 @@ src/build-preset/plugins.qmltypes
bin bin
.DS_Store .DS_Store
build build
cmake-build-*
.idea

View File

@ -32,7 +32,7 @@ foreach(filepath ${QML_PATHS})
endforeach(filepath) endforeach(filepath)
# #
file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp) file(GLOB_RECURSE RES_PATHS *.png *.jpg *.svg *.ico *.ttf *.webp qmldir)
foreach(filepath ${RES_PATHS}) foreach(filepath ${RES_PATHS})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND resource_files ${filename}) list(APPEND resource_files ${filename})
@ -45,7 +45,7 @@ qt_add_executable(example
# #
if(WIN32) if(WIN32)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/msvc/*.dll) set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/msvc/*.dll)
else() else()
set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/mingw/*.dll) set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/mingw/*.dll)
@ -63,7 +63,7 @@ endif()
qt_add_qml_module(example qt_add_qml_module(example
URI example URI example
VERSION 1.0 VERSION 1.0
QML_FILES ${qml_files} qml/global/qmldir QML_FILES ${qml_files}
RESOURCES ${resource_files} RESOURCES ${resource_files}
) )
@ -77,8 +77,8 @@ set_target_properties(example PROPERTIES
) )
# #
target_link_libraries(example target_link_libraries(example PRIVATE
PRIVATE Qt6::Quick Qt6::Quick
) )
# #

View File

@ -2,6 +2,7 @@
project(fluentui LANGUAGES CXX) project(fluentui LANGUAGES CXX)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(CMAKE_BUILD_TYPE STREQUAL "Debug") if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/debug) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/debug)