Skip to content

Commit

Permalink
cmake: improve summary text of enabled codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 10, 2023
1 parent 88302e1 commit 888d903
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,19 @@ endmacro()

macro(plugin_compilation_info optionVariableName detectionVariable displayName)
if (${detectionVariable}_FOUND AND WITH_${optionVariableName}_PLUGIN AND PLUGIN_LOADING_SUPPORTED_AND_ENABLED)
set(msg "found (plugin)")
set(msg "+ separate plugin")
elseif (${detectionVariable}_FOUND)
set(msg "found (built-in)")
set(msg "+ built-in")
elseif (WITH_${optionVariableName})
set(msg "not found")
set(msg "- not found")
else()
set(msg "disabled")
set(msg "- disabled")
endif ()

message("${displayName}: ${msg}")
string(LENGTH "${displayName}" len)
math(EXPR fill "29 - ${len}")
string(SUBSTRING " " 0 ${fill} filler)
message("${displayName}${filler}: ${msg}")
unset(msg)
endmacro()

Expand All @@ -96,15 +99,13 @@ plugin_option(LIBDE265 "libde265 HEVC decoder" ON OFF)
if (WITH_LIBDE265)
find_package(LIBDE265)
endif()
plugin_compilation_info(LIBDE265 LIBDE265 "libde265")

# x265

plugin_option(X265 "x265 HEVC encoder" ON OFF)
if (WITH_X265)
find_package(X265)
endif()
plugin_compilation_info(X265 X265 "x265")

# kvazaar

Expand All @@ -117,15 +118,13 @@ if (WITH_KVAZAAR)
add_definitions(-DHAVE_KVAZAAR_ENABLE_LOGGING=0)
endif ()
endif ()
plugin_compilation_info(KVAZAAR KVAZAAR "Kvazaar HEVC encoder")

# dav1d

plugin_option(DAV1D "Dav1d AV1 decoder" OFF ON)
if (WITH_DAV1D)
find_package(DAV1D)
endif()
plugin_compilation_info(DAV1D DAV1D "Dav1d AV1 decoder")

# aom

Expand All @@ -134,24 +133,20 @@ plugin_option(AOM_ENCODER "AOM AV1 encoder" ON OFF)
if (WITH_AOM_ENCODER OR WITH_AOM_DECODER)
find_package(AOM)
endif()
plugin_compilation_info(AOM_DECODER AOM "AOM AV1 decoder")
plugin_compilation_info(AOM_ENCODER AOM "AOM AV1 encoder")

# svt

plugin_option(SvtEnc "SVT AV1 encoder" OFF ON)
if (WITH_SvtEnc)
find_package(SvtEnc)
endif()
plugin_compilation_info(SvtEnc SvtEnc "SVT AV1 encoder")

# rav1e

plugin_option(RAV1E "Rav1e AV1 encoder" OFF ON)
if (WITH_RAV1E)
find_package(RAV1E)
endif()
plugin_compilation_info(RAV1E RAV1E "Rav1e AV1 encoder")

# jpeg

Expand All @@ -160,8 +155,6 @@ plugin_option(JPEG_ENCODER "JPEG encoder" OFF OFF)
if (WITH_JPEG_ENCODER OR WITH_JPEG_DECODER)
find_package(JPEG)
endif()
plugin_compilation_info(JPEG_DECODER JPEG "JPEG decoder")
plugin_compilation_info(JPEG_ENCODER JPEG "JPEG encoder")

# openjpeg

Expand All @@ -170,22 +163,37 @@ plugin_option(OpenJPEG_DECODER "OpenJPEG J2K decoder" OFF ON)
if (WITH_OpenJPEG_ENCODER OR WITH_OpenJPEG_DECODER)
find_package(OpenJPEG)
endif()
plugin_compilation_info(OpenJPEG_DECODER OpenJPEG "OpenJPEG J2K decoder")
plugin_compilation_info(OpenJPEG_ENCODER OpenJPEG "OpenJPEG J2K encoder")

# ffmpeg

plugin_option(FFMPEG_HEVC_DECODER "FFMPEG HEVC decoder (HW accelerated)" OFF OFF)
if (WITH_FFMPEG_HEVC_DECODER)
find_package(FFMPEG COMPONENTS avcodec)
endif ()
plugin_compilation_info(FFMPEG_HEVC_DECODER FFMPEG_avcodec "FFMPEG HEVC decoder (HW accelerated)")

# uncompressed

option(WITH_UNCOMPRESSED_CODEC " Support internal ISO/IEC 23001-17 uncompressed codec (experimental) " OFF)


# --- show codec compilation summary

message("=== Summary of compiled codecs ===")
plugin_compilation_info(LIBDE265 LIBDE265 "libde265 HEVC decoder")
plugin_compilation_info(FFMPEG_HEVC_DECODER FFMPEG_avcodec "FFMPEG HEVC decoder (HW acc)")
plugin_compilation_info(X265 X265 "x265 HEVC encoder")
plugin_compilation_info(KVAZAAR KVAZAAR "Kvazaar HEVC encoder")
plugin_compilation_info(AOM_DECODER AOM "AOM AV1 decoder")
plugin_compilation_info(AOM_ENCODER AOM "AOM AV1 encoder")
plugin_compilation_info(DAV1D DAV1D "Dav1d AV1 decoder")
plugin_compilation_info(SvtEnc SvtEnc "SVT AV1 encoder")
plugin_compilation_info(RAV1E RAV1E "Rav1e AV1 encoder")
plugin_compilation_info(JPEG_DECODER JPEG "JPEG decoder")
plugin_compilation_info(JPEG_ENCODER JPEG "JPEG encoder")
plugin_compilation_info(OpenJPEG_DECODER OpenJPEG "OpenJPEG J2K decoder")
plugin_compilation_info(OpenJPEG_ENCODER OpenJPEG "OpenJPEG J2K encoder")


# --- Libsharpyuv color space transforms

option(WITH_LIBSHARPYUV "Build libsharpyuv" ON)
Expand Down

0 comments on commit 888d903

Please sign in to comment.