Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

CMake build fail: hard-coded to use static version of libmfx, although MediaSDK provides only shared one #146

Open
eero-t opened this issue Jan 7, 2019 · 0 comments

Comments

@eero-t
Copy link

eero-t commented Jan 7, 2019

Setup:

  • Ubuntu 18.04
  • Latest Open Source MediaSDK built from Git
  • Git version of gstreamer-media-SDK

Problem:

  • Build files are hard-coded to use static version of libmfx, although Open Source Media SDK version build provides only shared one

This patch fixed it for CMake:

--- a/cmake/FindMediaSDK.cmake
+++ b/cmake/FindMediaSDK.cmake
@@ -5,7 +5,7 @@ function(FindMediaSDK)
      message(STATUS "MFX_LIBRARY_DIRS: ${MFX_LIBDIR}")
      include_directories (${MFX_INCLUDE_DIRS})
      #set (${libs} ${MFX_LIBS} PARENT_SCOPE)
-     set(MFX_LIBRARY  "${MFX_LIBDIR}/libmfx.a")
+     set(MFX_LIBRARY  "${MFX_LIBDIR}/libmfx.so")
   else()
     if(DEFINED ENV{MFX_HOME})
       message(STATUS "MediaSDK distribution found in $ENV{MFX_HOME}")
@@ -22,6 +22,6 @@ function(FindMediaSDK)
     message( STATUS "MediaSDK library directory: ${MFX_LIBRARY}")
     include_directories(${MFX_INCLUDES})
   endif()
-    add_library(libmfx STATIC IMPORTED)
+    add_library(libmfx SHARED IMPORTED)
     set_property(TARGET libmfx PROPERTY IMPORTED_LOCATION ${MFX_LIBRARY})
 endfunction(FindMediaSDK)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant