From a59077d52d20c73c2a0614ba62ca9e74db050ebf Mon Sep 17 00:00:00 2001 From: Kibak Yoon Date: Tue, 6 Jan 2015 00:56:18 +0900 Subject: [PATCH] sensord: use LIBDIR macro for finding library path Signed-off-by: Kibak Yoon Change-Id: Ia9ae92b3213f5ea9b0121c39e9137f9fe1b9274e --- CMakeLists.txt | 1 + src/shared/sensor_plugin_loader.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5381991..5228178 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ set(PROJECT_RELEASE_VERSION "1") set(CMAKE_VERBOSE_MAKEFILE OFF) add_definitions(-Wall -O3 -omit-frame-pointer) add_definitions(-DUSE_DLOG_LOG) +add_definitions(-DLIBDIR="${LIBDIR}") #add_definitions(-Wall -g -D_DEBUG) FIND_PROGRAM(UNAME NAMES uname) diff --git a/src/shared/sensor_plugin_loader.cpp b/src/shared/sensor_plugin_loader.cpp index 5a096a9..d26a773 100755 --- a/src/shared/sensor_plugin_loader.cpp +++ b/src/shared/sensor_plugin_loader.cpp @@ -39,7 +39,7 @@ using std::unordered_set; #define SENSOR_ELEMENT "SENSOR" #define PLUGINS_CONFIG_PATH "/usr/etc/sensor_plugins.xml" -#define PLUGINS_DIR_PATH "/usr/lib/sensord" +#define PLUGINS_DIR_PATH "/sensord" #define SENSOR_INDEX_SHIFT 16 @@ -146,7 +146,7 @@ bool sensor_plugin_loader::load_plugins(void) vector unique_hal_paths, unique_sensor_paths; get_paths_from_config(string(PLUGINS_CONFIG_PATH), hal_paths, sensor_paths); - get_paths_from_dir(string(PLUGINS_DIR_PATH), hal_paths, sensor_paths); + get_paths_from_dir(string(LIBDIR) + string(PLUGINS_DIR_PATH), hal_paths, sensor_paths); //remove duplicates while keeping the original ordering => unique_*_paths unordered_set s; -- 2.7.4