代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 3.10)
set(PROJECT_NAME "GameEngine")
project(${PROJECT_NAME})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(SPDLOG_NO_THREADS ON)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
set(EASYX_PATH ${CMAKE_SOURCE_DIR}/3rd/EasyX)
# 设置easyX库文件路径
set(EASYX_LIB_PATH ${EASYX_PATH}/lib/x64)
# 设置easyX头文件路径
include_directories(${EASYX_PATH}/include)
file(GLOB_RECURSE SOURCES
src/*.cpp
src/engine/*.cpp
src/object/*.cpp
) # 获取src目录下的所有cpp文件
# 打印找到的.cpp文件
message("find following cpp files")
foreach(source_file ${SOURCES})
message("\t-->\t${source_file}")
endforeach()
add_executable(${PROJECT_NAME}
${SOURCES}
main.cpp
)
# 添加包含目录
target_include_directories(${PROJECT_NAME} PRIVATE
inc
src
${EASYX_PATH}/include
${EASYX_PATH}/lib/x64
)
add_subdirectory(3rd/spdlog)
target_link_libraries(${PROJECT_NAME} PRIVATE
spdlog
)
target_link_libraries(${PROJECT_NAME} PRIVATE EasyXa)
target_link_libraries(${PROJECT_NAME} PRIVATE EasyXw)
# 如果需要使用Windows API,添加下面一行
target_link_libraries(${PROJECT_NAME} PRIVATE gdi32)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。