Significant rewrite of cmake manifest: move to fixed RPATH for libraries
This commit is contained in:
parent
febd206969
commit
bc13f83310
|
@ -44,15 +44,18 @@ if (ENABLE_BUILD_IN_CPP_11_CUSTOM_ENVIRONMENT)
|
|||
|
||||
# Disable warning from Boost when compiling with gcc 5.2
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-deprecated-declarations")
|
||||
|
||||
# Specify full RPATH for build tree
|
||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
|
||||
# Create builds in current folder with install RPATH
|
||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
|
||||
SET(CMAKE_INSTALL_RPATH "/opt/gcc520/lib64;/opt/boost_1_58_0/stage/lib;/opt/libhiredis_0_13/lib;/opt/log4cpp1.1.1/lib;/opt/luajit_2.0.4/lib;/opt/ndpi/lib;/opt/pf_ring_6.0.3/lib;/opt/json-c-0.12/lib;/opt/mongo_c_driver_1_1_9/lib")
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};/opt/gcc520/lib64;/opt/boost_1_58_0/stage/lib")
|
||||
endif()
|
||||
|
||||
# Specify full RPATH for build tree
|
||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
|
||||
# Create builds in current folder with install RPATH
|
||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
|
||||
# /opt/libgobgp_1_0_0/lib should be mentioned here explicitly!!!! We link it in runtime
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};/opt/libhiredis_0_13/lib;/opt/log4cpp1.1.1/lib;/opt/luajit_2.0.4/lib;/opt/ndpi/lib;/opt/pf_ring_6.0.3/lib;/opt/json-c-0.12/lib;/opt/mongo_c_driver_1_1_9/lib;/opt/libgobgp_1_0_0/lib;/opt/grpc_0_11_1_7a94236d698477636dd06282f12f706cad527029/lib;/opt/protobuf_3.0.0_alpha4/lib")
|
||||
|
||||
message(STATUS "C++ compilation flags: ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
|
||||
|
@ -244,7 +247,11 @@ if (ENABLE_GOBGP_SUPPORT)
|
|||
|
||||
if (GOBGP_INCLUDES_FOLDER AND GOBGP_LIBRARY_PATH)
|
||||
message(STATUS "We found libgobgp and will link it: ${GOBGP_INCLUDES_FOLDER} ${GOBGP_LIBRARY_PATH}")
|
||||
target_link_libraries(gobgp_action ${GOBGP_LIBRARY_PATH})
|
||||
|
||||
### We do not link with it in compilation time because it broke daemonization code and pope
|
||||
### So we use runtime dynamic linking
|
||||
### target_link_libraries(gobgp_action ${GOBGP_LIBRARY_PATH})
|
||||
target_link_libraries(gobgp_action dl)
|
||||
include_directories(${GOBGP_INCLUDES_FOLDER})
|
||||
else()
|
||||
message(FATAL_ERROR "Could not find libgobgp")
|
||||
|
|
Loading…
Reference in New Issue