59 lines
1.8 KiB
CMake
59 lines
1.8 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
||
project(DisplayFlow VERSION 1.0.0 LANGUAGES CXX)
|
||
|
||
# ============================================================================
|
||
# 项目配置
|
||
# ============================================================================
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # 生成 compile_commands.json(用于 IDE)
|
||
|
||
# ============================================================================
|
||
# 包含 CMake 模块
|
||
# ============================================================================
|
||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||
|
||
# 编译器选项
|
||
include(CompilerOptions)
|
||
|
||
# 平台检测
|
||
if(ANDROID)
|
||
set(PLATFORM_ANDROID ON)
|
||
include(Android)
|
||
elseif(WIN32)
|
||
set(PLATFORM_WINDOWS ON)
|
||
include(Windows)
|
||
elseif(APPLE)
|
||
set(PLATFORM_MACOS ON)
|
||
elseif(UNIX)
|
||
set(PLATFORM_LINUX ON)
|
||
endif()
|
||
|
||
# ============================================================================
|
||
# 构建选项
|
||
# ============================================================================
|
||
option(BUILD_TESTS "Build tests" OFF)
|
||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||
option(ENABLE_VP8_CODEC "Enable VP8 codec support" OFF)
|
||
|
||
# ============================================================================
|
||
# 依赖管理
|
||
# ============================================================================
|
||
include(Dependencies)
|
||
|
||
# ============================================================================
|
||
# 测试框架
|
||
# ============================================================================
|
||
include(Testing)
|
||
|
||
# 添加子目录
|
||
add_subdirectory(core)
|
||
|
||
# 根据平台添加对应的平台适配层
|
||
if(PLATFORM_ANDROID)
|
||
add_subdirectory(platforms/android)
|
||
elseif(PLATFORM_WINDOWS)
|
||
add_subdirectory(platforms/windows)
|
||
endif()
|
||
|
||
# 测试已在 Testing.cmake 中配置
|
||
|