Fix CMake error caused by relative RPATH.
PiperOrigin-RevId: 934847161 Change-Id: I7dce4161a8d8076d2d2c1c7b3234844733c5e8b0
This commit is contained in:
committed by
Copybara-Service
parent
976476c482
commit
f663139256
@@ -80,11 +80,13 @@ function(
|
|||||||
_bin_dir
|
_bin_dir
|
||||||
_lib_dir
|
_lib_dir
|
||||||
)
|
)
|
||||||
|
get_filename_component(_bin_dir_abs "${_bin_dir}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
|
||||||
|
get_filename_component(_lib_dir_abs "${_lib_dir}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
|
||||||
file(
|
file(
|
||||||
RELATIVE_PATH
|
RELATIVE_PATH
|
||||||
_rel_path
|
_rel_path
|
||||||
${_bin_dir}
|
${_bin_dir_abs}
|
||||||
${_lib_dir}
|
${_lib_dir_abs}
|
||||||
)
|
)
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
set(${_output_var}
|
set(${_output_var}
|
||||||
@@ -100,6 +102,9 @@ function(
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(target_add_rpath)
|
function(target_add_rpath)
|
||||||
|
if(WIN32)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
set(_options USE_LINK_PATH)
|
set(_options USE_LINK_PATH)
|
||||||
set(_oneValueArgs INSTALL_NAME_DIR INSTALL_DIRECTORY)
|
set(_oneValueArgs INSTALL_NAME_DIR INSTALL_DIRECTORY)
|
||||||
set(_multiValueArgs TARGETS LIB_DIRS DEPENDS)
|
set(_multiValueArgs TARGETS LIB_DIRS DEPENDS)
|
||||||
|
|||||||
Reference in New Issue
Block a user