Skip to content

Find rocdecode - Updates for ROCm 7.0 #610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Full documentation for rocDecode is available at [https://rocm.docs.amd.com/projects/rocDecode/en/latest/](https://rocm.docs.amd.com/projects/rocDecode/en/latest/)

## rocDecode 0.14.0 (unreleased)
## rocdecode 1.0.0 for ROCm 7.0.0

### Added

Expand All @@ -11,8 +11,8 @@ Full documentation for rocDecode is available at [https://rocm.docs.amd.com/proj
* HEVC/AVC/AV1/VP9 stream syntax error handling.
* HEVC stream bit depth change handling and DPB buffer size change handling through decoder reconfiguration.
* AVC stream DPB buffer size change handling through decoder reconfiguration.
* rocDecode now uses the Cmake CMAKE_PREFIX_PATH directive.
* rocDecode - A new avcodec-based decoder built as a separate "rocdecode-host" library
* rocdecode now uses the Cmake CMAKE_PREFIX_PATH directive.
* rocdecode - A new avcodec-based decoder built as a separate "rocdecode-host" library


### Optimized
Expand Down
113 changes: 59 additions & 54 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ if (NOT DEFINED CMAKE_CXX_COMPILER)
set(CMAKE_CXX_COMPILER ${ROCM_PATH}/bin/amdclang++)
endif()

# rocDecode Version
set(VERSION "0.14.0")
# rocdecode Version
set(VERSION "1.0.0")

# Set Project Version and Language
project(rocdecode VERSION ${VERSION} LANGUAGES CXX)
Expand All @@ -59,7 +59,7 @@ find_program(DPKG_EXE dpkg)

# avoid setting the default installation path to /usr/local
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${ROCM_PATH} CACHE PATH "rocDecode default installation path" FORCE)
set(CMAKE_INSTALL_PREFIX ${ROCM_PATH} CACHE PATH "rocdecode default installation path" FORCE)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

set(DEFAULT_BUILD_TYPE "Release")
Expand All @@ -77,15 +77,15 @@ if(ENHANCED_MESSAGE)
set(Cyan "${Esc}[36m")
set(White "${Esc}[37m")
endif()
message("-- ${BoldBlue}rocDecode Version -- ${VERSION}${ColourReset}")
message("-- ${BoldBlue}rocDecode Install Path -- ${CMAKE_INSTALL_PREFIX}${ColourReset}")
message("-- ${BoldBlue}rocdecode Version -- ${VERSION}${ColourReset}")
message("-- ${BoldBlue}rocdecode Install Path -- ${CMAKE_INSTALL_PREFIX}${ColourReset}")

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/lib/cmake)

# rocDecode Build Type
# rocdecode Build Type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "rocDecode Default Build Type" FORCE)
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "rocdecode Default Build Type" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
Expand All @@ -98,7 +98,7 @@ else()
# -fPIC -- Generate position-independent code if possible
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -DNDEBUG -fPIC")
endif()
message("-- ${BoldBlue}rocDecode Build Type -- ${CMAKE_BUILD_TYPE}${ColourReset}")
message("-- ${BoldBlue}rocdecode Build Type -- ${CMAKE_BUILD_TYPE}${ColourReset}")

# Add an option for enabling the rocprofiler-register
option(ROCDECODE_ENABLE_ROCPROFILER_REGISTER "Enable rocprofiler-register support" ON)
Expand Down Expand Up @@ -169,20 +169,20 @@ if(HIP_FOUND AND Libva_FOUND AND Libdrm_amdgpu_FOUND)
#Generate BUILD_INFO
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/api/rocdecode_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/rocdecode_version.h @ONLY )

# install rocDecode libs -- {ROCM_PATH}/lib
# install rocdecode libs -- {ROCM_PATH}/lib
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_SKIP)
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT dev NAMELINK_ONLY)
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT asan)
# install rocDecode include files -- {ROCM_PATH}/include/rocdecode
# install rocdecode include files -- {ROCM_PATH}/include/rocdecode
install(FILES api/rocdecode/rocdecode.h api/rocdecode/rocparser.h api/rocdecode/roc_bitstream_reader.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} COMPONENT dev)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rocdecode_version.h api/rocdecode/rocdecode_host.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} COMPONENT dev)
# install rocDecode api trace include file -- {ROCM_PATH}/include/rocdecode/amd_detail
# install rocdecode api trace include file -- {ROCM_PATH}/include/rocdecode/amd_detail
install(FILES api/amd_detail/rocdecode_api_trace.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/amd_detail COMPONENT dev)

# install rocDecode samples -- {ROCM_PATH}/share/rocdecode
# install rocdecode samples -- {ROCM_PATH}/share/rocdecode
install(DIRECTORY cmake DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME} COMPONENT dev)
install(DIRECTORY utils/rocvideodecode DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/utils COMPONENT dev)
install(DIRECTORY utils/ffmpegvideodecode DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/utils COMPONENT dev)
Expand Down Expand Up @@ -210,57 +210,62 @@ if(HIP_FOUND AND Libva_FOUND AND Libdrm_amdgpu_FOUND)
install(DIRECTORY test/testScripts DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/test COMPONENT test)
install(FILES test/rocDecodeNegativeApiTests/CMakeLists.txt test/rocDecodeNegativeApiTests/README.md test/rocDecodeNegativeApiTests/rocdecode_api_negative_tests.cpp test/rocDecodeNegativeApiTests/rocdecode_api_negative_tests.h test/rocDecodeNegativeApiTests/rocdecodenegativetest.cpp DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/test/rocDecodeNegativeApiTests COMPONENT dev)

message("-- ${White}AMD ROCm rocDecode -- CMAKE_CXX_FLAGS:${CMAKE_CXX_FLAGS}${ColourReset}")
message("-- ${White}AMD ROCm rocDecode -- Link Libraries: ${LINK_LIBRARY_LIST}${ColourReset}")
message("-- ${White}AMD ROCm rocdecode -- CMAKE_CXX_FLAGS:${CMAKE_CXX_FLAGS}${ColourReset}")
message("-- ${White}AMD ROCm rocdecode -- Link Libraries: ${LINK_LIBRARY_LIST}${ColourReset}")

## Cmake module config file configurations
# Cmake module config file configurations
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/" CACHE INTERNAL "Default module path.")

## Export the package for use from the build-tree
# Export the package for use from the build-tree
## (this registers the build-tree with a global CMake-registry)
export(PACKAGE ${PROJECT_NAME})
set(CONF_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")

## Create the rocdecode-config.cmake and rocdecode-config-version files
# Create the rocdecode-config.cmake and rocdecode-config-version files
include(CMakePackageConfigHelpers)
set(CONFIG_PACKAGE_INSTALL_DIR ${CONF_LIB_DIR}/cmake/${PROJECT_NAME})
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}")
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")

## Generate Config File for rocdecode
# Generate config Version File for rocdecode
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
COMPATIBILITY SameMajorVersion
)

# Generate Config File for rocdecode
configure_package_config_file(
${CMAKE_MODULE_PATH}/${PROJECT_NAME}-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
INSTALL_DESTINATION ${CONFIG_PACKAGE_INSTALL_DIR}
PATH_VARS LIB_INSTALL_DIR INCLUDE_INSTALL_DIR BIN_INSTALL_DIR
)

## Generate config Version File for rocdecode
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
COMPATIBILITY SameMajorVersion
)

## Install the rocdecode-config.cmake and rocdecode-config-version.cmake
# Install the rocdecode-config.cmake and rocdecode-config-version.cmake
install(FILES
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
COMPONENT dev
)

## Install the export set for use with the install-tree
install(EXPORT ${PROJECT_NAME}-targets DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" COMPONENT dev
# Install the export set for use with the install-tree
install(EXPORT ${PROJECT_NAME}-targets
FILE ${PROJECT_NAME}-targets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
COMPONENT dev
)

# make test with CTest
set(BUILD_FROM_SOURCE ON)
enable_testing()
include(CTest)
add_subdirectory(test)


# make rocdecode-host for decoding on HOST only if FFMPEG is available
if (ROCDECODE_ENABLE_HOST_DECODER AND FFMPEG_FOUND)
add_subdirectory(src/rocdecode-host)
Expand All @@ -273,17 +278,17 @@ if(HIP_FOUND AND Libva_FOUND AND Libdrm_amdgpu_FOUND)
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_LICENSE "MIT")
# TBD: Change to generic support email
set(CPACK_PACKAGE_CONTACT "rocDecode Support <[email protected]>")
set(CPACK_PACKAGE_CONTACT "rocdecode Support <[email protected]>")
set(CPACK_PACKAGE_VENDOR "AMD ROCm")
set(CPACK_PACKAGE_GROUP "Development/Tools")
set(CPACK_PACKAGE_HOMEPAGE "https://github.com/ROCm/rocDecode")

if(ENABLE_ASAN_PACKAGING)
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocDecode address sanitizer libraries")
set(CPACK_RPM_PACKAGE_SUMMARY "AMD rocDecode address sanitizer libraries")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocdecode address sanitizer libraries")
set(CPACK_RPM_PACKAGE_SUMMARY "AMD rocdecode address sanitizer libraries")
else()
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocDecode is a high performance video decode SDK for AMD GPUs")
set(CPACK_RPM_PACKAGE_SUMMARY "AMD rocDecode is a high performance video decode SDK for AMD GPUs")
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocdecode is a high performance video decode SDK for AMD GPUs")
set(CPACK_RPM_PACKAGE_SUMMARY "AMD rocdecode is a high performance video decode SDK for AMD GPUs")
endif()

if(DEFINED ENV{ROCM_LIBPATCH_VERSION})
Expand Down Expand Up @@ -394,39 +399,39 @@ if(HIP_FOUND AND Libva_FOUND AND Libdrm_amdgpu_FOUND)
endif()
if(EXISTS ${RPMBUILD_EXE})
list(APPEND CPACK_GENERATOR "RPM")
message("-- ${White}rocDecode .rpm RunTime Package Requirements -- ${CPACK_RPM_RUNTIME_PACKAGE_REQUIRES}${ColourReset}")
message("-- ${White}rocDecode .rpm Devel Package Requirements -- ${CPACK_RPM_DEV_PACKAGE_REQUIRES}${ColourReset}")
message("-- ${White}rocdecode .rpm RunTime Package Requirements -- ${CPACK_RPM_RUNTIME_PACKAGE_REQUIRES}${ColourReset}")
message("-- ${White}rocdecode .rpm Devel Package Requirements -- ${CPACK_RPM_DEV_PACKAGE_REQUIRES}${ColourReset}")
endif()
if(EXISTS ${DPKG_EXE})
list(APPEND CPACK_GENERATOR "DEB")
message("-- ${White}rocDecode .deb RunTime Package Requirements -- ${CPACK_DEBIAN_RUNTIME_PACKAGE_DEPENDS}${ColourReset}")
message("-- ${White}rocDecode .deb Dev Package Requirements -- ${CPACK_DEBIAN_DEV_PACKAGE_DEPENDS}${ColourReset}")
message("-- ${White}rocdecode .deb RunTime Package Requirements -- ${CPACK_DEBIAN_RUNTIME_PACKAGE_DEPENDS}${ColourReset}")
message("-- ${White}rocdecode .deb Dev Package Requirements -- ${CPACK_DEBIAN_DEV_PACKAGE_DEPENDS}${ColourReset}")
endif()

include(CPack)

cpack_add_component(runtime
DISPLAY_NAME "rocDecode Runtime Package"
DESCRIPTION "AMD rocDecode is a high performance video decode SDK for AMD GPUs. \
rocDecode runtime package provides rocDecode library and license.txt")
DISPLAY_NAME "rocdecode Runtime Package"
DESCRIPTION "AMD rocdecode is a high performance video decode SDK for AMD GPUs. \
rocdecode runtime package provides rocdecode library and license.txt")

cpack_add_component(dev
DISPLAY_NAME "rocDecode Develop Package"
DESCRIPTION "AMD rocDecode is a high performance video decode SDK for AMD GPUs. \
rocDecode develop package provides rocDecode header files, and samples")
DISPLAY_NAME "rocdecode Develop Package"
DESCRIPTION "AMD rocdecode is a high performance video decode SDK for AMD GPUs. \
rocdecode develop package provides rocdecode header files, and samples")

cpack_add_component(asan
DISPLAY_NAME "rocDecode ASAN Package"
DESCRIPTION "AMD rocDecode is a high performance video decode SDK for AMD GPUs. \
rocDecode ASAN package provides rocDecode ASAN libraries")
DISPLAY_NAME "rocdecode ASAN Package"
DESCRIPTION "AMD rocdecode is a high performance video decode SDK for AMD GPUs. \
rocdecode ASAN package provides rocdecode ASAN libraries")

cpack_add_component(test
DISPLAY_NAME "rocDecode Test Package"
DESCRIPTION "AMD rocDecode is a high performance video decode SDK for AMD GPUs. \
rocDecode Test package provides rocDecode Test Components")
DISPLAY_NAME "rocdecode Test Package"
DESCRIPTION "AMD rocdecode is a high performance video decode SDK for AMD GPUs. \
rocdecode Test package provides rocdecode Test Components")

else()
message("-- ${Red}AMD ROCm rocDecode -- unmet dependencies${ColourReset}")
message("-- ${Red}AMD ROCm rocdecode -- unmet dependencies${ColourReset}")
if(NOT HIP_FOUND)
message(FATAL_ERROR "-- ERROR!: HIP Not Found! - please install rocm-hip-runtime-dev!")
endif()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ You can find rocDecode Docker containers in our
* Ubuntu - `22.04` / `24.04`
* RHEL - `8` / `9`
* SLES - `15 SP5`
* ROCm: `6.3.0`
* ROCm: `7.0.0`
* libva-amdgpu-dev - `2.16.0`
* mesa-amdgpu-va-drivers - `1:24.3.0`
* FFmpeg - `4.4.2` / `6.1.1`
Expand Down
44 changes: 29 additions & 15 deletions cmake_modules/rocdecode-config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
# - Config file for the rocdecode package
# It defines the following variables
# ROCDECODE_INCLUDE_DIR - include directory for rocdecode
# ROCDECODE_LIB_DIR - library directory for rocdecode
# ROCDECODE_LIBRARY - library to link against
# use rocdecode_INCLUDE_DIR or ROCDECODE_INCLUDE_DIR - include directory for rocdecode
# use rocdecode_LIB_DIR or ROCDECODE_LIB_DIR - library directory for rocdecode
# use rocdecode_LIBRARY or ROCDECODE_LIBRARY - library to link against
# use rocdecode_LIBRARIES or ROCDECODE_LIBRARIES - library to link against

# compute paths
get_filename_component(@PROJECT_NAME@_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)

# version
include(${CMAKE_CURRENT_LIST_DIR}/@[email protected])
set(@PROJECT_NAME@_VERSION ${PACKAGE_VERSION})

# targets
include(${CMAKE_CURRENT_LIST_DIR}/@[email protected])

@PACKAGE_INIT@

# Compute paths
set_and_check(rocdecode_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(ROCDECODE_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(rocDecode_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(rocdecode_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@")
set_and_check(ROCDECODE_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@")
set_and_check(rocDecode_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@")
set_and_check(rocdecode_LIBRARY "@PACKAGE_LIB_INSTALL_DIR@/librocdecode.so")
set_and_check(ROCDECODE_LIBRARY "@PACKAGE_LIB_INSTALL_DIR@/librocdecode.so")
set_and_check(rocDecode_LIBRARY "@PACKAGE_LIB_INSTALL_DIR@/librocdecode.so")
set_and_check(@PROJECT_NAME@_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(@PROJECT_NAME@_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@")
set_and_check(@PROJECT_NAME@_LIBRARY "@PACKAGE_LIB_INSTALL_DIR@/lib@[email protected]")
set_and_check(@PROJECT_NAME@_LIBRARIES "@PACKAGE_LIB_INSTALL_DIR@/lib@[email protected]")

if(NOT TARGET @PROJECT_NAME@::@PROJECT_NAME@)
add_library(@PROJECT_NAME@::@PROJECT_NAME@ INTERFACE IMPORTED)
set_target_properties(@PROJECT_NAME@::@PROJECT_NAME@ PROPERTIES INTERFACE_LINK_LIBRARIES ${@PROJECT_NAME@_LIBRARY})
endif ()

get_filename_component(ROCDECODE_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include("${ROCDECODE_CMAKE_DIR}/rocdecode-targets.cmake")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
@PROJECT_NAME@
FOUND_VAR @PROJECT_NAME@_FOUND
REQUIRED_VARS @PROJECT_NAME@_INCLUDE_DIR @PROJECT_NAME@_LIB_DIR @PROJECT_NAME@_LIBRARY @PROJECT_NAME@_LIBRARIES
VERSION_VAR @PROJECT_NAME@_VERSION
HANDLE_COMPONENTS)
26 changes: 13 additions & 13 deletions samples/rocdecDecode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ set(CMAKE_CXX_STANDARD 17)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../cmake)
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/lib/cmake)

# rocDecode sample build type
# rocdecode sample build type
set(DEFAULT_BUILD_TYPE "Release")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "rocDecode Default Build Type" FORCE)
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "rocdecode Default Build Type" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
Expand All @@ -63,24 +63,24 @@ endif()

find_package(HIP QUIET)
find_package(FFmpeg QUIET)
find_package(ROCDECODE QUIET)
find_package(rocdecode QUIET)

if(HIP_FOUND AND FFMPEG_FOUND AND ROCDECODE_FOUND)
if(HIP_FOUND AND FFMPEG_FOUND AND rocdecode_FOUND)
# HIP
find_library(ROCDECODE_HOST_LIBRARY rocdecodehost PATHS ${ROCM_PATH}/lib)
find_library(rocdecode_HOST_LIBRARY rocdecodehost PATHS ${ROCM_PATH}/lib)
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::host)
# FFMPEG
include_directories(${AVUTIL_INCLUDE_DIR} ${AVCODEC_INCLUDE_DIR}
${AVFORMAT_INCLUDE_DIR})
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${FFMPEG_LIBRARIES})
# rocDecode and utils
include_directories (${ROCDECODE_INCLUDE_DIR} ${ROCM_PATH}/lib)
if(ROCDECODE_HOST_LIBRARY)
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${ROCDECODE_LIBRARY} ${ROCDECODE_HOST_LIBRARY})
# rocdecode and utils
include_directories (${rocdecode_INCLUDE_DIR} ${ROCM_PATH}/lib)
if(rocdecode_HOST_LIBRARY)
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${rocdecode_LIBRARY} ${rocdecode_HOST_LIBRARY})
else()
message(FATAL_ERROR "Library ROCDECODE_HOST_LIBRARY not found!")
message(FATAL_ERROR "Library rocdecode_HOST_LIBRARY not found!")
endif()
# rocDecode
# rocdecode
# sample app exe
list(APPEND SOURCES ${PROJECT_SOURCE_DIR} rocdecdecode.cpp)
add_executable(${PROJECT_NAME} ${SOURCES})
Expand All @@ -94,8 +94,8 @@ else()
if (NOT FFMPEG_FOUND)
message(FATAL_ERROR "-- ERROR!: FFMPEG Not Found! - please install FFMPEG!")
endif()
if (NOT ROCDECODE_FOUND)
message(FATAL_ERROR "-- ERROR!: rocDecode Not Found! - please install rocDecode!")
if (NOT rocdecode_FOUND)
message(FATAL_ERROR "-- ERROR!: rocdecode Not Found! - please install rocdecode!")
endif()
endif()

Loading