Last active
August 22, 2020 04:05
-
-
Save MRsoymilk/4a725d76e6a1c7d4db1830e92f77f9d5 to your computer and use it in GitHub Desktop.
sdl2 cmake for image, net, ttf, mixer
This file contains hidden or 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.16) | |
| project(sdl_cmake) | |
| set(CMAKE_CXX_STANDARD 14) | |
| file(GLOB_RECURSE SOURCES "src/*.cpp") | |
| file(GLOB_RECURSE HEADERS "src/*.h") | |
| add_executable(${PROJECT_NAME} ${HEADERS} ${SOURCES}) | |
| INCLUDE(FindPkgConfig) | |
| PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2) | |
| PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED SDL2_image) | |
| PKG_SEARCH_MODULE(SDL2NET REQUIRED SDL2_net) | |
| PKG_SEARCH_MODULE(SDL2TTF REQUIRED SDL2_ttf) | |
| PKG_SEARCH_MODULE(SDL2MIXER REQUIRED SDL2_mixer) | |
| INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS} ${SDL2IMAGE_INCLUDE_DIR}) | |
| TARGET_LINK_LIBRARIES( | |
| ${PROJECT_NAME} | |
| ${SDL2_LIBRARIES} | |
| ${SDL2IMAGE_LIBRARIES} | |
| ${SDL2NET_LIBRARIES} | |
| ${SDL2TTF_LIBRARIES} | |
| ${SDL2MIXER_LIBRARIES} | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment