2023-04-09 13:35:35 +08:00
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2024-02-17 09:47:17 +08:00
|
|
|
|
# ------------------------------------------------------------
|
|
|
|
|
# 此为新月杀的项目组织文件,采用CMake+QT
|
|
|
|
|
# 2022-01-24 新建文件夹 2023-02-21 发布v0.0.1版本
|
|
|
|
|
# ------------------------------------------------------------
|
2023-04-09 13:35:35 +08:00
|
|
|
|
|
2022-04-03 21:49:25 +08:00
|
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2022-01-24 10:23:08 +08:00
|
|
|
|
|
2024-10-22 00:10:53 +08:00
|
|
|
|
project(FreeKill VERSION 0.4.20)
|
2023-03-08 12:14:02 +08:00
|
|
|
|
add_definitions(-DFK_VERSION=\"${CMAKE_PROJECT_VERSION}\")
|
2022-01-24 10:23:08 +08:00
|
|
|
|
|
2022-09-14 13:01:10 +08:00
|
|
|
|
find_package(Qt6 REQUIRED COMPONENTS
|
2022-04-30 15:27:56 +08:00
|
|
|
|
Network
|
2022-01-24 10:23:08 +08:00
|
|
|
|
)
|
|
|
|
|
|
2023-03-08 12:14:02 +08:00
|
|
|
|
if (NOT DEFINED FK_SERVER_ONLY)
|
|
|
|
|
find_package(Qt6 REQUIRED COMPONENTS
|
|
|
|
|
Gui
|
|
|
|
|
Qml
|
|
|
|
|
Widgets
|
|
|
|
|
Multimedia
|
|
|
|
|
QuickControls2
|
|
|
|
|
LinguistTools
|
|
|
|
|
)
|
|
|
|
|
else ()
|
|
|
|
|
add_definitions(-DFK_SERVER_ONLY)
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-12-18 12:52:52 +08:00
|
|
|
|
find_package(OpenSSL)
|
2022-01-24 10:23:08 +08:00
|
|
|
|
find_package(Lua)
|
2022-03-24 21:23:42 +08:00
|
|
|
|
find_package(SQLite3)
|
2022-01-24 10:23:08 +08:00
|
|
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
2024-04-19 20:53:19 +08:00
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2022-01-24 10:23:08 +08:00
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
2023-03-08 12:14:02 +08:00
|
|
|
|
set(REQUIRED_QT_VERSION "6.4")
|
2022-01-24 10:23:08 +08:00
|
|
|
|
|
|
|
|
|
include_directories(include/lua)
|
2023-02-15 19:54:35 +08:00
|
|
|
|
include_directories(include)
|
|
|
|
|
include_directories(include/libgit2)
|
2022-01-24 10:23:08 +08:00
|
|
|
|
include_directories(src)
|
|
|
|
|
|
2022-09-14 13:01:10 +08:00
|
|
|
|
qt_add_executable(FreeKill)
|
2023-03-08 12:14:02 +08:00
|
|
|
|
|
|
|
|
|
if (NOT DEFINED FK_SERVER_ONLY)
|
|
|
|
|
qt_add_translations(FreeKill
|
|
|
|
|
TS_FILES lang/zh_CN.ts
|
|
|
|
|
QM_FILES_OUTPUT_VARIABLE zh_CN.qm
|
2023-11-07 12:49:31 +08:00
|
|
|
|
|
|
|
|
|
TS_FILES lang/en_US.ts
|
|
|
|
|
QM_FILES_OUTPUT_VARIABLE en_US.qm
|
2023-03-08 12:14:02 +08:00
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
|
TARGET FreeKill
|
|
|
|
|
POST_BUILD
|
2023-03-09 13:32:09 +08:00
|
|
|
|
COMMENT "Generating version file fk_ver"
|
|
|
|
|
COMMAND echo ${CMAKE_PROJECT_VERSION} > ${PROJECT_SOURCE_DIR}/fk_ver
|
2024-06-10 14:58:31 +08:00
|
|
|
|
COMMAND ${PROJECT_SOURCE_DIR}/genfkver.sh
|
2023-01-29 18:11:41 +08:00
|
|
|
|
)
|
2023-01-03 23:37:14 +08:00
|
|
|
|
|
2022-01-24 10:23:08 +08:00
|
|
|
|
add_subdirectory(src)
|
2024-10-17 19:00:02 +08:00
|
|
|
|
|
|
|
|
|
enable_testing()
|
|
|
|
|
add_subdirectory(test)
|