瀏覽代碼

Fix build script in finding the DRM, GBM and others.
RPI 4 may require KMS/DRM to replace DISPMAN.

Yao Wei Tjong 姚伟忠 5 年之前
父節點
當前提交
45089a1322

+ 3 - 3
CMake/Modules/FindDirectRenderingManager.cmake → CMake/Modules/FindDRM.cmake

@@ -27,10 +27,10 @@
 #  DRM_LIBRARIES
 #
 
-find_path (DRM_INCLUDE_DIRS NAMES xf86drm.h DOC "DirectRenderingManager include directory")
-find_library (DRM_LIBRARIES NAMES drm DOC "DirectRenderingManager library")
+find_path (DRM_INCLUDE_DIRS NAMES drm.h PATH_SUFFIXES libdrm DOC "DirectRenderingManager include directory")
+find_library (DRM_LIBRARIES NAMES drm PATH_SUFFIXES aarch64-linux-gnu DOC "DirectRenderingManager library")
 
 include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (DirectRenderingManager REQUIRED_VARS DRM_LIBRARIES DRM_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find Direct Rendering Manager development library")
+find_package_handle_standard_args (DRM REQUIRED_VARS DRM_LIBRARIES DRM_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find Direct Rendering Manager development library")
 
 mark_as_advanced (DRM_INCLUDE_DIRS DRM_LIBRARIES)

+ 2 - 2
CMake/Modules/FindGenericBufferManagement.cmake → CMake/Modules/FindGBM.cmake

@@ -28,9 +28,9 @@
 #
 
 find_path (GBM_INCLUDE_DIRS NAMES gbm.h DOC "GenericBufferManagement include directory")
-find_library (GBM_LIBRARIES NAMES gbm DOC "GenericBufferManagement library")
+find_library (GBM_LIBRARIES NAMES gbm PATH_SUFFIXES aarch64-linux-gnu DOC "GenericBufferManagement library")
 
 include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (GenericBufferManagement REQUIRED_VARS GBM_LIBRARIES GBM_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find Direct Generic Buffer Management development library")
+find_package_handle_standard_args (GBM REQUIRED_VARS GBM_LIBRARIES GBM_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find Direct Generic Buffer Management development library")
 
 mark_as_advanced (GBM_INCLUDE_DIRS GBM_LIBRARIES)

+ 1 - 1
CMake/Modules/FindNetworkAudioSystem.cmake → CMake/Modules/FindNAS.cmake

@@ -31,6 +31,6 @@ find_path (NAS_INCLUDE_DIRS NAMES audio/audiolib.h nas/audiolib.h DOC "NetworkAu
 find_library (NAS_LIBRARIES NAMES audio DOC "NetworkAudioSystem library")
 
 include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (NetworkAudioSystem REQUIRED_VARS NAS_LIBRARIES NAS_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find NetworkAudioSystem development library")
+find_package_handle_standard_args (NAS REQUIRED_VARS NAS_LIBRARIES NAS_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find NetworkAudioSystem development library")
 
 mark_as_advanced (NAS_INCLUDE_DIRS NAS_LIBRARIES)

+ 1 - 1
CMake/Modules/FindRoarAudio.cmake → CMake/Modules/FindSNDIO.cmake

@@ -31,6 +31,6 @@ find_path (SNDIO_INCLUDE_DIRS NAMES RoarAudio.h DOC "RoarAudio include directory
 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")
+find_package_handle_standard_args (SNDIO REQUIRED_VARS SNDIO_LIBRARIES SNDIO_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find RoarAudio development library")
 
 mark_as_advanced (SNDIO_INCLUDE_DIRS SNDIO_LIBRARIES)

+ 3 - 3
CMake/Modules/FindVideoCore.cmake

@@ -29,11 +29,11 @@
 #
 
 # Only need to cater for raspbian as they are not in CMAKE_SYSTEM_PATH
-set (VIDEOCORE_INC_SEARCH_PATH /opt/vc/include /usr/include)
-set (VIDEOCORE_LIB_SEARCH_PATH /opt/vc/lib /usr/lib/aarch64-linux-gnu)
+set (VIDEOCORE_INC_SEARCH_PATH /opt/vc/include)
+set (VIDEOCORE_LIB_SEARCH_PATH /opt/vc/lib)
 
 find_path (VIDEOCORE_INCLUDE_DIRS bcm_host.h PATHS ${VIDEOCORE_INC_SEARCH_PATH} PATH_SUFFIXES vc DOC "Broadcom VideoCore include directory")
-find_library (VIDEOCORE_LIBRARIES bcm_host PATHS ${VIDEOCORE_LIB_SEARCH_PATH} PATH_SUFFIXES vc DOC "Broadcom VideoCore BCM_HOST library")
+find_library (VIDEOCORE_LIBRARIES bcm_host PATHS ${VIDEOCORE_LIB_SEARCH_PATH} PATH_SUFFIXES vc aarch64-linux-gnu DOC "Broadcom VideoCore BCM_HOST library")
 
 include (FindPackageHandleStandardArgs)
 find_package_handle_standard_args (VideoCore REQUIRED_VARS VIDEOCORE_LIBRARIES VIDEOCORE_INCLUDE_DIRS FAIL_MESSAGE "Could NOT find Broadcom VideoCore firmware")

+ 1 - 1
Source/ThirdParty/SDL/CMakeLists.txt

@@ -320,7 +320,7 @@ dep_option(WAYLAND_SHARED      "Dynamically load Wayland support" ON VIDEO_WAYLA
 # Urho3D - change the VIDEO_WAYLAND_QT_TOUCH default value to FALSE (this is only needed by Sailfish[?] but we don't know way to auto-detect that yet)
 dep_option(VIDEO_WAYLAND_QT_TOUCH  "QtWayland server support for Wayland video driver" OFF VIDEO_WAYLAND OFF)
 # Urho3D - only make VIDEO_RPI option available on Raspberry-Pi platform
-dep_option(VIDEO_RPI           "Use Raspberry Pi video driver" ON RPI OFF)
+dep_option(VIDEO_RPI           "Use Raspberry Pi video driver" ON "RPI AND NOT RPI_ABI STREQUAL RPI4" OFF)
 # Urho3D - bug fix - make VIDEO_X11 build option available for desktop UNIX (including OSX) only
 dep_option(VIDEO_X11           "Use X11 video driver" ON "UNIX_SYS OR APPLE\;NOT RPI AND NOT IOS AND NOT TVOS" OFF)
 dep_option(X11_SHARED          "Dynamically load X11 support" ON VIDEO_X11 OFF)

+ 4 - 4
Source/ThirdParty/SDL/cmake/sdlchecks.cmake

@@ -294,7 +294,7 @@ endmacro()
 macro(CheckNAS)
   if(NAS)
     # Urho3D - bug fix - do not use check_include_file() for detection as it only works for host environment and not for rooted environment when cross-compiling
-    find_package (NetworkAudioSystem)
+    find_package (NAS)
     if(NAS_FOUND)
       include_directories (SYSTEM ${NAS_INCLUDE_DIRS})
       set(HAVE_NAS TRUE)
@@ -325,7 +325,7 @@ endmacro()
 macro(CheckSNDIO)
   if(SNDIO)
     # Urho3D - bug fix - do not use check_include_file() for detection as it only works for host environment and not for rooted environment when cross-compiling
-    find_package (RoarAudio)
+    find_package (SNDIO)
     if(SNDIO_FOUND)
       include_directories (SYSTEM ${SNDIO_INCLUDE_DIRS})
       set(HAVE_SNDIO TRUE)
@@ -1105,8 +1105,8 @@ endmacro(CheckRPI)
 macro(CheckKMSDRM)
   if(VIDEO_KMSDRM)
     # Urho3D - bug fix - do not use pkg-config tool for detection as it only works for host environment and not for rooted environment when cross-compiling
-    find_package (DirectRenderingManager)
-    find_package (GenericBufferManagement)
+    find_package (DRM)
+    find_package (GBM)
     if(DRM_FOUND AND GBM_FOUND)
       include_directories (SYSTEM ${DRM_INCLUDE_DIRS} ${GBM_INCLUDE_DIRS})
       set(HAVE_VIDEO_KMSDRM TRUE)