cmake: Add config-file package MPEG dependency

This commit is contained in:
evpobr 2021-12-16 12:17:11 +05:00
parent 59f1622c42
commit 77acc6d362
2 changed files with 12 additions and 0 deletions

View File

@ -829,6 +829,12 @@ if (ENABLE_PACKAGE_CONFIG)
set (SndFile_WITH_EXTERNAL_LIBS 0)
endif ()
if(ENABLE_MPEG)
set (SndFile_WITH_MPEG 1)
else ()
set (SndFile_WITH_MPEG 0)
endif ()
set (INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
configure_package_config_file(cmake/SndFileConfig.cmake.in SndFileConfig.cmake
INSTALL_DESTINATION ${PROJECT_BINARY_DIR}

View File

@ -4,6 +4,7 @@ set(SndFile_VERSION_MINOR @PROJECT_VERSION_MINOR@)
set(SndFile_VERSION_PATCH @PROJECT_VERSION_PATCH@)
set (SndFile_WITH_EXTERNAL_LIBS @SndFile_WITH_EXTERNAL_LIBS@)
set (SndFile_WITH_MPEG @SndFile_WITH_MPEG@)
@PACKAGE_INIT@
@ -16,6 +17,11 @@ if (SndFile_WITH_EXTERNAL_LIBS AND NOT @BUILD_SHARED_LIBS@)
find_dependency (Opus)
endif ()
if (SndFile_WITH_MPEG AND NOT @BUILD_SHARED_LIBS@)
find_dependency (Lame)
find_dependency (MPG123)
endif ()
include (${CMAKE_CURRENT_LIST_DIR}/SndFileTargets.cmake)
set_and_check (SndFile_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")