mv source code into src folder
This commit is contained in:
parent
1f1de5deb6
commit
d8c137d11f
|
@ -22,98 +22,7 @@ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED)
|
||||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Quick)
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Quick)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Quick)
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Quick)
|
||||||
|
|
||||||
set(SOURCES
|
add_subdirectory(src)
|
||||||
framelesshelper_global.h
|
|
||||||
framelesshelper.h
|
|
||||||
framelesshelper.cpp
|
|
||||||
framelesswindowsmanager.h
|
|
||||||
framelesswindowsmanager.cpp
|
|
||||||
utilities.h
|
|
||||||
utilities.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
if(TARGET Qt${QT_VERSION_MAJOR}::Quick)
|
|
||||||
list(APPEND SOURCES
|
|
||||||
framelessquickhelper.h
|
|
||||||
framelessquickhelper.cpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
list(APPEND SOURCES
|
|
||||||
framelesshelper_windows.h
|
|
||||||
utilities_win32.cpp
|
|
||||||
framelesshelper_win32.h
|
|
||||||
framelesshelper_win32.cpp
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
if(APPLE)
|
|
||||||
list(APPEND SOURCES utilities_macos.mm)
|
|
||||||
else()
|
|
||||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS X11Extras REQUIRED)
|
|
||||||
list(APPEND SOURCES utilities_linux.cpp)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32 AND BUILD_SHARED_LIBS)
|
|
||||||
enable_language(RC)
|
|
||||||
list(APPEND SOURCES framelesshelper.rc)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} ${SOURCES})
|
|
||||||
add_library(wangwenx190::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
|
||||||
|
|
||||||
if(NOT BUILD_SHARED_LIBS)
|
|
||||||
target_compile_definitions(${PROJECT_NAME} PUBLIC
|
|
||||||
FRAMELESSHELPER_STATIC
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
|
||||||
QT_NO_CAST_FROM_ASCII
|
|
||||||
QT_NO_CAST_TO_ASCII
|
|
||||||
QT_NO_KEYWORDS
|
|
||||||
QT_DEPRECATED_WARNINGS
|
|
||||||
QT_DISABLE_DEPRECATED_BEFORE=0x060100
|
|
||||||
FRAMELESSHELPER_BUILD_LIBRARY
|
|
||||||
)
|
|
||||||
|
|
||||||
if(TEST_UNIX)
|
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
|
||||||
FRAMELESSHELPER_TEST_UNIX
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
|
||||||
dwmapi
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
if(APPLE)
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
|
||||||
"-framework Cocoa -framework Carbon"
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
|
||||||
Qt${QT_VERSION_MAJOR}::X11Extras
|
|
||||||
X11
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
|
||||||
Qt${QT_VERSION_MAJOR}::GuiPrivate
|
|
||||||
)
|
|
||||||
|
|
||||||
if(TARGET Qt${QT_VERSION_MAJOR}::Quick)
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
|
||||||
Qt${QT_VERSION_MAJOR}::Quick
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC
|
|
||||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(BUILD_EXAMPLES)
|
if(BUILD_EXAMPLES)
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets)
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets)
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets)
|
||||||
|
|
||||||
|
include_directories(../src)
|
||||||
|
|
||||||
if(TARGET Qt${QT_VERSION_MAJOR}::Widgets)
|
if(TARGET Qt${QT_VERSION_MAJOR}::Widgets)
|
||||||
add_subdirectory(widget)
|
add_subdirectory(widget)
|
||||||
add_subdirectory(mainwindow)
|
add_subdirectory(mainwindow)
|
||||||
|
|
|
@ -24,8 +24,7 @@
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include <QtGui/qpainter.h>
|
#include <QtGui/qpainter.h>
|
||||||
#include "../../framelesswindowsmanager.h"
|
#include "core/utilities.h"
|
||||||
#include "../../utilities.h"
|
|
||||||
|
|
||||||
FRAMELESSHELPER_USE_NAMESPACE
|
FRAMELESSHELPER_USE_NAMESPACE
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include <QtWidgets/qmainwindow.h>
|
#include <QtWidgets/qmainwindow.h>
|
||||||
#include "ui_MainWindow.h"
|
#include "ui_MainWindow.h"
|
||||||
#include "ui_TitleBar.h"
|
#include "ui_TitleBar.h"
|
||||||
#include "../../framelesshelper.h"
|
#include "core/framelesshelper.h"
|
||||||
|
|
||||||
class MainWindow : public QMainWindow
|
class MainWindow : public QMainWindow
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "flwindow.h"
|
#include "flwindow.h"
|
||||||
#include "../../framelesshelper.h"
|
#include "core/framelesshelper.h"
|
||||||
#include "../../utilities.h"
|
#include "core/utilities.h"
|
||||||
|
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include "framelesshelper.h"
|
#include "core/framelesshelper.h"
|
||||||
|
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,8 @@
|
||||||
#include <QtWidgets/qboxlayout.h>
|
#include <QtWidgets/qboxlayout.h>
|
||||||
#include <QtWidgets/qlabel.h>
|
#include <QtWidgets/qlabel.h>
|
||||||
#include <QtWidgets/qpushbutton.h>
|
#include <QtWidgets/qpushbutton.h>
|
||||||
#include "../../utilities.h"
|
#include "core/utilities.h"
|
||||||
#include "../../framelesswindowsmanager.h"
|
#include "core/framelesshelper.h"
|
||||||
#include "../../framelesshelper.h"
|
|
||||||
|
|
||||||
FRAMELESSHELPER_USE_NAMESPACE
|
FRAMELESSHELPER_USE_NAMESPACE
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtWidgets/qwidget.h>
|
#include <QtWidgets/qwidget.h>
|
||||||
#include "../../framelesshelper.h"
|
#include "core/framelesshelper.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
QT_FORWARD_DECLARE_CLASS(QLabel)
|
QT_FORWARD_DECLARE_CLASS(QLabel)
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
set(SOURCES
|
||||||
|
framelesshelper_global.h
|
||||||
|
core/framelesshelper.h
|
||||||
|
core/framelesshelper.cpp
|
||||||
|
core/utilities.h
|
||||||
|
core/utilities.cpp
|
||||||
|
core/framelesswindowsmanager.h
|
||||||
|
core/framelesswindowsmanager.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
if(TARGET Qt${QT_VERSION_MAJOR}::Quick)
|
||||||
|
list(APPEND SOURCES
|
||||||
|
quick/framelessquickhelper.h
|
||||||
|
quick/framelessquickhelper.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
list(APPEND SOURCES
|
||||||
|
core/framelesshelper_windows.h
|
||||||
|
core/utilities_win32.cpp
|
||||||
|
core/framelesshelper_win32.h
|
||||||
|
core/framelesshelper_win32.cpp
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
if(APPLE)
|
||||||
|
list(APPEND SOURCES core/utilities_macos.mm)
|
||||||
|
else()
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS X11Extras REQUIRED)
|
||||||
|
list(APPEND SOURCES core/utilities_linux.cpp)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32 AND BUILD_SHARED_LIBS)
|
||||||
|
enable_language(RC)
|
||||||
|
list(APPEND SOURCES framelesshelper.rc)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_library(${PROJECT_NAME} ${SOURCES})
|
||||||
|
add_library(wangwenx190::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
|
||||||
|
|
||||||
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PUBLIC
|
||||||
|
FRAMELESSHELPER_STATIC
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
|
QT_NO_CAST_FROM_ASCII
|
||||||
|
QT_NO_CAST_TO_ASCII
|
||||||
|
QT_NO_KEYWORDS
|
||||||
|
QT_DEPRECATED_WARNINGS
|
||||||
|
QT_DISABLE_DEPRECATED_BEFORE=0x060100
|
||||||
|
FRAMELESSHELPER_BUILD_LIBRARY
|
||||||
|
)
|
||||||
|
|
||||||
|
if(TEST_UNIX)
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
|
FRAMELESSHELPER_TEST_UNIX
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
dwmapi
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
if(APPLE)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
"-framework Cocoa -framework Carbon"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
Qt${QT_VERSION_MAJOR}::X11Extras
|
||||||
|
X11
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
Qt${QT_VERSION_MAJOR}::GuiPrivate
|
||||||
|
)
|
||||||
|
|
||||||
|
if(TARGET Qt${QT_VERSION_MAJOR}::Quick)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
Qt${QT_VERSION_MAJOR}::Quick
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PUBLIC
|
||||||
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>"
|
||||||
|
)
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "framelessquickhelper.h"
|
#include "framelessquickhelper.h"
|
||||||
#include "framelesswindowsmanager.h"
|
#include "core/framelesswindowsmanager.h"
|
||||||
#include <QtQuick/qquickwindow.h>
|
#include <QtQuick/qquickwindow.h>
|
||||||
|
|
||||||
FRAMELESSHELPER_BEGIN_NAMESPACE
|
FRAMELESSHELPER_BEGIN_NAMESPACE
|
Loading…
Reference in New Issue