Use CMAKE_INSTALL_DATADIR to look for the data dir.

This commit is contained in:
Felix Geyer 2015-04-08 18:07:53 +02:00
parent bd3ae05fcf
commit 93ab7eb058
3 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -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

View File

@ -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")) {