Created
May 10, 2022 16:14
-
-
Save ebarlas/8f7be484a3b1a0e9a2da838ed49f86b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.20) | |
project(sdl_demo) | |
set(CMAKE_CXX_STANDARD 17) | |
set(CMAKE_VERBOSE_MAKEFILE ON) | |
include(FetchContent) | |
FetchContent_Declare( | |
SDL | |
GIT_REPOSITORY https://github.com/libsdl-org/SDL | |
GIT_TAG release-2.0.22) | |
FetchContent_MakeAvailable(SDL) | |
if (APPLE) | |
set(CMAKE_MACOSX_RPATH ON) | |
enable_language(OBJC) | |
enable_language(OBJCXX) | |
endif (APPLE) | |
FetchContent_Declare( | |
SDL_image | |
GIT_REPOSITORY https://github.com/libsdl-org/SDL_image | |
GIT_TAG abe5a02ef8b8b181e03b0aaa515390c393c11a89) | |
FetchContent_MakeAvailable(SDL_image) | |
FetchContent_Declare( | |
SDL_mixer | |
GIT_REPOSITORY https://github.com/libsdl-org/SDL_mixer | |
GIT_TAG 2832ea6404c3e14fbb88c94792eaaaab1cd5c0d0) | |
FetchContent_MakeAvailable(SDL_mixer) | |
FetchContent_Declare( | |
SDL_ttf | |
GIT_REPOSITORY https://github.com/libsdl-org/SDL_ttf | |
GIT_TAG ab576e803b9761b1abde5d9ddb17913aa4c98d8d) | |
FetchContent_MakeAvailable(SDL_ttf) | |
FetchContent_Declare( | |
SDL_net | |
GIT_REPOSITORY https://github.com/ebarlas/SDL_net | |
GIT_TAG cmake) | |
FetchContent_MakeAvailable(SDL_net) | |
add_executable(main main.cpp) | |
target_link_libraries( | |
main | |
PRIVATE | |
SDL2_mixer | |
SDL2_image | |
SDL2_ttf | |
SDL2_net | |
SDL2::SDL2 | |
SDL2::SDL2main | |
) |
Author
ebarlas
commented
May 10, 2022
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment