diff --git a/CMakeLists.txt b/CMakeLists.txt index 39f51255..6a3be0ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,11 @@ endif () # Note: used as c++ string thus need surrounding " " add_compile_definitions(PROGRAM_VERSION="${PROJECT_VERSION}") +if (LINUX) + # see: config.cc -> getProgramDataDir + add_compile_definitions(PROGRAM_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share/goldendict") +endif () + target_link_libraries(${GOLDENDICT} PRIVATE Qt6::Xml Qt6::Concurrent diff --git a/src/config.cc b/src/config.cc index 64c560a8..3fa553ba 100644 --- a/src/config.cc +++ b/src/config.cc @@ -2276,7 +2276,7 @@ QString getProgramDataDir() noexcept { if ( isPortableVersion() ) return QCoreApplication::applicationDirPath(); - +// TODO: rewrite this in QStandardPaths::AppDataLocation #ifdef PROGRAM_DATA_DIR return PROGRAM_DATA_DIR; #else