From fb4ed03530e2eb27e67573c2515dadc374d917f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Fri, 5 May 2023 18:51:40 +0800 Subject: [PATCH] update --- CMakeLists.txt | 5 ----- example/CMakeLists.txt | 23 +++++++++++------------ src/CMakeLists.txt | 19 +++++++++---------- 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3115d16..a4d0ecc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,5 @@ cmake_minimum_required(VERSION 3.16) -if(APPLE) -#配置通用编译 -set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE) -endif() - project(FluentUI VERSION 0.1 LANGUAGES CXX) add_subdirectory(src) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index f8b04fd..92ebd92 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,20 +1,13 @@ cmake_minimum_required(VERSION 3.16) -if(APPLE) -#配置通用编译 -set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE) -endif() - project(example VERSION 0.1 LANGUAGES CXX) +#配置通用编译 set(CMAKE_AUTOMOC ON) set(CMAKE_CXX_STANDARD_REQUIRED ON) - -#设置版本号 -add_definitions(-DVERSION=1,2,9,0) - -#获取文件路径分隔符(解决执行命令的时候有些平台会报错) -file(TO_CMAKE_PATH "/" PATH_SEPARATOR) +if(APPLE) + set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE) +endif() #设置可执行文件输出目录 if(CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -23,6 +16,12 @@ else() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/release) endif() +#获取文件路径分隔符(解决执行命令的时候有些平台会报错) +file(TO_CMAKE_PATH "/" PATH_SEPARATOR) + +#设置版本号 +add_definitions(-DVERSION=1,2,9,0) + find_package(Qt6 REQUIRED COMPONENTS Quick REQUIRED) #遍历所有Cpp文件 @@ -93,7 +92,7 @@ set_target_properties(example PROPERTIES #链接库 target_link_libraries(example PRIVATE - Qt6::Quick + Qt6::Quick ) #安装 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c8d169b..6ea5424 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,25 +1,24 @@ cmake_minimum_required(VERSION 3.16) -if(APPLE) -#配置通用编译 -set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE) -endif() - project(fluentui LANGUAGES CXX) +#配置通用编译 set(CMAKE_AUTOMOC ON) set(CMAKE_CXX_STANDARD_REQUIRED ON) - -#设置版本号 -add_definitions(-DVERSION=1,2,9,0) +if(APPLE) + set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE) +endif() #设置插件输出目录 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) else() - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/release) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/release) endif() +#设置版本号 +add_definitions(-DVERSION=1,2,9,0) + find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml) #遍历所有Cpp文件