intel / gstreamer-media-SDK

GNU Lesser General Public License v2.1
90 stars 49 forks source link

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

Open eero-t opened 5 years ago

eero-t commented 5 years ago

Setup:

Problem:

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)