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

Try to link against a static intl and iconv lib

This commit is contained in:
Mathieu Schroeter 2017-03-21 19:45:56 +01:00
parent 89b1070dbe
commit 18ae020a3e
2 changed files with 53 additions and 0 deletions

View File

@ -64,6 +64,9 @@ endif (MINGW)
# Dependencies
set (CMAKE_INCLUDE_PATH ${CMAKE_INSTALL_PREFIX}/include)
set (CMAKE_LIBRARY_PATH ${CMAKE_INSTALL_PREFIX}/lib)
find_package (Iconv REQUIRED)
find_package (Intl REQUIRED)
find_package (PkgConfig REQUIRED)
@ -90,6 +93,7 @@ set_property (TARGET SDL_kitchensink PROPERTY IMPORTED_LOCATION ${CMAKE_INSTALL_
###########################
target_link_libraries (planetblupi PUBLIC
${Iconv_LIBRARIES}
${Intl_LIBRARIES}
${SDL2_STATIC_LIBRARIES}
${SDL2_MIXER_STATIC_LIBRARIES}

49
cmake/FindIconv.cmake Normal file
View File

@ -0,0 +1,49 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindIconv
# --------
#
# Find the libiconv headers and libraries.
#
# This module reports information about the libiconv
# installation in several variables. General variables::
#
# Iconv_FOUND - true if the libiconv headers and libraries were found
# Iconv_INCLUDE_DIRS - the directory containing the libiconv headers
# Iconv_LIBRARIES - libiconv libraries to be linked
#
# The following cache variables may also be set::
#
# Iconv_INCLUDE_DIR - the directory containing the libiconv headers
# Iconv_LIBRARY - the libiconv library (if any)
# Written by Roger Leigh <rleigh@codelibre.net>
# Find include directory
find_path(Iconv_INCLUDE_DIR
NAMES "iconv.h"
DOC "libiconv include directory")
mark_as_advanced(Iconv_INCLUDE_DIR)
# Find all Iconv libraries
find_library(Iconv_LIBRARY "iconv"
DOC "libiconv libraries)")
mark_as_advanced(Iconv_LIBRARY)
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Iconv
FOUND_VAR Iconv_FOUND
REQUIRED_VARS Iconv_INCLUDE_DIR
FAIL_MESSAGE "Failed to find libiconv")
if(Iconv_FOUND)
set(Iconv_INCLUDE_DIRS "${Iconv_INCLUDE_DIR}")
if(Iconv_LIBRARY)
set(Iconv_LIBRARIES "${Iconv_LIBRARY}")
else()
unset(Iconv_LIBRARIES)
endif()
endif()