From 3eef469dfb2e2ee8b3ff317ab727079ce5b08e26 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut@gmail.com" Date: Sun, 10 Jul 2011 08:52:16 +0000 Subject: [PATCH] cmake: be sure wx is present before fiddling with the include path git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4804 96395faa-99c1-11dd-bbfe-3dabce05a288 --- cmake/SearchForStuff.cmake | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index ccc4d2f065..b180c9b0c3 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -172,16 +172,18 @@ if(wxWidgets_FOUND) # Force the use of 32 bit library configuration on # 64 bits machine with 32 bits library in /usr/lib32 if(CMAKE_SIZEOF_VOID_P MATCHES "8") - if (EXISTS "/usr/lib32") - # Debian/ubuntu. 64b in /usr/lib and 32b in /usr/lib32 + ## There is no guarantee that wx-config is a link to a 32 bits library. So you need to force the destinity + # Library can go into 3 path major paths (+ multiarch but you will see that later when implementation is done) + # 1/ /usr/lib32 (32 bits only) + # 2/ /usr/lib64 (64 bits only) + # 3/ /usr/lib (32 or 64 bits depends on distributions) + if (EXISTS "/usr/lib32/wx") STRING(REGEX REPLACE "/usr/lib/wx" "/usr/lib32/wx" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") - # I'm sure someone did it! 64b in /usr/lib64 and 32b in /usr/lib32 STRING(REGEX REPLACE "/usr/lib64/wx" "/usr/lib32/wx" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") - endif (EXISTS "/usr/lib32") - if (EXISTS "/usr/lib") - # Fedora/Open suse. 64b in /usr/lib64 and 32b in /usr/lib + endif (EXISTS "/usr/lib32/wx") + if (EXISTS "/usr/lib/wx") STRING(REGEX REPLACE "/usr/lib64/wx" "/usr/lib/wx" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") - endif (EXISTS "/usr/lib") + endif (EXISTS "/usr/lib/wx") endif(CMAKE_SIZEOF_VOID_P MATCHES "8") endif(Linux)