Skip to content

Commit

Permalink
[build] only install pkg-config files if CMAKE_INSTALL_LIBDIR is avai…
Browse files Browse the repository at this point in the history
…lable

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).
  • Loading branch information
robUx4 authored and maxsharabayko committed Sep 9, 2022
1 parent 3709471 commit 91a4373
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 91a4373

Please sign in to comment.