Files
CMake/Tests/FindSDL/Test/CMakeLists.txt
T
Brad King bd7b2293aa Tests: Bump CMake minimum required version in find-module tests to 3.5
CMake 3.27 deprecates compatibility with CMake < 3.5.
Update find module tests to avoid the deprecation warning.
2023-03-08 15:41:43 -05:00

20 lines
633 B
CMake

cmake_minimum_required(VERSION 3.5)
project(TestFindSDL C)
include(CTest)
find_package(SDL)
add_definitions(
-DCMAKE_EXPECTED_SDL_VERSION_MAJOR=${SDL_VERSION_MAJOR}
-DCMAKE_EXPECTED_SDL_VERSION_MINOR=${SDL_VERSION_MINOR}
-DCMAKE_EXPECTED_SDL_VERSION_PATCH=${SDL_VERSION_PATCH})
add_executable(test_sdl_tgt main.c)
target_link_libraries(test_sdl_tgt SDL::SDL)
add_test(NAME test_sdl_tgt COMMAND test_sdl_tgt)
add_executable(test_sdl_var main.c)
target_include_directories(test_sdl_var PRIVATE ${SDL_INCLUDE_DIRS})
target_link_libraries(test_sdl_var PRIVATE ${SDL_LIBRARIES})
add_test(NAME test_sdl_var COMMAND test_sdl_var)