Files
DisplayFlow/CMakeLists.txt
huanglinhuan 91ae52eeb3 暂存文件
2025-12-12 21:54:52 +08:00

59 lines
1.8 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 中配置