2023-02-02 14:47:56 +08:00
|
|
|
cmake_minimum_required(VERSION 3.22)
|
2023-01-31 22:17:32 +08:00
|
|
|
|
2023-02-16 23:16:50 +08:00
|
|
|
project(Notepad-- VERSION 1.22.0)
|
2023-01-31 22:17:32 +08:00
|
|
|
|
2023-02-05 13:00:22 +08:00
|
|
|
include(cmake/SparkEnvConfig.cmake)
|
|
|
|
include(cmake/SparkMacrosConfig.cmake)
|
|
|
|
include(cmake/SparkFindQt5Config.cmake)
|
|
|
|
# include(cmake/SparkFindQt6Config.cmake)
|
|
|
|
include(cmake/SparkMacrosExtendConfig.cmake)
|
2023-01-31 22:17:32 +08:00
|
|
|
|
2023-02-13 14:16:33 +08:00
|
|
|
|
|
|
|
# ----------------- 构建之前 全局定义 ----------------- #
|
|
|
|
# 在 Windows 中开启 UNICODE 以支持 TCHAR 功能
|
|
|
|
if(WIN32)
|
2023-02-14 13:36:44 +08:00
|
|
|
add_compile_definitions(_UNICODE= UNICODE=)
|
2023-02-13 14:16:33 +08:00
|
|
|
endif()
|
|
|
|
|
2023-02-08 01:49:39 +08:00
|
|
|
# ----------------- 构建 QSci 静态库 ----------------- #
|
2023-02-05 13:00:22 +08:00
|
|
|
if(TRUE)
|
2023-02-14 13:40:49 +08:00
|
|
|
include(cmake/modules/QScint.cmake)
|
2023-02-05 13:00:22 +08:00
|
|
|
endif(TRUE)
|
2023-01-31 22:17:32 +08:00
|
|
|
|
2023-02-02 18:05:54 +08:00
|
|
|
|
2023-02-08 01:49:39 +08:00
|
|
|
# ----------------- 构建 Notepad-- 程序 ----------------- #
|
2023-02-05 13:00:22 +08:00
|
|
|
if(TRUE)
|
2023-02-14 13:40:49 +08:00
|
|
|
include(cmake/modules/Notepad--.cmake)
|
2023-02-05 16:58:53 +08:00
|
|
|
endif(TRUE)
|
|
|
|
|
2023-02-08 22:50:32 +08:00
|
|
|
# ----------------- Notepad-- 其它主线构建相关 ----------------- #
|
2023-02-16 23:16:50 +08:00
|
|
|
option(USE_MACOS_UNIVERSAL "通用 MacOS 平台构建" OFF)
|
|
|
|
#
|
|
|
|
option(USE_LINUX_UNIVERSAL "通用 Linux 平台构建" OFF)
|
|
|
|
option(USE_LINUX_DEBIAN "通用 Debian Linux 平台构建" OFF)
|
|
|
|
option(USE_LINUX_APPIMGE "通用 Appimage Linux 平台构建" OFF)
|
|
|
|
#
|
|
|
|
option(USE_LINUX_UOS "独立 Linux 平台的 Uos 构建" OFF)
|
|
|
|
#
|
|
|
|
option(USE_WINDOWS_UNIVERSAL "通用 Windows 平台构建" OFF)
|
|
|
|
option(USE_WINDOWS_MINGW "通用 Windows 平台 MinGW 构建" OFF)
|
|
|
|
option(USE_WINDOWS_MSVC "通用 Windows 平台 MSVC 构建" OFF)
|
|
|
|
#
|
|
|
|
option(WINDOWS_DEPLOY_QT5 "通用 Windows Qt5 构建 windeployqt" OFF)
|
|
|
|
option(WINDOWS_DEPLOY_QT6 "通用 Windows Qt6 构建 windeployqt" OFF)
|
|
|
|
|
2023-02-08 22:50:32 +08:00
|
|
|
|
|
|
|
# 使用 macos.cmake / linux.cmake / windows.cmake 维护构建.
|
|
|
|
if(APPLE)
|
2023-02-16 23:16:50 +08:00
|
|
|
# 通用 MacOS 平台的构建(一个无具体实现的空构建)
|
|
|
|
# include(cmake/platforms/macos.cmake)
|
|
|
|
|
|
|
|
# 在 Linux 中此处将由通用构建、Debian 打包构建、Appimage 打包构建、Uos 打包构建组成
|
2023-02-08 22:50:32 +08:00
|
|
|
elseif(UNIX AND NOT APPLE AND NOT WIN32 AND NOT ANDROID)
|
2023-02-16 23:16:50 +08:00
|
|
|
|
|
|
|
# 通用 Linux 平台构建,一切的起始
|
|
|
|
if(USE_LINUX_UNIVERSAL)
|
2023-02-16 23:41:58 +08:00
|
|
|
include(cmake/platforms/linux-universal.cmake)
|
2023-02-16 23:16:50 +08:00
|
|
|
|
2023-02-16 23:41:58 +08:00
|
|
|
# 通用 Linux 平台的 Debian deb 构建
|
2023-02-16 23:16:50 +08:00
|
|
|
if(USE_LINUX_DEBIAN)
|
|
|
|
# include(cmake/platforms/linux-debian.cmake)
|
|
|
|
endif()
|
|
|
|
|
2023-02-16 23:41:58 +08:00
|
|
|
# 通用 Linux 平台的 Appimage 构建
|
2023-02-16 23:16:50 +08:00
|
|
|
if(USE_LINUX_APPIMGE)
|
|
|
|
# include(cmake/platforms/linux-appimage.cmake)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# 独立 Linux 平台的 Uos 构建
|
|
|
|
elseif(USE_LINUX_UOS)
|
|
|
|
# include(cmake/platforms/linux-uos.cmake)
|
|
|
|
|
|
|
|
# 其它 Linux 平台的构建
|
|
|
|
else()
|
|
|
|
# include(cmake/platforms/linux.cmake)
|
|
|
|
endif(USE_LINUX_UNIVERSAL)
|
|
|
|
|
|
|
|
# 在 Windows 中此处将由通用构建、MinGW 构建、MSVC 构建组成
|
2023-02-08 22:50:32 +08:00
|
|
|
elseif(WIN32)
|
2023-02-16 23:16:50 +08:00
|
|
|
|
|
|
|
# 通用 Windows 平台构建,一切的起始
|
|
|
|
if(USE_WINDOWS_UNIVERSAL)
|
|
|
|
# include(cmake/platforms/windows.cmake)
|
|
|
|
|
|
|
|
# 通用平台的 Windows MinGW 构建
|
|
|
|
if(USE_WINDOWS_MINGW)
|
|
|
|
# include(cmake/platforms/windows-mingw.cmake)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# 通用平台的 Windows MSVC 构建
|
|
|
|
if(USE_WINDOWS_MSVC)
|
|
|
|
# include(cmake/platforms/windows-msvc.cmake)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# 其它 Windows 平台的构建
|
|
|
|
else()
|
|
|
|
# include(cmake/platforms/windows.cmake)
|
|
|
|
endif(USE_WINDOWS_UNIVERSAL)
|
|
|
|
|
2023-02-08 22:50:32 +08:00
|
|
|
endif()
|
2023-02-16 23:16:50 +08:00
|
|
|
|
|
|
|
# ----------------- Notepad-- 其它主线构建相关 ----------------- #
|
|
|
|
|