Set CMAKE_INSTALL_RPATH for dynamic builds

When building dynamic libraries, set the RPATH so that binaries know
where to find their libraries.
This commit is contained in:
Nathaniel 2022-01-12 16:55:01 -06:00
parent fe02a13685
commit c833ca646f
No known key found for this signature in database
GPG key ID: B4344309A110851E

View file

@ -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" )