CMakeLists.txt: allow CMAKE_INSTALL_RPATH to be set empty

this allows the user to override the default non-empty value added in:
b4994eaa CMake: set rpath for shared objects

Bug: webp:592
Change-Id: I069dcbcd8c2f1e8654d9bc98149139f398ac2c93
Fixed: webp:592
This commit is contained in:
James Zern 2023-01-17 18:22:47 -08:00
parent bdf33d03b0
commit d9a505ffb6

View File

@ -101,7 +101,7 @@ endif()
include(cmake/deps.cmake)
include(GNUInstallDirs)
if(BUILD_SHARED_LIBS AND NOT CMAKE_INSTALL_RPATH)
if(BUILD_SHARED_LIBS AND NOT DEFINED CMAKE_INSTALL_RPATH)
# Set the rpath to match autoconf/libtool behavior. Note this must be set
# before target creation.
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")