aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/config.cpp10
2 files changed, 11 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7bbc35d..746fb93 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -122,6 +122,8 @@ endif()
add_custom_command(TARGET ${TARGETS_WM} POST_BUILD
COMMAND mkdir -p ${PROJECT_BINARY_DIR}/package/root/lib
COMMAND cp -rf ${PROJECT_BINARY_DIR}/src/${TARGETS_WM}.so ${PROJECT_BINARY_DIR}/package/root/lib
+ COMMAND mkdir -p ${PROJECT_BINARY_DIR}/package/root/etc
+ COMMAND cp -f ${PROJECT_SOURCE_DIR}/layers.json ${PROJECT_BINARY_DIR}/package/root/etc
)
add_custom_target(package DEPENDS ${PROJECT_BINARY_DIR}/package/root
diff --git a/src/config.cpp b/src/config.cpp
index d5a549a..53e014d 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -15,12 +15,20 @@
*/
#include "config.hpp"
+#include "hmi-debug.h"
namespace wm {
config::config() : cfg() {
// Supply default values for these...
- this->cfg["layers.json"] = getenv("LAYERS_JSON") ?: "/etc/windowmanager/layers.json";
+ char const *path_layers_json = getenv("AFM_APP_INSTALL_DIR");
+
+ if (!path_layers_json) {
+ HMI_ERROR("wm", "AFM_APP_INSTALL_DIR is not defined");
+ }
+ else {
+ this->cfg["layers.json"] = std::string(path_layers_json) + std::string("/etc/layers.json");
+ }
}
} // namespace wm