Browse Source

Better multiarch support in auto-detection.
This should also solve the problem with cross-compiling other target triplets as there is no more hardcoding.

Yao Wei Tjong 姚伟忠 9 years ago
parent
commit
576b6ea7cf

+ 1 - 7
CMake/Modules/FindEsound.cmake

@@ -27,14 +27,8 @@
 #  ESOUND_LIBRARIES
 #
 
-if (URHO3D_64BIT)
-    set (ESOUND_LIB_SEARCH_PATH /usr/lib/x86_64-linux-gnu)
-else ()
-    set (ESOUND_LIB_SEARCH_PATH /usr/lib/i386-linux-gnu)
-endif ()
-
 find_path (ESOUND_INCLUDE_DIRS NAMES esd.h DOC "Esound include directory")
-find_library (ESOUND_LIBRARIES NAMES esd PATHS ${ESOUND_LIB_SEARCH_PATH} DOC "Esound library")
+find_library (ESOUND_LIBRARIES NAMES esd DOC "Esound library")
 
 include (FindPackageHandleStandardArgs)
 find_package_handle_standard_args (Esound REQUIRED_VARS ESOUND_LIBRARIES ESOUND_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find Esound development library")

+ 3 - 9
CMake/Modules/FindMir.cmake

@@ -30,17 +30,11 @@
 #  XKB
 #
 
-if (URHO3D_64BIT)
-    set (MIR_LIB_SEARCH_PATH /usr/lib/x86_64-linux-gnu)
-else ()
-    set (MIR_LIB_SEARCH_PATH /usr/lib/i386-linux-gnu)
-endif ()
-
 find_path (MIR_CLIENT_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h DOC "Mir client include directory")
 find_path (MIR_COMMON_INCLUDE_DIR NAMES mir_toolkit/common.h DOC "Mir common include directory")
-find_library (MIR_CLIENT NAMES mirclient PATHS ${MIR_LIB_SEARCH_PATH} DOC "Mir client library")
-find_library (MIR_COMMON NAMES mircommon PATHS ${MIR_LIB_SEARCH_PATH} DOC "Mir common library")
-find_library (XKB NAMES xkbcommon PATHS ${MIR_LIB_SEARCH_PATH} DOC "X.Org library for compiling XKB maps into formats usable by the X Server or other display servers")
+find_library (MIR_CLIENT NAMES mirclient DOC "Mir client library")
+find_library (MIR_COMMON NAMES mircommon DOC "Mir common library")
+find_library (XKB NAMES xkbcommon DOC "X.Org library for compiling XKB maps into formats usable by the X Server or other display servers")
 
 include (FindPackageHandleStandardArgs)
 find_package_handle_standard_args (Mir REQUIRED_VARS MIR_CLIENT MIR_COMMON XKB MIR_CLIENT_INCLUDE_DIR MIR_COMMON_INCLUDE_DIR FAIL_MESSAGE "Could NOT find Mir display server")

+ 1 - 7
CMake/Modules/FindNetworkAudioSystem.cmake

@@ -27,14 +27,8 @@
 #  NAS_LIBRARIES
 #
 
-if (URHO3D_64BIT)
-    set (NAS_LIB_SEARCH_PATH /usr/lib/x86_64-linux-gnu)
-else ()
-    set (NAS_LIB_SEARCH_PATH /usr/lib/i386-linux-gnu)
-endif ()
-
 find_path (NAS_INCLUDE_DIRS NAMES audio/audiolib.h nas/audiolib.h DOC "NetworkAudioSystem include directory")
-find_library (NAS_LIBRARIES NAMES audio PATHS ${NAS_LIB_SEARCH_PATH} DOC "NetworkAudioSystem library")
+find_library (NAS_LIBRARIES NAMES audio DOC "NetworkAudioSystem library")
 
 include (FindPackageHandleStandardArgs)
 find_package_handle_standard_args (NAS REQUIRED_VARS NAS_LIBRARIES NAS_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find NetworkAudioSystem development library")

+ 1 - 7
CMake/Modules/FindRoarAudio.cmake

@@ -27,14 +27,8 @@
 #  SNDIO_LIBRARIES
 #
 
-if (URHO3D_64BIT)
-    set (SNDIO_LIB_SEARCH_PATH /usr/lib/x86_64-linux-gnu)
-else ()
-    set (SNDIO_LIB_SEARCH_PATH /usr/lib/i386-linux-gnu)
-endif ()
-
 find_path (SNDIO_INCLUDE_DIRS NAMES RoarAudio.h DOC "RoarAudio include directory")
-find_library (SNDIO_LIBRARIES NAMES RoarAudio PATHS ${SNDIO_LIB_SEARCH_PATH} DOC "RoarAudio library")
+find_library (SNDIO_LIBRARIES NAMES RoarAudio DOC "RoarAudio library")
 
 include (FindPackageHandleStandardArgs)
 find_package_handle_standard_args (RoarAudio REQUIRED_VARS SNDIO_LIBRARIES SNDIO_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find RoarAudio development library")

+ 4 - 11
CMake/Modules/FindWayland.cmake

@@ -31,18 +31,11 @@
 #  XKB
 #
 
-# Only need to cater for debian distros as they are not in CMAKE_SYSTEM_PATH
-if (URHO3D_64BIT)
-    set (WAYLAND_LIB_SEARCH_PATH /usr/lib/x86_64-linux-gnu)
-else ()
-    set (WAYLAND_LIB_SEARCH_PATH /usr/lib/i386-linux-gnu)
-endif ()
-
 find_path (WAYLAND_INCLUDE_DIRS NAMES wayland-client.h DOC "Wayland include directory")
-find_library (WAYLAND_CLIENT NAMES wayland-client PATHS ${WAYLAND_LIB_SEARCH_PATH} DOC "Wayland client library")
-find_library (WAYLAND_CURSOR NAMES wayland-cursor PATHS ${WAYLAND_LIB_SEARCH_PATH} DOC "Wayland compositor infrastructure - cursor library")
-find_library (WAYLAND_EGL NAMES wayland-egl PATHS ${WAYLAND_LIB_SEARCH_PATH} DOC "Wayland EGL platform - runtime")
-find_library (XKB NAMES xkbcommon PATHS ${WAYLAND_LIB_SEARCH_PATH} DOC "X.Org library for compiling XKB maps into formats usable by the X Server or other display servers")
+find_library (WAYLAND_CLIENT NAMES wayland-client DOC "Wayland client library")
+find_library (WAYLAND_CURSOR NAMES wayland-cursor DOC "Wayland compositor infrastructure - cursor library")
+find_library (WAYLAND_EGL NAMES wayland-egl DOC "Wayland EGL platform - runtime")
+find_library (XKB NAMES xkbcommon DOC "X.Org library for compiling XKB maps into formats usable by the X Server or other display servers")
 
 include (FindPackageHandleStandardArgs)
 find_package_handle_standard_args (Wayland REQUIRED_VARS WAYLAND_CLIENT WAYLAND_CURSOR WAYLAND_EGL XKB WAYLAND_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find Wayland display server")

+ 4 - 5
Source/ThirdParty/SDL/CMakeLists.txt

@@ -978,14 +978,13 @@ elseif(UNIX)    # Urho3D - at this point both UNIX and UNIX_SYS should be equiva
     endif ()
     # Urho3D - bug fix - dbus/dbus.h is installed under path suffix 'dbus-1.0', so the following find_path() is needed even when not cross-compiling
     find_path (DBUS_H_INCLUDE_DIRS NAMES dbus/dbus.h PATH_SUFFIXES dbus-1.0)
-    # Cater for both 32/64bit Redhat-based/Debian-based distros and 32-bit Raspberry-Pi as dbus-arch-deps header search paths are a little bit unusual
-    # FIXME: Is there a better way than hardcoding these?
+    # Cater for both multilib and multiarch, native and cross-compiling build
     if (URHO3D_64BIT)
-      set (DBUS_INC_SEARCH_PATH /usr/lib64/dbus-1.0/include /usr/lib/x86_64-linux-gnu/dbus-1.0/include)
+      set (DBUS_INC_SEARCH_PATH /usr/lib64/dbus-1.0/include)
     else ()
-      set (DBUS_INC_SEARCH_PATH /usr/lib/dbus-1.0/include /usr/lib/i386-linux-gnu/dbus-1.0/include /usr/lib/arm-linux-gnueabihf/dbus-1.0/include)
+      set (DBUS_INC_SEARCH_PATH /usr/lib/dbus-1.0/include)
     endif ()
-    find_path (DBUS_ARCH_DEPS_H_INCLUDE_DIRS NAMES dbus/dbus-arch-deps.h PATHS ${DBUS_INC_SEARCH_PATH})
+    find_path (DBUS_ARCH_DEPS_H_INCLUDE_DIRS NAMES dbus/dbus-arch-deps.h PATHS ${DBUS_INC_SEARCH_PATH} /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/dbus-1.0/include)
     set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_UDEV_DBUS_SAVED} ${DBUS_H_INCLUDE_DIRS} ${DBUS_ARCH_DEPS_H_INCLUDE_DIRS})
     check_include_file("dbus/dbus.h" HAVE_DBUS_DBUS_H)
     if (HAVE_DBUS_DBUS_H AND DBUS_H_INCLUDE_DIRS AND DBUS_ARCH_DEPS_H_INCLUDE_DIRS)