From ba39468c5871960915c35ef4c04e7cd62c9054d1 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Fri, 24 May 2019 18:49:36 +0200 Subject: [smpeg2] make sdl2 linkage more robust (#6604) --- ports/smpeg2/CMakeLists.txt | 8 ++++++-- ports/smpeg2/CONTROL | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ports/smpeg2/CMakeLists.txt b/ports/smpeg2/CMakeLists.txt index 87a3586be..b0e284b05 100644 --- a/ports/smpeg2/CMakeLists.txt +++ b/ports/smpeg2/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.6) project(SMPEG2 CXX) find_path(SDL_INCLUDE_DIR SDL2/SDL.h) -find_library(SDL_LIBRARY NAMES SDL2d SDL2) +find_package(SDL2 CONFIG REQUIRED) include_directories(${SDL_INCLUDE_DIR}) include_directories(${SDL_INCLUDE_DIR}/SDL2) @@ -46,7 +46,11 @@ add_library(smpeg2 smpeg.cpp) set_target_properties(smpeg2 PROPERTIES DEFINE_SYMBOL SDL2_EXPORTS) -target_link_libraries(smpeg2 ${SDL_LIBRARY}) +if(BUILD_SHARED_LIBS) + target_link_libraries(smpeg2 SDL2::SDL2) +else() + target_link_libraries(smpeg2 SDL2::SDL2-static) +endif() install(TARGETS smpeg2 RUNTIME DESTINATION bin diff --git a/ports/smpeg2/CONTROL b/ports/smpeg2/CONTROL index 0de1c4700..fc1e1604c 100644 --- a/ports/smpeg2/CONTROL +++ b/ports/smpeg2/CONTROL @@ -1,4 +1,4 @@ Source: smpeg2 -Version: 2.0.0-5 +Version: 2.0.0-6 Description: SDL MPEG Player Library Build-Depends: sdl2 -- cgit v1.2.3