From 91a43731df789b66ed4896c3aaca4d8e641b57b4 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 7 Sep 2022 09:34:23 +0200 Subject: [PATCH] [build] only install pkg-config files if CMAKE_INSTALL_LIBDIR is available It wouldn't make a lot of sense to expect pkg-config otherwise. We shouldn't install in CMAKE_INSTALL_LIBDIR if it's not set (it will install in /pkgconfig). --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3be1d1d7..d63792973 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1130,11 +1130,13 @@ endif() join_arguments(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE}) -# haisrt.pc left temporarily for backward compatibility. To be removed in future! -configure_file(scripts/srt.pc.in haisrt.pc @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/haisrt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -configure_file(scripts/srt.pc.in srt.pc @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/srt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +if (DEFINED CMAKE_INSTALL_LIBDIR) + # haisrt.pc left temporarily for backward compatibility. To be removed in future! + configure_file(scripts/srt.pc.in haisrt.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/haisrt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + configure_file(scripts/srt.pc.in srt.pc @ONLY) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/srt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +endif() # Applications