diff --git a/CMakeLists.txt b/CMakeLists.txt index 555b360..9757e9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,10 @@ if(NOT DEFINED CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() -if(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug") AND NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION) - set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) +if(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug")) + if(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) + endif() endif() if(NOT DEFINED CMAKE_DEBUG_POSTFIX) @@ -21,6 +23,23 @@ if(NOT DEFINED CMAKE_DEBUG_POSTFIX) endif() endif() +if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) +endif() + +if(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) +endif() + +if(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) +endif() + +set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(CMAKE_C_VISIBILITY_PRESET hidden) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) + set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/utilities_win32.cpp b/utilities_win32.cpp index c525ab4..38c2c2e 100644 --- a/utilities_win32.cpp +++ b/utilities_win32.cpp @@ -874,15 +874,13 @@ void Utilities::startSystemResize(QWindow *window, const Qt::Edges edges) bool Utilities::isWindowFrameBorderVisible() { static const bool result = []() -> bool { - // If we preserve the window frame border on systems before Windows 10, - // the window will look rather ugly and I guess no one would like to see - // such weired windows. If you really want to know what the window look - // like in such situations, just comment out the following IF statement - // and run your application on Windows 7/8/8.1. - if (!isWin10OrGreater()) { - return false; + if (qEnvironmentVariableIntValue("FRAMELESSHELPER_FORCE_SHOW_FRAME_BORDER") != 0) { + return true; } - return !qEnvironmentVariableIsSet("FRAMELESSHELPER_HIDE_FRAME_BORDER"); + // If we preserve the window frame border on systems prior to Windows 10, + // the window will look rather ugly and I guess no one would like to see + // such weired windows. + return (isWin10OrGreater() && !qEnvironmentVariableIsSet("FRAMELESSHELPER_HIDE_FRAME_BORDER")); }(); return result; }