diff options
Diffstat (limited to 'third-party/sdl2')
| -rw-r--r-- | third-party/sdl2/CMakeLists.txt | 18 | ||||
| -rw-r--r-- | third-party/sdl2/CMakeLists.txt.in | 15 | 
2 files changed, 33 insertions, 0 deletions
| diff --git a/third-party/sdl2/CMakeLists.txt b/third-party/sdl2/CMakeLists.txt new file mode 100644 index 0000000..93022fd --- /dev/null +++ b/third-party/sdl2/CMakeLists.txt @@ -0,0 +1,18 @@ +configure_file(CMakeLists.txt.in sdl2/CMakeLists.txt) +execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . +  RESULT_VARIABLE result +  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sdl2 ) +if(result) +  message(FATAL_ERROR "CMake step for sdl2 failed: ${result}") +endif() + +execute_process(COMMAND ${CMAKE_COMMAND} --build . +  RESULT_VARIABLE result +  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sdl2 ) +if(result) +  message(FATAL_ERROR "Build step for sdl2 failed: ${result}") +endif() + +add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/sdl2-src +                 ${CMAKE_CURRENT_BINARY_DIR}/sdl2-build) + diff --git a/third-party/sdl2/CMakeLists.txt.in b/third-party/sdl2/CMakeLists.txt.in new file mode 100644 index 0000000..2277448 --- /dev/null +++ b/third-party/sdl2/CMakeLists.txt.in @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.0) + +project(sdl2 NONE) + +include(ExternalProject) + +ExternalProject_Add(sdl2 +  URL               https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.0.20.tar.gz +  SOURCE_DIR        "${CMAKE_CURRENT_BINARY_DIR}/sdl2-src" +  BINARY_DIR        "${CMAKE_CURRENT_BINARY_DIR}/sdl2-build" +  CONFIGURE_COMMAND "" +  BUILD_COMMAND     "" +  INSTALL_COMMAND   "" +  TEST_COMMAND      "" +) | 
