Fetch SDL2 in CMake

master
PgSocks 1 year ago
parent d4123f440e
commit 9de914dfa8

@ -30,14 +30,19 @@ target_include_directories(robomaster
include include
) )
find_package(SDL2) include(FetchContent)
FetchContent_Declare (
SDL2
GIT_REPOSITORY https://github.com/libsdl-org/SDL
GIT_TAG release-2.0.20
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(SDL2)
if(SDL2_FOUND) add_executable(robomasterapp
add_executable(robomasterapp src/sdl.c
src/sdl.c )
) target_link_libraries(robomasterapp
target_link_libraries(robomasterapp robomaster
robomaster SDL2-static
SDL2::SDL2-static )
)
endif()

Loading…
Cancel
Save