@@ -60,30 +60,36 @@ find_package(ApMon MODULE)
6060find_package (CURL MODULE)
6161find_package (RdKafka CONFIG)
6262
63+ ####################################
64+ # Set OUTPUT vars
65+ ####################################
66+
67+ set (LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR} /lib" )
68+ set (EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR} /bin" )
69+ set (INCLUDE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR} /include" )
70+
6371####################################
6472# Handle RPATH
6573####################################
6674include (GNUInstallDirs)
6775
68- # Build targets with install rpath on Mac to dramatically speed up installation
76+ # Use relative RPATHs
6977set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE )
7078list (FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX} /${CMAKE_INSTALL_LIBDIR} " isSystemDir)
71- if (CMAKE_SYSTEM_NAME STREQUAL "Darwin " )
72- if (" ${isSystemDir} " STREQUAL "-1 " )
79+ if (" ${isSystemDir} " STREQUAL "-1 " )
80+ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin " )
7381 set (CMAKE_INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR} " )
7482 endif ()
75- set (CMAKE_BUILD_WITH_INSTALL_RPATH TRUE )
83+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
84+ set (CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR} " )
85+ endif ()
7686endif ()
7787unset (isSystemDir)
7888
7989####################################
8090# Library
8191####################################
8292
83- set (LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR} /lib" )
84- set (EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR} /bin" )
85- set (INCLUDE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR} /include" )
86-
8793# Backends
8894message (STATUS "Backends" )
8995message (STATUS " Compiling StdCout backend" )
0 commit comments