- updated with patches from hasufell related to fribidi detection
This commit is contained in:
parent
983b4ca9a2
commit
fe07998816
|
@ -14,6 +14,7 @@ if(NOT DEFINED CMAKE_BUILD_TYPE)
|
||||||
endif(NOT DEFINED CMAKE_BUILD_TYPE)
|
endif(NOT DEFINED CMAKE_BUILD_TYPE)
|
||||||
|
|
||||||
# add additional CMake modules
|
# add additional CMake modules
|
||||||
|
MESSAGE(STATUS "CMAKE_SOURCE_DIR = ${CMAKE_SOURCE_DIR}")
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/mk/cmake/Modules)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/mk/cmake/Modules)
|
||||||
|
|
||||||
MESSAGE(STATUS "Build type for this compile will be: ${CMAKE_BUILD_TYPE}")
|
MESSAGE(STATUS "Build type for this compile will be: ${CMAKE_BUILD_TYPE}")
|
||||||
|
|
11
build-mg.sh
11
build-mg.sh
|
@ -4,6 +4,7 @@
|
||||||
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
|
||||||
# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+
|
# Copyright (c) 2011-2013 Mark Vejvoda under GNU GPL v3.0+
|
||||||
|
|
||||||
|
WANT_CLANG=NO
|
||||||
LANG=C
|
LANG=C
|
||||||
NUMCORES=`lscpu -p | grep -cv '^#'`
|
NUMCORES=`lscpu -p | grep -cv '^#'`
|
||||||
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
|
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
|
||||||
|
@ -110,6 +111,16 @@ esac
|
||||||
#exit 1;
|
#exit 1;
|
||||||
|
|
||||||
CURRENTDIR="$(dirname $(readlink -f $0))"
|
CURRENTDIR="$(dirname $(readlink -f $0))"
|
||||||
|
|
||||||
|
if [ "$WANT_CLANG" = 'YES' ]; then
|
||||||
|
export CC=/usr/bin/clang
|
||||||
|
export CXX=/usr/bin/clang++
|
||||||
|
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -D_CMAKE_TOOLCHAIN_PREFIX=llvm-"
|
||||||
|
echo "USER WANTS to use CLANG / LLVM compiler! EXTRA_CMAKE_OPTIONS = ${EXTRA_CMAKE_OPTIONS}"
|
||||||
|
#exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Calling cmake with EXTRA_CMAKE_OPTIONS = ${EXTRA_CMAKE_OPTIONS}"
|
||||||
cmake -DCMAKE_INSTALL_PREFIX='' -DWANT_DEV_OUTPATH=ON -DWANT_STATIC_LIBS=ON -DBUILD_MEGAGLEST_TESTS=ON -DBREAKPAD_ROOT=${CURRENTDIR}/../google-breakpad/ ${EXTRA_CMAKE_OPTIONS} ..
|
cmake -DCMAKE_INSTALL_PREFIX='' -DWANT_DEV_OUTPATH=ON -DWANT_STATIC_LIBS=ON -DBUILD_MEGAGLEST_TESTS=ON -DBREAKPAD_ROOT=${CURRENTDIR}/../google-breakpad/ ${EXTRA_CMAKE_OPTIONS} ..
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo 'ERROR: CMAKE failed.' >&2; exit 1
|
echo 'ERROR: CMAKE failed.' >&2; exit 1
|
||||||
|
|
|
@ -32,6 +32,8 @@ IF(WANT_STATIC_LIBS)
|
||||||
SET(FRIBIDI_NAMES fribidi.a libfribidi.a ${FRIBIDI_NAMES})
|
SET(FRIBIDI_NAMES fribidi.a libfribidi.a ${FRIBIDI_NAMES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
MESSAGE(STATUS "** Searching for library names: [${FRIBIDI_NAMES}] ...")
|
||||||
|
|
||||||
FIND_LIBRARY(FRIBIDI_LIBRARY
|
FIND_LIBRARY(FRIBIDI_LIBRARY
|
||||||
NAMES ${FRIBIDI_NAMES}
|
NAMES ${FRIBIDI_NAMES}
|
||||||
PATHS /usr/lib /usr/local/lib
|
PATHS /usr/lib /usr/local/lib
|
||||||
|
@ -40,40 +42,20 @@ FIND_LIBRARY(FRIBIDI_LIBRARY
|
||||||
IF (FRIBIDI_LIBRARY AND FRIBIDI_INCLUDE_DIR)
|
IF (FRIBIDI_LIBRARY AND FRIBIDI_INCLUDE_DIR)
|
||||||
SET(CMAKE_REQUIRED_INCLUDES ${FRIBIDI_INCLUDE_DIR})
|
SET(CMAKE_REQUIRED_INCLUDES ${FRIBIDI_INCLUDE_DIR})
|
||||||
SET(CMAKE_REQUIRED_LIBRARIES ${FRIBIDI_LIBRARY})
|
SET(CMAKE_REQUIRED_LIBRARIES ${FRIBIDI_LIBRARY})
|
||||||
CHECK_SYMBOL_EXISTS(fribidi_utf8_to_unicode fribidi.h FOUND_fribidi_utf8_to_unicode)
|
FIND_PACKAGE(GLIB2 REQUIRED)
|
||||||
CHECK_SYMBOL_EXISTS(fribidi_charset_to_unicode fribidi.h FOUND_fribidi_charset_to_unicode)
|
|
||||||
CHECK_SYMBOL_EXISTS(FRIBIDI_CHAR_SET_UTF8 fribidi.h FOUND_FRIBIDI_CHAR_SET_UTF8)
|
|
||||||
|
|
||||||
# FriBiDi provides both fribidi_utf8_to_unicode and fribidi_charset_to_unicode.
|
CHECK_LIBRARY_EXISTS(fribidi fribidi_utf8_to_unicode "" FOUND_fribidi_utf8_to_unicode)
|
||||||
# The difference is that
|
CHECK_LIBRARY_EXISTS(fribidi fribidi_charset_to_unicode "" FOUND_fribidi_charset_to_unicode)
|
||||||
# 1. fribidi >= 0.10.5 has FRIBIDI_CHAR_SET_UTF8.
|
|
||||||
# 2. fribidi <= 0.10.4 has FRIBIDI_CHARSET_UTF8.
|
|
||||||
|
|
||||||
# Newer versions of fribidi (not tested the initial version which has the
|
if(FOUND_fribidi_charset_to_unicode)
|
||||||
# issue, but at least 0.19.2 has the issue) no longer have the symbol
|
|
||||||
# FRIBIDI_CHAR_SET_UTF8. But the symbol is build with some macros confusing
|
|
||||||
# cmake. To test for that case let the compiler give its verdict.
|
|
||||||
if(FOUND_fribidi_charset_to_unicode AND NOT FOUND_FRIBIDI_CHAR_SET_UTF8)
|
|
||||||
file(WRITE "${CMAKE_BINARY_DIR}/fribidi_test.c"
|
|
||||||
"#include <fribidi.h>\nint main(){FriBidiCharSet s = FRIBIDI_CHAR_SET_UTF8;}"
|
|
||||||
)
|
|
||||||
try_compile(FOUND_FRIBIDI_CHAR_SET_UTF8
|
|
||||||
"${CMAKE_BINARY_DIR}"
|
|
||||||
"${CMAKE_BINARY_DIR}/fribidi_test.c"
|
|
||||||
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${FRIBIDI_INCLUDE_DIR}"
|
|
||||||
)
|
|
||||||
|
|
||||||
file(REMOVE "${CMAKE_BINARY_DIR}/fribidi_test.c")
|
|
||||||
|
|
||||||
endif(FOUND_fribidi_charset_to_unicode AND NOT FOUND_FRIBIDI_CHAR_SET_UTF8)
|
|
||||||
|
|
||||||
if(FOUND_fribidi_charset_to_unicode AND FOUND_FRIBIDI_CHAR_SET_UTF8)
|
|
||||||
# fribidi >= 0.10.5
|
# fribidi >= 0.10.5
|
||||||
SET(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
|
SET(FRIBIDI_INCLUDE_DIR ${FRIBIDI_INCLUDE_DIR} ${GLIB2_INCLUDE_DIRS})
|
||||||
|
SET(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY} ${GLIB2_LIBRARIES})
|
||||||
SET(FRIBIDI_FOUND "YES")
|
SET(FRIBIDI_FOUND "YES")
|
||||||
elseif(FOUND_fribidi_utf8_to_unicode)
|
elseif(FOUND_fribidi_utf8_to_unicode)
|
||||||
# fribidi <= 0.10.4
|
# fribidi <= 0.10.4
|
||||||
SET(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
|
SET(FRIBIDI_INCLUDE_DIR ${FRIBIDI_INCLUDE_DIR} ${GLIB2_INCLUDE_DIRS})
|
||||||
|
SET(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY} ${GLIB2_LIBRARIES})
|
||||||
SET(FRIBIDI_FOUND "YES")
|
SET(FRIBIDI_FOUND "YES")
|
||||||
add_definitions(-DOLD_FRIBIDI)
|
add_definitions(-DOLD_FRIBIDI)
|
||||||
MESSAGE(STATUS "Legacy FriBiDi: ${FRIBIDI_LIBRARY}")
|
MESSAGE(STATUS "Legacy FriBiDi: ${FRIBIDI_LIBRARY}")
|
||||||
|
|
|
@ -0,0 +1,219 @@
|
||||||
|
# http://opensource.bolloretelecom.eu/projects/boc-wimax/browser/cmake/modules/FindGLIB2.cmake?rev=8f5b254534bd304923d4cc7bc7e9d6552c119ea2
|
||||||
|
|
||||||
|
# - Try to find GLib2
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# GLIB2_FOUND - system has GLib2
|
||||||
|
# GLIB2_INCLUDE_DIRS - the GLib2 include directory
|
||||||
|
# GLIB2_LIBRARIES - Link these to use GLib2
|
||||||
|
#
|
||||||
|
# HAVE_GLIB_GREGEX_H glib has gregex.h header and
|
||||||
|
# supports g_regex_match_simple
|
||||||
|
#
|
||||||
|
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
|
||||||
|
# Copyright (c) 2006 Philippe Bernery <philippe.bernery@gmail.com>
|
||||||
|
# Copyright (c) 2007 Daniel Gollub <dgollub@suse.de>
|
||||||
|
# Copyright (c) 2007 Alban Browaeys <prahal@yahoo.com>
|
||||||
|
# Copyright (c) 2008 Michael Bell <michael.bell@web.de>
|
||||||
|
# Copyright (c) 2008 Bjoern Ricks <bjoern.ricks@googlemail.com>
|
||||||
|
#
|
||||||
|
# Redistribution and use is allowed according to the terms of the New
|
||||||
|
# BSD license.
|
||||||
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
IF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
|
||||||
|
# in cache already
|
||||||
|
SET(GLIB2_FOUND TRUE)
|
||||||
|
ELSE (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
|
||||||
|
|
||||||
|
INCLUDE(FindPkgConfig)
|
||||||
|
|
||||||
|
## Glib
|
||||||
|
IF ( GLIB2_FIND_REQUIRED )
|
||||||
|
SET( _pkgconfig_REQUIRED "REQUIRED" )
|
||||||
|
ELSE ( GLIB2_FIND_REQUIRED )
|
||||||
|
SET( _pkgconfig_REQUIRED "" )
|
||||||
|
ENDIF ( GLIB2_FIND_REQUIRED )
|
||||||
|
|
||||||
|
IF ( GLIB2_MIN_VERSION )
|
||||||
|
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0>=${GLIB2_MIN_VERSION} )
|
||||||
|
ELSE ( GLIB2_MIN_VERSION )
|
||||||
|
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0 )
|
||||||
|
ENDIF ( GLIB2_MIN_VERSION )
|
||||||
|
IF ( PKG_CONFIG_FOUND )
|
||||||
|
IF ( GLIB2_FOUND )
|
||||||
|
SET ( GLIB2_CORE_FOUND TRUE )
|
||||||
|
ELSE ( GLIB2_FOUND )
|
||||||
|
SET ( GLIB2_CORE_FOUND FALSE )
|
||||||
|
ENDIF ( GLIB2_FOUND )
|
||||||
|
ENDIF ( PKG_CONFIG_FOUND )
|
||||||
|
|
||||||
|
# Look for glib2 include dir and libraries w/o pkgconfig
|
||||||
|
IF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
|
||||||
|
FIND_PATH(
|
||||||
|
_glibconfig_include_DIR
|
||||||
|
NAMES
|
||||||
|
glibconfig.h
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/lib64
|
||||||
|
/opt/gnome/lib
|
||||||
|
/opt/lib/
|
||||||
|
/opt/local/lib
|
||||||
|
/sw/lib/
|
||||||
|
/usr/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/include
|
||||||
|
${CMAKE_LIBRARY_PATH}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
glib-2.0/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_PATH(
|
||||||
|
_glib2_include_DIR
|
||||||
|
NAMES
|
||||||
|
glib.h
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/include
|
||||||
|
/opt/local/include
|
||||||
|
/sw/include
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
PATH_SUFFIXES
|
||||||
|
glib-2.0
|
||||||
|
)
|
||||||
|
|
||||||
|
#MESSAGE(STATUS "Glib headers: ${_glib2_include_DIR}")
|
||||||
|
|
||||||
|
FIND_LIBRARY(
|
||||||
|
_glib2_link_DIR
|
||||||
|
NAMES
|
||||||
|
glib-2.0
|
||||||
|
glib
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/sw/lib
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
)
|
||||||
|
IF ( _glib2_include_DIR AND _glib2_link_DIR )
|
||||||
|
SET ( _glib2_FOUND TRUE )
|
||||||
|
ENDIF ( _glib2_include_DIR AND _glib2_link_DIR )
|
||||||
|
|
||||||
|
|
||||||
|
IF ( _glib2_FOUND )
|
||||||
|
SET ( GLIB2_INCLUDE_DIRS ${_glib2_include_DIR} ${_glibconfig_include_DIR} )
|
||||||
|
SET ( GLIB2_LIBRARIES ${_glib2_link_DIR} )
|
||||||
|
SET ( GLIB2_CORE_FOUND TRUE )
|
||||||
|
ELSE ( _glib2_FOUND )
|
||||||
|
SET ( GLIB2_CORE_FOUND FALSE )
|
||||||
|
ENDIF ( _glib2_FOUND )
|
||||||
|
|
||||||
|
# Handle dependencies
|
||||||
|
# libintl
|
||||||
|
IF ( NOT LIBINTL_FOUND )
|
||||||
|
FIND_PATH(LIBINTL_INCLUDE_DIR
|
||||||
|
NAMES
|
||||||
|
libintl.h
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/include
|
||||||
|
/opt/local/include
|
||||||
|
/sw/include
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(LIBINTL_LIBRARY
|
||||||
|
NAMES
|
||||||
|
intl
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/sw/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
|
||||||
|
SET (LIBINTL_FOUND TRUE)
|
||||||
|
ENDIF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
|
||||||
|
ENDIF ( NOT LIBINTL_FOUND )
|
||||||
|
|
||||||
|
# libiconv
|
||||||
|
IF ( NOT LIBICONV_FOUND )
|
||||||
|
FIND_PATH(LIBICONV_INCLUDE_DIR
|
||||||
|
NAMES
|
||||||
|
iconv.h
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/include
|
||||||
|
/opt/local/include
|
||||||
|
/opt/local/include
|
||||||
|
/sw/include
|
||||||
|
/sw/include
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
PATH_SUFFIXES
|
||||||
|
glib-2.0
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(LIBICONV_LIBRARY
|
||||||
|
NAMES
|
||||||
|
iconv
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/sw/lib
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
|
||||||
|
SET (LIBICONV_FOUND TRUE)
|
||||||
|
ENDIF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
|
||||||
|
ENDIF ( NOT LIBICONV_FOUND )
|
||||||
|
|
||||||
|
IF (LIBINTL_FOUND)
|
||||||
|
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBINTL_LIBRARY})
|
||||||
|
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBINTL_INCLUDE_DIR})
|
||||||
|
ENDIF (LIBINTL_FOUND)
|
||||||
|
|
||||||
|
IF (LIBICONV_FOUND)
|
||||||
|
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBICONV_LIBRARY})
|
||||||
|
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBICONV_INCLUDE_DIR})
|
||||||
|
ENDIF (LIBICONV_FOUND)
|
||||||
|
|
||||||
|
ENDIF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
|
||||||
|
##
|
||||||
|
|
||||||
|
IF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
|
||||||
|
SET (GLIB2_FOUND TRUE)
|
||||||
|
ENDIF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
|
||||||
|
|
||||||
|
IF (GLIB2_FOUND)
|
||||||
|
IF (NOT GLIB2_FIND_QUIETLY)
|
||||||
|
MESSAGE (STATUS "Found GLib2: ${GLIB2_LIBRARIES} ${GLIB2_INCLUDE_DIRS}")
|
||||||
|
ENDIF (NOT GLIB2_FIND_QUIETLY)
|
||||||
|
ELSE (GLIB2_FOUND)
|
||||||
|
IF (GLIB2_FIND_REQUIRED)
|
||||||
|
MESSAGE (SEND_ERROR "Could not find GLib2")
|
||||||
|
ENDIF (GLIB2_FIND_REQUIRED)
|
||||||
|
ENDIF (GLIB2_FOUND)
|
||||||
|
|
||||||
|
# show the GLIB2_INCLUDE_DIRS and GLIB2_LIBRARIES variables only in the advanced view
|
||||||
|
MARK_AS_ADVANCED(GLIB2_INCLUDE_DIRS GLIB2_LIBRARIES)
|
||||||
|
MARK_AS_ADVANCED(LIBICONV_INCLUDE_DIR LIBICONV_LIBRARY)
|
||||||
|
MARK_AS_ADVANCED(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARY)
|
||||||
|
|
||||||
|
ENDIF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS)
|
||||||
|
|
||||||
|
IF ( GLIB2_FOUND )
|
||||||
|
# Check if system has a newer version of glib
|
||||||
|
# which supports g_regex_match_simple
|
||||||
|
INCLUDE( CheckIncludeFiles )
|
||||||
|
SET( CMAKE_REQUIRED_INCLUDES ${GLIB2_INCLUDE_DIRS} )
|
||||||
|
CHECK_INCLUDE_FILES ( glib/gregex.h HAVE_GLIB_GREGEX_H )
|
||||||
|
# Reset CMAKE_REQUIRED_INCLUDES
|
||||||
|
SET( CMAKE_REQUIRED_INCLUDES "" )
|
||||||
|
ENDIF( GLIB2_FOUND )
|
Loading…
Reference in New Issue