From 93ab7eb0583bab011fd71d71a0942f29539532b3 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Wed, 8 Apr 2015 18:07:53 +0200 Subject: [PATCH] Use CMAKE_INSTALL_DATADIR to look for the data dir. --- CMakeLists.txt | 6 +++--- src/config-keepassx.h.cmake | 2 ++ src/core/FilePath.cpp | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3532c46f8..8bc6e316f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,9 +149,9 @@ elseif(APPLE) else() include(GNUInstallDirs) - set(BIN_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}") - set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/keepassx") - set(DATA_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/keepassx") + set(BIN_INSTALL_DIR "${CMAKE_INSTALL_FULL_BINDIR}") + set(PLUGIN_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/keepassx") + set(DATA_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/keepassx") endif() if(WITH_TESTS) diff --git a/src/config-keepassx.h.cmake b/src/config-keepassx.h.cmake index 805700a9f..305da341f 100644 --- a/src/config-keepassx.h.cmake +++ b/src/config-keepassx.h.cmake @@ -10,6 +10,8 @@ #define KEEPASSX_PLUGIN_DIR "${PLUGIN_INSTALL_DIR}" +#define KEEPASSX_DATA_DIR "${DATA_INSTALL_DIR}" + #cmakedefine HAVE_PR_SET_DUMPABLE 1 #cmakedefine HAVE_RLIMIT_CORE 1 #cmakedefine HAVE_PT_DENY_ATTACH 1 diff --git a/src/core/FilePath.cpp b/src/core/FilePath.cpp index 52db1ed28..e414fdec1 100644 --- a/src/core/FilePath.cpp +++ b/src/core/FilePath.cpp @@ -173,6 +173,8 @@ FilePath::FilePath() #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) else if (testSetDir(QCoreApplication::applicationDirPath() + "/../share/keepassx")) { } + else if (testSetDir(KEEPASSX_DATA_DIR)) { + } #endif #ifdef Q_OS_MAC else if (testSetDir(QCoreApplication::applicationDirPath() + "/../Resources")) {