cmake: code simplify

Signed-off-by: Yuhang Zhao <zhaoyuhang@rankyee.com>
This commit is contained in:
Yuhang Zhao 2023-05-24 15:41:11 +08:00
parent 9376e4d6e7
commit 13e93cfed5
1 changed files with 3 additions and 8 deletions

View File

@ -61,16 +61,11 @@ find_package(Qt${QT_VERSION_MAJOR} QUIET COMPONENTS Widgets Quick)
include(cmake/utils.cmake)
query_qt_library_info(VERSION __qt_version)
if(NOT DEFINED __qt_version)
message(SEND_ERROR "Failed to query the Qt SDK version. Your toolchain is broken!")
endif()
if(NOT APPLE AND FRAMELESSHELPER_ENABLE_UNIVERSAL_BUILD)
message(WARNING "Current OS is not macOS, universal build will be disabled.")
set(FRAMELESSHELPER_ENABLE_UNIVERSAL_BUILD OFF)
elseif(APPLE AND ((__qt_version VERSION_LESS "6.2" AND __qt_version VERSION_GREATER_EQUAL "6.0") OR (__qt_version VERSION_LESS "5.15.9")))
message(WARNING "Your Qt version ${__qt_version} doesn't support universal build, it will be disabled.")
elseif(APPLE AND ((QT_VERSION VERSION_LESS "6.2" AND QT_VERSION VERSION_GREATER_EQUAL "6.0") OR (QT_VERSION VERSION_LESS "5.15.9")))
message(WARNING "Your Qt version ${QT_VERSION} doesn't support universal build, it will be disabled.")
set(FRAMELESSHELPER_ENABLE_UNIVERSAL_BUILD OFF)
endif()
@ -197,7 +192,7 @@ if(NOT FRAMELESSHELPER_NO_SUMMARY)
query_qt_paths(SDK_DIR __qt_inst_dir)
query_qt_library_info(STATIC __qt_static_lib)
message("Qt SDK installation directory: ${__qt_inst_dir}")
message("Qt SDK version: ${__qt_version}")
message("Qt SDK version: ${QT_VERSION}")
if(__qt_static_lib)
message("Qt SDK library type: static")
else()