Skip to content

Commit

Permalink
cmake: fix detection of kvazaar struct member (#990)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 16, 2023
1 parent 09d11e2 commit ef7a6eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ endif()
plugin_option(KVAZAAR "kvazaar HEVC encoder" OFF OFF)
if (WITH_KVAZAAR)
find_package(kvazaar)
if (HAVE_KVAZAAR_ENABLE_LOGGING)
if ("${HAVE_KVAZAAR_ENABLE_LOGGING}")
add_definitions(-DHAVE_KVAZAAR_ENABLE_LOGGING=1)
message("HAVE KV")
else ()
add_definitions(-DHAVE_KVAZAAR_ENABLE_LOGGING=0)
message("DONT HAVE KV")
endif ()
endif ()

Expand Down
3 changes: 2 additions & 1 deletion cmake/modules/Findkvazaar.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ set(KVAZAAR_PROCESS_LIBS KVAZAAR_LIBRARY)
set(KVAZAAR_PROCESS_INCLUDES KVAZAAR_INCLUDE_DIR)
libfind_process(KVAZAAR)

set(CMAKE_REQUIRED_INCLUDES ${KVAZAAR_INCLUDE_DIR})
CHECK_STRUCT_HAS_MEMBER("struct kvz_config" enable_logging_output kvazaar.h
HAVE_KVAZAAR_ENABLE_LOGGING LANGUAGE CXX)
set(HAVE_KVAZAAR_ENABLE_LOGGING HAVE_KVAZAAR_ENABLE_LOGGING)
unset(CMAKE_REQUIRED_INCLUDES)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(kvazaar
Expand Down

0 comments on commit ef7a6eb

Please sign in to comment.