Skip to content

Commit

Permalink
Merge pull request #215 from robUx4/1x-shared
Browse files Browse the repository at this point in the history
[1.x] add option summary
  • Loading branch information
mbunkus authored Jan 25, 2025
2 parents fa0ecda + 70d286d commit 6a2f9fc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,32 @@ cmake_minimum_required(VERSION 3.1.2)

project(matroska VERSION 1.7.1)

include(CMakeDependentOption)

include( FeatureSummary )
function(feature_info_on_off)
set(option_name ${ARGV0})
if(${option_name})
add_feature_info(${option_name} ${option_name} ${ARGV1})
else()
add_feature_info(${option_name} $<NOT:${option_name}> ${ARGV2})
endif()
endfunction(feature_info_on_off)

cmake_dependent_option(BUILD_SHARED_LIBS "Build libmatroska as a shared library (except Windows)" OFF "NOT WIN32" OFF)
feature_info_on_off(BUILD_SHARED_LIBS "will build as a dynamic library" "will build as a static library")

option(DISABLE_PKGCONFIG "Disable PkgConfig module generation" OFF)
feature_info_on_off(DISABLE_PKGCONFIG "won't generate pkgconfig config file" "will generate pkgconfig config file")

option(DISABLE_CMAKE_CONFIG "Disable CMake package config module generation" OFF)
feature_info_on_off(DISABLE_CMAKE_CONFIG "won't generate CMake config file" "will generate CMake config file")

option(BUILD_EXAMPLES "Build example code" OFF)
feature_info_on_off(BUILD_EXAMPLES "will build example code" "will build without example code")

find_package(EBML 1.4.3 REQUIRED)
set_package_properties(EBML PROPERTIES DESCRIPTION "libebml")

include(GNUInstallDirs)

Expand Down Expand Up @@ -146,3 +167,7 @@ if(NOT DISABLE_CMAKE_CONFIG)
${CMAKE_CURRENT_BINARY_DIR}/MatroskaConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_PACKAGEDIR})
endif()

feature_summary(DESCRIPTION "libmatroska options:" WHAT ENABLED_FEATURES)
feature_summary(DESCRIPTION "libmatroska disabled options:" WHAT DISABLED_FEATURES)
feature_summary(DESCRIPTION "libmatroska packages used:" WHAT PACKAGES_FOUND)

0 comments on commit 6a2f9fc

Please sign in to comment.