Files
CodeRepository/Projects/App_Toolkits/CMakeLists.txt
2026-03-02 21:40:25 +08:00

63 lines
1.8 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
cmake_minimum_required(VERSION 3.5)
project(App_ToolKits LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_PREFIX_PATH "C:/Qt/5.15.2/msvc2019_64") # Qt Kit Dir
if(MSVC)
# 对于 Visual Studio设置源文件使用 UTF-8 编码
# /utf-8 选项告诉编译器将源文件和执行字符集都视为 UTF-8
add_compile_options(/utf-8)
# 设置执行字符集为 UTF-8可选/utf-8 已包含此功能)
add_compile_definitions(_UTF8_SOURCE)
endif()
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Qt5 COMPONENTS Core Widgets Gui Sql Network SerialPort REQUIRED) # Qt COMPONENTS
link_libraries(
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Sql
Qt5::Network
Qt5::SerialPort
) # Qt5
function(clearAutoFile)
source_group("Generated Files\\UI" REGULAR_EXPRESSION "ui_.*\\.h$")
source_group("Generated Files\\UIC" REGULAR_EXPRESSION "autouic_.*\\.stamp$")
source_group("Generated Files\\MOC" REGULAR_EXPRESSION "mocs_.*\\.cpp$")
endfunction()
include_directories(
${CMAKE_SOURCE_DIR}/3rd/spdlog/include
${CMAKE_SOURCE_DIR}/3rd/asio
${CMAKE_SOURCE_DIR}/Common/MQTT
${CMAKE_SOURCE_DIR}/Common/MQTT/include
)
add_subdirectory(ToolKit_Plugins)
add_subdirectory(ToolKitFramework)
add_subdirectory(Common)