diff --git a/.gitignore b/.gitignore index 6c24bd0..f0e747b 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,6 @@ CMakeLists.txt.user* src/build-preset/plugins.qmltypes bin .DS_Store -build \ No newline at end of file +build +cmake-build-* +.idea \ No newline at end of file diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 6ae28da..27348bf 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -32,7 +32,7 @@ foreach(filepath ${QML_PATHS}) 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}) string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath}) list(APPEND resource_files ${filename}) @@ -45,7 +45,7 @@ qt_add_executable(example #复制动态库到可执行文件同级目录下 if(WIN32) - if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/msvc/*.dll) else() set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/mingw/*.dll) @@ -63,7 +63,7 @@ endif() qt_add_qml_module(example URI example VERSION 1.0 - QML_FILES ${qml_files} qml/global/qmldir + QML_FILES ${qml_files} RESOURCES ${resource_files} ) @@ -77,8 +77,8 @@ set_target_properties(example PROPERTIES ) #链接库 -target_link_libraries(example - PRIVATE Qt6::Quick +target_link_libraries(example PRIVATE + Qt6::Quick ) #安装 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 84c109e..f5afa5a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,7 @@ project(fluentui LANGUAGES CXX) set(CMAKE_AUTOMOC ON) +set(CMAKE_CXX_STANDARD_REQUIRED ON) if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/debug)