From 776cb917850c9d36ffd886de2dc93f6b42b879db Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sat, 27 May 2017 21:38:49 -0700 Subject: CMake: Define an interface target for SDL2 definitions --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 238e92dcc..b746554fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,6 +171,13 @@ if (ENABLE_SDL2) else() find_package(SDL2 REQUIRED) endif() + + if (SDL2_FOUND) + # TODO(yuriks): Make FindSDL2.cmake export an IMPORTED library instead + add_library(SDL2 INTERFACE) + target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") + target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") + endif() else() set(SDL2_FOUND NO) endif() -- cgit v1.2.3