ODF_TEST/CMakeLists.txt

53 lines
1.3 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.14)
project(odf VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# ============================================================
# MSVC UTF-8 编译选项
# ============================================================
if (MSVC)
add_compile_options(/utf-8)
endif()
# ============================================================
# 源文件
# ============================================================
set(ODF_SOURCES
src/app.cpp
)
set(ODF_HEADERS
include/app.hpp
)
# ============================================================
# 主程序可执行文件
# ============================================================
add_executable(odf_main
src/main.cpp
${ODF_SOURCES}
${ODF_HEADERS}
)
target_include_directories(odf_main
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)
# ============================================================
# 测试可执行文件(使用标准库 assert无外部依赖
# ============================================================
add_executable(odf_test
tests/basic_test.cpp
${ODF_SOURCES}
${ODF_HEADERS}
)
target_include_directories(odf_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)