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
This commit is contained in:
gregory.hainaut@gmail.com 2011-07-10 08:52:16 +00:00
parent fe66636625
commit 3eef469dfb
1 changed files with 9 additions and 7 deletions

View File

@ -172,16 +172,18 @@ if(wxWidgets_FOUND)
# Force the use of 32 bit library configuration on # Force the use of 32 bit library configuration on
# 64 bits machine with 32 bits library in /usr/lib32 # 64 bits machine with 32 bits library in /usr/lib32
if(CMAKE_SIZEOF_VOID_P MATCHES "8") if(CMAKE_SIZEOF_VOID_P MATCHES "8")
if (EXISTS "/usr/lib32") ## There is no guarantee that wx-config is a link to a 32 bits library. So you need to force the destinity
# Debian/ubuntu. 64b in /usr/lib and 32b in /usr/lib32 # 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}") 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}") STRING(REGEX REPLACE "/usr/lib64/wx" "/usr/lib32/wx" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
endif (EXISTS "/usr/lib32") endif (EXISTS "/usr/lib32/wx")
if (EXISTS "/usr/lib") if (EXISTS "/usr/lib/wx")
# Fedora/Open suse. 64b in /usr/lib64 and 32b in /usr/lib
STRING(REGEX REPLACE "/usr/lib64/wx" "/usr/lib/wx" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") 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(CMAKE_SIZEOF_VOID_P MATCHES "8")
endif(Linux) endif(Linux)