update
parent
430fac2f77
commit
7a25a48fdb
|
@ -35,3 +35,5 @@ src/build-preset/plugins.qmltypes
|
||||||
bin
|
bin
|
||||||
.DS_Store
|
.DS_Store
|
||||||
build
|
build
|
||||||
|
cmake-build-*
|
||||||
|
.idea
|
|
@ -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
|
||||||
)
|
)
|
||||||
|
|
||||||
#安装
|
#安装
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue