forked from github_mirror/framelesshelper
cmake: minor tweaks
Fixes: #205 Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
45c1c005fe
commit
e2652fc2a9
|
@ -51,7 +51,7 @@ option(FRAMELESSHELPER_ENABLE_CFGUARD "Enable Control Flow Guard (CFG)." ON)
|
||||||
option(FRAMELESSHELPER_EXAMPLES_STANDALONE "Build the demo projects as standalone CMake projects." OFF)
|
option(FRAMELESSHELPER_EXAMPLES_STANDALONE "Build the demo projects as standalone CMake projects." OFF)
|
||||||
|
|
||||||
if(FRAMELESSHELPER_NO_BUNDLE_RESOURCE)
|
if(FRAMELESSHELPER_NO_BUNDLE_RESOURCE)
|
||||||
message(WARNING "Nothing will be embeded into FramelessHelper, the chrome buttons will have no icon.")
|
message(WARNING "Nothing will be embeded into the FramelessHelper library, the chrome buttons will have no icon.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(FRAMELESSHELPER_ENABLE_VCLTL AND NOT MSVC)
|
if(FRAMELESSHELPER_ENABLE_VCLTL AND NOT MSVC)
|
||||||
|
@ -81,6 +81,16 @@ get_commit_hash(RESULT PROJECT_VERSION_COMMIT)
|
||||||
set(PROJECT_COMPILE_DATETIME "UNKNOWN")
|
set(PROJECT_COMPILE_DATETIME "UNKNOWN")
|
||||||
string(TIMESTAMP PROJECT_COMPILE_DATETIME UTC)
|
string(TIMESTAMP PROJECT_COMPILE_DATETIME UTC)
|
||||||
|
|
||||||
|
if(MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
message(WARNING "Your current toolchain is not officially supported by FramelessHelper.\n"
|
||||||
|
"Only LLVM-MinGW (https://github.com/mstorsjo/llvm-mingw) has partial support.")
|
||||||
|
set(FRAMELESSHELPER_ENABLE_SPECTRE OFF)
|
||||||
|
set(FRAMELESSHELPER_ENABLE_EHCONTGUARD OFF)
|
||||||
|
set(FRAMELESSHELPER_ENABLE_INTELCET OFF)
|
||||||
|
set(FRAMELESSHELPER_ENABLE_INTELJCC OFF)
|
||||||
|
set(FRAMELESSHELPER_ENABLE_CFGUARD OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
if(FRAMELESSHELPER_ENABLE_VCLTL)
|
if(FRAMELESSHELPER_ENABLE_VCLTL)
|
||||||
include(cmake/VC-LTL.cmake)
|
include(cmake/VC-LTL.cmake)
|
||||||
|
@ -129,8 +139,8 @@ if(FRAMELESSHELPER_BUILD_EXAMPLES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT FRAMELESSHELPER_NO_SUMMARY)
|
if(NOT FRAMELESSHELPER_NO_SUMMARY)
|
||||||
message("--------------------------- Compiler ----------------------------")
|
message("--------------------------- Toolchain ----------------------------")
|
||||||
message("CMake version: ${CMAKE_VERSION}")
|
message("CMake version: ${CMAKE_VERSION} (${CMAKE_COMMAND})")
|
||||||
message("Host system: ${CMAKE_HOST_SYSTEM}")
|
message("Host system: ${CMAKE_HOST_SYSTEM}")
|
||||||
message("Host processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
message("Host processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||||
#message("C compiler: ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER})") # Currently we are not using any C compilers.
|
#message("C compiler: ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER})") # Currently we are not using any C compilers.
|
||||||
|
@ -139,8 +149,12 @@ if(NOT FRAMELESSHELPER_NO_SUMMARY)
|
||||||
message("C++ compiler version: ${CMAKE_CXX_COMPILER_VERSION}")
|
message("C++ compiler version: ${CMAKE_CXX_COMPILER_VERSION}")
|
||||||
message("Linker: ${CMAKE_LINKER}")
|
message("Linker: ${CMAKE_LINKER}")
|
||||||
message("Make program: ${CMAKE_MAKE_PROGRAM}")
|
message("Make program: ${CMAKE_MAKE_PROGRAM}")
|
||||||
|
message("Generator: ${CMAKE_GENERATOR}")
|
||||||
message("Build type: ${CMAKE_BUILD_TYPE}")
|
message("Build type: ${CMAKE_BUILD_TYPE}")
|
||||||
|
message("Configuration types: ${CMAKE_CONFIGURATION_TYPES}")
|
||||||
message("Install prefix: ${CMAKE_INSTALL_PREFIX}")
|
message("Install prefix: ${CMAKE_INSTALL_PREFIX}")
|
||||||
|
message("Prefix paths: ${CMAKE_PREFIX_PATH}")
|
||||||
|
message("Toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
|
||||||
message("------------------------------ Qt -------------------------------")
|
message("------------------------------ Qt -------------------------------")
|
||||||
set(__qt_inst_dir)
|
set(__qt_inst_dir)
|
||||||
if(DEFINED Qt6_DIR)
|
if(DEFINED Qt6_DIR)
|
||||||
|
@ -152,15 +166,15 @@ if(NOT FRAMELESSHELPER_NO_SUMMARY)
|
||||||
cmake_path(GET __qt_inst_dir PARENT_PATH __qt_inst_dir)
|
cmake_path(GET __qt_inst_dir PARENT_PATH __qt_inst_dir)
|
||||||
cmake_path(GET __qt_inst_dir PARENT_PATH __qt_inst_dir)
|
cmake_path(GET __qt_inst_dir PARENT_PATH __qt_inst_dir)
|
||||||
cmake_path(GET __qt_inst_dir PARENT_PATH __qt_inst_dir)
|
cmake_path(GET __qt_inst_dir PARENT_PATH __qt_inst_dir)
|
||||||
message("Qt install dir: ${__qt_inst_dir}")
|
message("Qt SDK installation directory: ${__qt_inst_dir}")
|
||||||
message("Qt version: ${QT_VERSION}")
|
message("Qt SDK version: ${QT_VERSION}")
|
||||||
get_target_property(__qt_type Qt${QT_VERSION_MAJOR}::Core TYPE)
|
get_target_property(__qt_type Qt${QT_VERSION_MAJOR}::Core TYPE)
|
||||||
if(__qt_type STREQUAL "STATIC_LIBRARY")
|
if(__qt_type STREQUAL "STATIC_LIBRARY")
|
||||||
set(__qt_type static)
|
set(__qt_type static)
|
||||||
else()
|
else()
|
||||||
set(__qt_type shared)
|
set(__qt_type shared)
|
||||||
endif()
|
endif()
|
||||||
message("Qt library type: ${__qt_type}")
|
message("Qt SDK library type: ${__qt_type}")
|
||||||
message("------------------------ FramelessHelper ------------------------")
|
message("------------------------ FramelessHelper ------------------------")
|
||||||
message("FramelessHelper version: ${PROJECT_VERSION}")
|
message("FramelessHelper version: ${PROJECT_VERSION}")
|
||||||
message("FramelessHelper commit hash: ${PROJECT_VERSION_COMMIT}")
|
message("FramelessHelper commit hash: ${PROJECT_VERSION_COMMIT}")
|
||||||
|
|
|
@ -344,12 +344,7 @@ void FramelessManagerPrivate::initialize()
|
||||||
QStyleHints * const styleHints = QGuiApplication::styleHints();
|
QStyleHints * const styleHints = QGuiApplication::styleHints();
|
||||||
Q_ASSERT(styleHints);
|
Q_ASSERT(styleHints);
|
||||||
if (styleHints) {
|
if (styleHints) {
|
||||||
#if 0 // Unreleased 6.5 change.
|
connect(styleHints, &QStyleHints::colorSchemeChanged, this, [this](const Qt::ColorScheme colorScheme){
|
||||||
connect(styleHints, &QStyleHints::colorSchemeChanged, this, [this](const Qt::ColorScheme colorScheme)
|
|
||||||
#else
|
|
||||||
connect(styleHints, &QStyleHints::appearanceChanged, this, [this](const Qt::Appearance colorScheme)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
Q_UNUSED(colorScheme);
|
Q_UNUSED(colorScheme);
|
||||||
notifySystemThemeHasChangedOrNot();
|
notifySystemThemeHasChangedOrNot();
|
||||||
});
|
});
|
||||||
|
|
|
@ -282,11 +282,7 @@ QColor Utils::calculateSystemButtonBackgroundColor(const SystemButtonType button
|
||||||
bool Utils::shouldAppsUseDarkMode()
|
bool Utils::shouldAppsUseDarkMode()
|
||||||
{
|
{
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
|
||||||
#if 0 // Unreleased 6.5 change.
|
|
||||||
return (QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark);
|
return (QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark);
|
||||||
#else
|
|
||||||
return (QGuiApplication::styleHints()->appearance() == Qt::Appearance::Dark);
|
|
||||||
#endif
|
|
||||||
#elif ((QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)) && !defined(FRAMELESSHELPER_CORE_NO_PRIVATE))
|
#elif ((QT_VERSION >= QT_VERSION_CHECK(6, 2, 1)) && !defined(FRAMELESSHELPER_CORE_NO_PRIVATE))
|
||||||
if (const QPlatformTheme * const theme = QGuiApplicationPrivate::platformTheme()) {
|
if (const QPlatformTheme * const theme = QGuiApplicationPrivate::platformTheme()) {
|
||||||
return (theme->appearance() == QPlatformTheme::Appearance::Dark);
|
return (theme->appearance() == QPlatformTheme::Appearance::Dark);
|
||||||
|
|
Loading…
Reference in New Issue