1 Star 1 Fork 12

wandongcheng/SDL2snake

forked from Joker2770/SDL2snake 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
cmake_minimum_required(VERSION 2.8)
project(SDL2snake)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS, "-Wall")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "My multi config types" FORCE)
elseif(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RELEASE)
endif()
if(UNIX)
find_package( PkgConfig REQUIRED )
pkg_check_modules( sdl2 REQUIRED IMPORTED_TARGET sdl2 )
pkg_check_modules( SDL2_ttf REQUIRED IMPORTED_TARGET SDL2_ttf )
endif()
include_directories(${SDL2_INCLUDE_DIRS} ${SDL2_TTF_INCLUDE_DIR})
file(GLOB SDL2snake_SRCS "src/*.cpp" "src/*.h")
add_executable(${PROJECT_NAME} ${SDL2snake_SRCS})
if(UNIX)
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::sdl2 )
target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::SDL2_ttf )
endif()
if(UNIX)
set(CMAKE_INSTALL_PREFIX /usr/local)
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
install(FILES res/lazy.ttf DESTINATION bin)
elseif(WIN32)
set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/")
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
install(FILES res/lazy.ttf DESTINATION bin)
endif()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/wandongchengrn/SDL2snake.git
git@gitee.com:wandongchengrn/SDL2snake.git
wandongchengrn
SDL2snake
SDL2snake
master

搜索帮助