intel / libvpl

Intel® Video Processing Library (Intel® VPL) API, dispatcher, and examples
https://intel.github.io/libvpl/
MIT License
262 stars 80 forks source link

Link to oneVPL with CMake #92

Closed LLL-YUE closed 1 year ago

LLL-YUE commented 1 year ago

In this step, which CMakeList(in which folder) should I add the following code to? if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) set(CMAKE_LIBRARY_ARCHITECTURE x86) endif() find_package(VPL REQUIRED) target_link_libraries(${TARGET} VPL::dispatcher)

mav-intel commented 1 year ago

Hi @LLL-YUE This should be in the same CMakeLists.txt that defines your TARGET. So if you have a command line application hello.cpp that wants to use VPL and it has a CMakeLists.txt in the same folder as the hello.cpp then in that CMakeList.txt:

set(TARGET hello)
set(SOURCES hello.cpp)
add_executable(${TARGET} ${SOURCES})

// code link VPL to hello
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
 set(CMAKE_LIBRARY_ARCHITECTURE x86)
endif()
find_package(VPL REQUIRED)
target_link_libraries(${TARGET} VPL::dispatcher)

Does that make sense?

mav-intel commented 1 year ago

Closed due to inactivity. Feel free to reopen with more information