From c833ca646f542e7a6d8bc1191c5e9788e6daf741 Mon Sep 17 00:00:00 2001 From: Nathaniel Date: Wed, 12 Jan 2022 16:55:01 -0600 Subject: [PATCH] Set CMAKE_INSTALL_RPATH for dynamic builds When building dynamic libraries, set the RPATH so that binaries know where to find their libraries. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd3383f8..9aca2963 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ set( GRAPHENE_BUILD_DYNAMIC_LIBRARIES OFF CACHE BOOL "Whether to build dynamic libraries instead of static. Applies only to chain, db, protocol, net, and utilities" ) if( GRAPHENE_BUILD_DYNAMIC_LIBRARIES ) set( CMAKE_POSITION_INDEPENDENT_CODE ON ) + set( CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib" ) endif() set( FC_BUILD_DYNAMIC_LIBRARIES ${GRAPHENE_BUILD_DYNAMIC_LIBRARIES} CACHE BOOL "Whether FC should build as a dynamic library rather than static" )