Skip to content

Commit

Permalink
第三方库改为submoule管理,添加qwindowskit库
Browse files Browse the repository at this point in the history
  • Loading branch information
czyt1988 committed Jan 3, 2024
1 parent 31d91f6 commit fdc4b33
Show file tree
Hide file tree
Showing 194 changed files with 172 additions and 27,628 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/SARibbonBar/3rdparty/qwindowkit"]
path = src/SARibbonBar/3rdparty/qwindowkit
url = https://github.com/stdware/qwindowkit
31 changes: 19 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

cmake_minimum_required(VERSION 3.5)

set(SARIBBON_VERSION_MAJOR 1)
set(SARIBBON_VERSION_MINOR 1)
set(SARIBBON_VERSION_PATCH 2)
set(SARIBBON_VERSION_MAJOR 2)
set(SARIBBON_VERSION_MINOR 0)
set(SARIBBON_VERSION_PATCH 0)
set(SARIBBON_VERSION "${SARIBBON_VERSION_MAJOR}.${SARIBBON_VERSION_MINOR}.${SARIBBON_VERSION_PATCH}")
message(STATUS "SARibbon v${SARIBBON_VERSION}")
project(SARibbon VERSION ${SARIBBON_VERSION} LANGUAGES CXX)

# option(BUILD_SHARED_LIBS "build the SARibbonBar in shared lib mode" ON)
option(SARIBBON_BUILD_EXAMPLES "build the examples" ON)
# frameless能提供windows的窗口特效,如边缘吸附,且对高分屏多屏幕的支持更好
option(SARIBBON_USE_FRAMELESS_LIB "use frameless lib" OFF)
# frameless能提供windows的窗口特效,如边缘吸附,且对高分屏多屏幕的支持更好,默认开启
option(SARIBBON_USE_FRAMELESS_LIB "use frameless lib" ON)

# load Qt library, minimum version required is 5.8
# cn:Qt库加载,最低版本要求为5.8
Expand Down Expand Up @@ -88,18 +89,13 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4819")
endif()

message(STATUS "SARibbon ${SARIBBON_VERSION}")

# 平台判断
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(SARIBBON_PLATFORM "x86")
else()
set(SARIBBON_PLATFORM "x64")
endif()



include(cmake/WinResource.cmake)

# The bin file directory is one level above the current directory
# cn:bin文件目录在当前目录的上上一级
set(SARIBBON_BIN_NAME bin_qt${QT_VERSION}_${CMAKE_BUILD_TYPE}_${SARIBBON_PLATFORM})
Expand All @@ -110,8 +106,19 @@ if(WIN32)
set(CMAKE_INSTALL_PREFIX "${SARIBBON_BIN_DIR}")
endif()

##################################
# subdirectory
##################################

if(SARIBBON_USE_FRAMELESS_LIB)
if(NOT DEFINED QWindowKit_DIR)
message(WARNING "option SARIBBON_USE_FRAMELESS_LIB=ON,but QWindowKit_DIR not defined,will set QWindowKit_DIR=${SARIBBON_BIN_DIR}/cmake/QWindowKit")
set(QWindowKit_DIR ${SARIBBON_BIN_DIR}/lib/cmake/QWindowKit)
endif()
endif()

include(cmake/WinResource.cmake)
add_subdirectory(src)
add_subdirectory(cmake)

##################################
# install
Expand Down
18 changes: 0 additions & 18 deletions cmake/CMakeLists.txt

This file was deleted.

16 changes: 16 additions & 0 deletions cmake/SARibbonUtils.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
macro(saribbon_set_bin_name _var)
set(DA_MIN_QT_VERSION 5.14)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
########################################################
# 平台判断
########################################################
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(_platform_name "x86")
else()
set(_platform_name "x64")
endif()
########################################################
# 安装路径设置
########################################################
set(_var bin_qt${QT_VERSION}_${CMAKE_BUILD_TYPE}_${_platform_name})
endmacro(damacro_set_bin_name)
4 changes: 0 additions & 4 deletions cmake/project-config-version.cmake.in

This file was deleted.

30 changes: 0 additions & 30 deletions cmake/project-config.cmake.in

This file was deleted.

49 changes: 49 additions & 0 deletions src/SARibbonBar/3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

# Cmake的命令不区分打下写,例如message,set等命令;但Cmake的变量区分大小写
# 为统一风格,本项目的Cmake命令全部采用小写,变量全部采用大写加下划线组合。

cmake_minimum_required(VERSION 3.5)
project(SARibbon-3rdparty-build
LANGUAGES CXX
DESCRIPTION "SARibbon : 3rdparty build"
)

########################################################
# 安装路径设置
########################################################
# load Qt library, minimum version required is 5.12
# cn:Qt库加载,最低版本要求为5.12
set(SARIBBON_MIN_QT_VERSION 5.12)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} ${SARIBBON_MIN_QT_VERSION} COMPONENTS
Core
Gui
Widgets
REQUIRED
)
# 平台判断
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(SARIBBON_PLATFORM "x86")
else()
set(SARIBBON_PLATFORM "x64")
endif()
# The bin file directory is one level above the current directory
# cn:bin文件目录在当前目录的上上一级
set(SARIBBON_BIN_NAME bin_qt${QT_VERSION}_${CMAKE_BUILD_TYPE}_${SARIBBON_PLATFORM})
set(SARIBBON_BIN_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../${SARIBBON_BIN_NAME})
# windows系统下,默认直接安装到当前文件夹下
if(WIN32)
set(CMAKE_INSTALL_PREFIX "${SARIBBON_BIN_DIR}")
endif()
########################################################
# 第三方库参数设置
########################################################
#
set(QWINDOWKIT_BUILD_WIDGETS ON)
set(QWINDOWKIT_BUILD_EXAMPLES OFF)
set(QWINDOWKIT_BUILD_QUICK OFF)
set(QWINDOWKIT_INSTALL ON)
########################################################
# 安装第三方库
########################################################
add_subdirectory(qwindowkit)
Loading

0 comments on commit fdc4b33

Please sign in to comment.