MXS-2366: Fix RPATH setting for tarball

All RPATH setting have to be set before generation of any binary.
Defining of CMAKE_INSTALL_RPATH is moved to separate file which is called from main CMakeLists.txt in the beginning, just after install_layout.cmake
This commit is contained in:
Timofey Turenko
2019-04-30 14:18:33 +03:00
parent 64a8288f66
commit 753fa0552a
3 changed files with 12 additions and 4 deletions

8
cmake/rpath.cmake Normal file
View File

@ -0,0 +1,8 @@
if(PACKAGE AND TARBALL)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}/maxscale" CACHE PATH "" FORCE)
else()
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/${MAXSCALE_LIBDIR})
endif()