mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Merge pull request #805 from shenlebantongying/fix_cmake_datadir
fix: define PROGRAM_DATA_DIR for cmake
This commit is contained in:
commit
4fc21074ac
|
@ -95,6 +95,11 @@ endif ()
|
||||||
# Note: used as c++ string thus need surrounding " "
|
# Note: used as c++ string thus need surrounding " "
|
||||||
add_compile_definitions(PROGRAM_VERSION="${PROJECT_VERSION}")
|
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
|
target_link_libraries(${GOLDENDICT} PRIVATE
|
||||||
Qt6::Xml
|
Qt6::Xml
|
||||||
Qt6::Concurrent
|
Qt6::Concurrent
|
||||||
|
|
|
@ -2276,7 +2276,7 @@ QString getProgramDataDir() noexcept
|
||||||
{
|
{
|
||||||
if ( isPortableVersion() )
|
if ( isPortableVersion() )
|
||||||
return QCoreApplication::applicationDirPath();
|
return QCoreApplication::applicationDirPath();
|
||||||
|
// TODO: rewrite this in QStandardPaths::AppDataLocation
|
||||||
#ifdef PROGRAM_DATA_DIR
|
#ifdef PROGRAM_DATA_DIR
|
||||||
return PROGRAM_DATA_DIR;
|
return PROGRAM_DATA_DIR;
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue