Manually search for rocdecode and rocjpeg libraries in cmake (#294)

* Manually search for rocdecode ad rocjpeg libraries

* Update examples/jpegdecode/CMakeLists.txt

Fix typo.

Co-authored-by: David Galiffi <David.Galiffi@amd.com>

---------

Co-authored-by: David Galiffi <David.Galiffi@amd.com>

[ROCm/rocprofiler-systems commit: f4e9846e1c]
This commit is contained in:
Sajina PK
2025-07-21 14:07:00 -04:00
committed by GitHub
parent 1a57db0395
commit aa9b265302
2 changed files with 86 additions and 6 deletions
@@ -54,8 +54,48 @@ function(videodecode_message _MSG_TYPE)
endfunction()
# Find RocDecode
find_package(rocdecode QUIET)
if(NOT rocdecode_FOUND)
find_path(
rocdecode_ROOT_DIR
NAMES include/rocdecode/rocdecode.h
HINTS ${ROCmVersion_DIR} ${ROCM_PATH}
PATHS ${ROCmVersion_DIR} ${ROCM_PATH}
)
mark_as_advanced(rocdecode_ROOT_DIR)
find_path(
rocdecode_INCLUDE_DIR
NAMES rocdecode/rocdecode.h
HINTS ${rocdecode_ROOT_DIR}
PATHS ${rocdecode_ROOT_DIR}
PATH_SUFFIXES include
)
find_library(
rocdecode_LIBRARY
NAMES rocdecode
HINTS ${rocdecode_ROOT_DIR}
PATHS ${rocdecode_ROOT_DIR}
PATH_SUFFIXES lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
rocdecode
FOUND_VAR rocdecode_FOUND
REQUIRED_VARS rocdecode_INCLUDE_DIR rocdecode_LIBRARY
)
if(rocdecode_FOUND)
if(NOT TARGET rocdecode::rocdecode)
add_library(rocdecode::rocdecode INTERFACE IMPORTED)
target_link_libraries(rocdecode::rocdecode INTERFACE ${rocdecode_LIBRARY})
target_include_directories(
rocdecode::rocdecode
INTERFACE ${rocdecode_INCLUDE_DIR}
)
endif()
else()
videodecode_message(AUTHOR_WARNING "${PROJECT_NAME} skipped. Missing RocDecode...")
return()
endif()