Files
Course-Design-C--/CMakeLists.txt

23 lines
818 B
CMake
Raw Permalink 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.31)
project(course_design)
# 设置C++标准为17并要求遵守该标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 寻找SQLite3库
find_package(SQLite3 REQUIRED)
# 公共源文件
set(SOURCES main.cpp userAuth.cpp data.cpp tools.cpp render_ui.cpp)
# 创建GBK编码的可执行文件
add_executable(coursedesign_gbk ${SOURCES})
target_compile_options(coursedesign_gbk PRIVATE -fexec-charset=gbk)
target_link_libraries(coursedesign_gbk PRIVATE SQLite::SQLite3)
set_target_properties(coursedesign_gbk PROPERTIES LINK_FLAGS "-static")
# 创建UTF-8编码的可执行文件
add_executable(coursedesign_utf8 ${SOURCES})
target_link_libraries(coursedesign_utf8 PRIVATE SQLite::SQLite3)
set_target_properties(coursedesign_utf8 PROPERTIES LINK_FLAGS "-static")