add source code
This commit is contained in:
16
CMakeLists.txt
Normal file
16
CMakeLists.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(sdl-window LANGUAGES C)
|
||||
|
||||
add_executable(sdl-window main.c)
|
||||
# 由于我们把SDL2安装在了系统目录中
|
||||
# 所以这里可以直接在系统目录中寻找
|
||||
find_package(SDL2 REQUIRED)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS sdl-window
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2)
|
||||
Reference in New Issue
Block a user