Make pkgconfig such that sndfile is only linked if required

This commit is contained in:
Jean Pierre Cimalando 2021-04-16 15:50:34 +02:00
parent 5912b97cee
commit 423aebaafc
2 changed files with 5 additions and 1 deletions

View file

@ -7,6 +7,6 @@ Name: @PROJECT_NAME@
Description: @PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@
Requires.private: sndfile
Requires.private:@SFIZZ_PC_REQUIRES@
Libs: -L${libdir} -l@PROJECT_NAME@
Cflags: -I${includedir}

View file

@ -333,6 +333,10 @@ if(SFIZZ_SHARED)
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT "runtime"
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT "development"
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT "development")
set(SFIZZ_PC_REQUIRES "")
if(SFIZZ_USE_SNDFILE)
set(SFIZZ_PC_REQUIRES "${SFIZZ_PC_REQUIRES} sndfile")
endif()
configure_file(${PROJECT_SOURCE_DIR}/scripts/sfizz.pc.in sfizz.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/src/sfizz.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig