Skip to content

Commit

Permalink
CMake: generate a summary of the configuration
Browse files Browse the repository at this point in the history
(cherry picked from commit 79b6ec6)
edited to adapt to existing options
robUx4 committed Jan 19, 2025
1 parent d9391ae commit 09c4e09
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -4,10 +4,27 @@ project(ebml VERSION 1.4.5)

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 libebml 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(ENABLE_WIN32_IO "Build the Windows I/O helper class" OFF)
feature_info_on_off(ENABLE_WIN32_IO "will build Windows I/O code" "will not build Windows I/O code")

include(GNUInstallDirs)

@@ -156,3 +173,7 @@ if(NOT DISABLE_CMAKE_CONFIG)
${CMAKE_CURRENT_BINARY_DIR}/EBMLConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_PACKAGEDIR})
endif()

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

0 comments on commit 09c4e09

Please sign in to comment.