From 29583196dfae2565a35c7a8759cc8a5640d6a2b1 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 9 Feb 2020 00:53:35 +0100 Subject: Use relative directory to locate PROJ resource files. Fixes #1490 This is an extension of the Window-specific logic added recently to Unix builds. This reuses parts of proposed past commit https://github.com/OSGeo/PROJ/pull/1517/commits/82a07e51c6e24ddb936d131ababe29f1ac36ef14 (credits to @abellgithub) --- src/apps/projsync.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/apps/projsync.cpp') diff --git a/src/apps/projsync.cpp b/src/apps/projsync.cpp index 40848f51..61681260 100644 --- a/src/apps/projsync.cpp +++ b/src/apps/projsync.cpp @@ -137,7 +137,12 @@ int main(int argc, char *argv[]) { } else if (arg == "--user-writable-directory") { // do nothing } else if (arg == "--system-directory") { - targetDir = PROJ_LIB; + targetDir = pj_get_relative_share_proj(ctx); +#ifdef PROJ_LIB + if (targetDir.empty()) { + targetDir = PROJ_LIB; + } +#endif } else if (arg == "--target-dir" && i + 1 < argc) { i++; targetDir = argv[i]; -- cgit v1.2.3