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

Commit

Permalink
Fix build-time Dispatcher discovery
Browse files Browse the repository at this point in the history
Issue: MDP-51381
Test: build
(cherry picked from commit 308d814)
  • Loading branch information
Nabiullin, Oleg committed Oct 29, 2018
1 parent 97d18a0 commit 2e94677
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ include( ${BUILDER_ROOT}/FindITT.cmake )
include( ${BUILDER_ROOT}/FindGTest.cmake )
include( ${BUILDER_ROOT}/ConfTargets.cmake )

# should prepend others to define target mfx
if (BUILD_DISPATCHER)
add_subdirectory(api/mfx_dispatch/linux)
endif()

if (BUILD_TOOLS)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/tools)
endif()
Expand All @@ -100,10 +105,6 @@ if (BUILD_RUNTIME)
add_subdirectory(${CMAKE_HOME_DIRECTORY}/_studio)
endif()

if (BUILD_DISPATCHER)
add_subdirectory(api/mfx_dispatch/linux)
endif()

create_plugins_cfg(${CMAKE_BINARY_DIR})

message("")
Expand Down
11 changes: 0 additions & 11 deletions builder/FindMFX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,12 @@ else()
endif()

find_path( MFX_INCLUDE mfxdefs.h PATHS ${MFX_API_HOME}/include )
find_library( MFX_LIBRARY libmfx.a PATHS ${MFX_API_HOME}/lib PATH_SUFFIXES ${os_arch} )

if( NOT MFX_INCLUDE MATCHES NOTFOUND )
include_directories( ${MFX_API_HOME}/mediasdk_structures )
include_directories( ${MFX_INCLUDE} )
endif()

if( NOT MFX_LIBRARY MATCHES NOTFOUND )
get_filename_component( MFX_LIBRARY_PATH ${MFX_LIBRARY} PATH )
link_directories( ${MFX_LIBRARY_PATH} )
endif()

if( NOT MFX_INCLUDE MATCHES NOTFOUND )
set( MFX_FOUND TRUE )
include_directories( ${MFX_INCLUDE} )
Expand All @@ -62,11 +56,6 @@ else()
message( STATUS "Intel(R) Media SDK was found here $ENV{MFX_HOME}")
endif()

if( NOT MFX_LIBRARY MATCHES NOTFOUND )
get_filename_component(MFX_LIBRARY_PATH ${MFX_LIBRARY} PATH )
link_directories( ${MFX_LIBRARY_PATH} )
endif()

# Potential source of confusion here. Environment $MFX_VERSION translates to product name (strings libmfxhw64.so | grep mediasdk),
# but macro definition MFX_VERSION should contain API version i.e. 1025 for API 1.25
if( NOT DEFINED API OR API STREQUAL "master")
Expand Down
6 changes: 5 additions & 1 deletion builder/FindPackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ function(configure_target target cflags libdirs)
endfunction()

function(configure_libmfx_target target)
configure_target(${ARGV0} "${LIBMFX_CFLAGS}" "${LIBMFX_LIBRARY_DIRS}")
# prefer local Dispatcher sources to preinstalled
if (NOT TARGET mfx)
configure_target(${ARGV0} "${PKG_MFX_CFLAGS}" "${PKG_MFX_LIBRARY_DIRS}")
endif()

set(SCOPE_CFLAGS ${SCOPE_CFLAGS} PARENT_SCOPE)
set(SCOPE_LINKFLAGS "${SCOPE_LINKFLAGS} -Wl,--default-symver" PARENT_SCOPE)
Expand Down Expand Up @@ -488,6 +491,7 @@ if( Linux )
# optional:
pkg_check_modules( PKG_X11 x11 )
pkg_check_modules( PKG_LIBVA_X11 libva-x11>=0.33 )
pkg_check_modules( PKG_MFX libmfx>=1.28 )

if ( PKG_X11_FOUND AND PKG_LIBVA_X11_FOUND )
set( ENABLE_X11 true )
Expand Down

0 comments on commit 2e94677

Please sign in to comment.