On Tue, Jul 14, 2009 at 07:09:42AM +0300, Oron Peled wrote:
> Intend to fix the problems documented in the thread:
> 
> 3. In a separate mail Mark noted that the new widget system in wesnoth
>    uses Pango and therefore would deprecate fribidi -- great move, as
>    it would remove the need for all the previous right-to-left display
>    hacks. An interesting paper from the maintainer or Pango and fribidi:
>       http://behdad.org/text
>    And the related slides:
>       http://behdad.org/download/Presentations/slippy/stateoftext_slides.pdf

Indeed an interesting paper.

> Please test with different distibutions so we can fix this. It's important
> that distro packagers would test this with their wesnoth-1.6.x and 1.4.x as
> it would provide them migration path when fribidi2 hits their distros.

Loonycyborg tested your patch with the scons build system and it works.

I tested your patch with the cmake build system and it failed as
expected. Attached a patch for the cmake build system. Could you
integrate this patch with yours and commit them in one commit?

-- 
Regards,
Mark de Wever aka Mordante/SkeletonCrew
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac8512d..a5f22b7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,7 @@ find_package( Boost 1.33 REQUIRED COMPONENTS iostreams regex )
 # yes, gettext is *required* even when NLS is deactivated (this is to compile
 # src/gettext.cpp since it includes libintl.h)
 find_package( Gettext REQUIRED )
-find_package( FriBiDi )
+
 find_package( X11 )
 
 if(NOT MSVC)
@@ -154,12 +154,6 @@ if(GUI STREQUAL "tiny")
   add_definitions(-DUSE_TINY_GUI)
 endif(GUI STREQUAL "tiny")
 
-if(ENABLE_FRIBIDI AND FRIBIDI_LIBRARIES)
-  add_definitions(-DHAVE_FRIBIDI)
-elseif(ENABLE_FRIBIDI AND NOT FRIBIDI_LIBRARIES)
-  message("Could not find FriBiDi. Disabling FriBiDi support.")
-endif()
-
 if(ENABLE_LOW_MEM)
   add_definitions(-DLOW_MEM)
 endif(ENABLE_LOW_MEM)
@@ -192,10 +186,26 @@ endif(ENABLE_TESTS)
 if(ENABLE_GAME)
        find_package( Lua51 REQUIRED)
        find_package( PkgConfig REQUIRED )
+
        pkg_check_modules( PANGOCAIRO REQUIRED pangocairo>=1.14.8 )
        if(NOT MSVC)
                pkg_check_modules( FONTCONFIG REQUIRED fontconfig>=2.4.1 )
        endif(NOT MSVC)
+
+       pkg_check_modules(FRIBIDI fribidi>=0.19.0)
+       if(NOT FRIBIDI_FOUND)
+               find_package(FriBiDi)
+               if(FRIBIDI_FOUND)
+                       add_definitions(-DOLD_FRIBIDI)
+               endif(FRIBIDI_FOUND)
+       endif(NOT FRIBIDI_FOUND)
+
+       if(ENABLE_FRIBIDI AND FRIBIDI_LIBRARIES)
+         add_definitions(-DHAVE_FRIBIDI)
+       elseif(ENABLE_FRIBIDI AND NOT FRIBIDI_LIBRARIES)
+         message("Could not find FriBiDi. Disabling FriBiDi support.")
+       endif()
+
 endif(ENABLE_GAME)
 
 # get languages
diff --git a/cmake/FindFriBiDi.cmake b/cmake/FindFriBiDi.cmake
index b7e72c3..fbbbbd3 100644
--- a/cmake/FindFriBiDi.cmake
+++ b/cmake/FindFriBiDi.cmake
@@ -13,10 +13,13 @@ include(CheckSymbolExists)
 
 SET(FRIBIDI_FOUND "NO")
 
-FIND_PATH(FRIBIDI_INCLUDE_DIR fribidi/fribidi.h
-  /usr/local/include
-  /usr/include
+# Set variable in temp var, otherwise FIND_PATH might fail
+# unset isn't present in the required version of cmake.
+FIND_PATH(xFRIBIDI_INCLUDE_DIR fribidi.h
+  /usr/local/include/fribidi
+  /usr/include/fribidi
   )
+set(FRIBIDI_INCLUDE_DIR ${xFRIBIDI_INCLUDE_DIR})
 
 SET(FRIBIDI_NAMES ${FRIBIDI_NAMES} fribidi libfribidi)
 FIND_LIBRARY(FRIBIDI_LIBRARY
_______________________________________________
Wesnoth-dev mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-dev

Reply via email to