1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Add cmake stuff for retrieving SDL_kitchensink library

It fixes issue #1.
This commit is contained in:
Mathieu Schroeter 2017-09-11 22:24:37 +02:00
parent e68870b22b
commit 102e87d434
2 changed files with 60 additions and 8 deletions

View File

@ -99,6 +99,7 @@ set (CMAKE_LIBRARY_PATH ${CMAKE_INSTALL_PREFIX}/lib)
find_package (Intl REQUIRED)
find_package (Iconv REQUIRED)
find_package (Argagg REQUIRED)
find_package (SDLKitchensink REQUIRED)
find_package (PkgConfig REQUIRED)
pkg_search_module (SDL2 REQUIRED sdl2)
@ -120,13 +121,6 @@ endif ()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCURL_STATICLIB")
##################
## SDL_kitchensink
##################
add_library (SDL_kitchensink STATIC IMPORTED)
set_property (TARGET SDL_kitchensink PROPERTY IMPORTED_LOCATION ${CMAKE_INSTALL_PREFIX}/lib/libSDL_kitchensink_static.a)
###########################
## Main binary dependencies
###########################
@ -140,7 +134,7 @@ set (planetblupi_DEPS
${SDL2_MIXER_STATIC_LIBRARIES}
${SDL2_IMAGE_STATIC_LIBRARIES}
${CURL_STATIC_LIBRARIES}
SDL_kitchensink
${SDLKitchensink_STATIC_LIBRARIES}
${PNG_STATIC_LIBRARIES}
${AVCODEC_STATIC_LIBRARIES}
${AVFORMAT_STATIC_LIBRARIES}

View File

@ -0,0 +1,58 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindSDLKitchensink
# --------
#
# Find the libsdlkitchensink headers and libraries.
#
# This module reports information about the libsdlkitchensink
# installation in several variables. General variables::
#
# SDLKitchensink_FOUND - true if the libsdlkitchensink headers and libraries were found
# SDLKitchensink_INCLUDE_DIRS - the directory containing the libsdlkitchensink headers
# SDLKitchensink_LIBRARIES - libsdlkitchensink libraries to be linked
#
# The following cache variables may also be set::
#
# SDLKitchensink_INCLUDE_DIR - the directory containing the libsdlkitchensink headers
# SDLKitchensink_LIBRARY - the libsdlkitchensink library (if any)
# Based on FindIconv written by Roger Leigh <rleigh@codelibre.net>
# Find include directory
find_path(SDLKitchensink_INCLUDE_DIR
NAMES "kitchensink/kitchensink.h"
DOC "libsdlkitchensink include directory")
mark_as_advanced(SDLKitchensink_INCLUDE_DIR)
# Find all SDLKitchensink libraries
find_library(SDLKitchensink_LIBRARY
NAMES SDL_kitchensink
DOC "libsdlkitchensink libraries)")
find_library(SDLKitchensink_STATIC_LIBRARY
NAMES SDL_kitchensink_static
DOC "libsdlkitchensink static libraries)")
mark_as_advanced(SDLKitchensink_STATIC_LIBRARY)
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLKitchensink
FOUND_VAR SDLKitchensink_FOUND
REQUIRED_VARS SDLKitchensink_INCLUDE_DIR
FAIL_MESSAGE "Failed to find libsdlkitchensink")
if(SDLKitchensink_FOUND)
set(SDLKitchensink_INCLUDE_DIRS "${SDLKitchensink_INCLUDE_DIR}")
if(SDLKitchensink_LIBRARY)
set(SDLKitchensink_LIBRARIES "${SDLKitchensink_LIBRARY}")
else()
unset(SDLKitchensink_LIBRARIES)
endif()
if(SDLKitchensink_STATIC_LIBRARY)
set(SDLKitchensink_STATIC_LIBRARIES "${SDLKitchensink_STATIC_LIBRARY}")
else()
unset(SDLKitchensink_STATIC_LIBRARIES)
endif()
endif()