Skip to content

Use idiomatic GNUInstallDirs for all install paths; fix pkg-config and relocatability#1063

Merged
BYVoid merged 8 commits intomasterfrom
copilot/update-cmakelists-file
Mar 25, 2026
Merged

Use idiomatic GNUInstallDirs for all install paths; fix pkg-config and relocatability#1063
BYVoid merged 8 commits intomasterfrom
copilot/update-cmakelists-file

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

Summary

Replace all hardcoded ${CMAKE_INSTALL_PREFIX}/... path constructions in CMakeLists.txt with proper GNUInstallDirs variables, fix the pkg-config template to respect user override variables, and remove dead code.

Changes

CMakeLists.txt

Relative DIR_* variables via GNUInstallDirs — All DIR_* variables now use relative paths (idiomatic CMake for install() destinations and relocatable package config):

Old (hardcoded absolute) New (GNUInstallDirs relative) Default for /usr/local / /usr
${CMAKE_INSTALL_PREFIX}/include CMAKE_INSTALL_INCLUDEDIR include
${CMAKE_INSTALL_PREFIX}/etc CMAKE_INSTALL_SYSCONFDIR etc / /etc ¹
${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} CMAKE_INSTALL_LIBDIR lib (also handles lib64, multiarch ²)
${CMAKE_INSTALL_PREFIX}/share CMAKE_INSTALL_DATAROOTDIR share

¹ When prefix is /usr, GNUInstallDirs correctly resolves SYSCONFDIR to /etc per GNU Coding Standards. The old code produced the non-standard /usr/etc.

² Master's LIB_SUFFIX only handled lib64. CMAKE_INSTALL_LIBDIR additionally supports Debian multiarch paths like lib/x86_64-linux-gnu.

Absolute DIR_*_FULL variants on demand — A foreach block with an IS_ABSOLUTE guard computes DIR_SHARE_FULL, DIR_INCLUDE_FULL, and DIR_LIBRARY_FULL. These are used only where absolute paths are truly required:

  • Compile-time macros (PKGDATADIR, LOCALEDIR) — needed at runtime to locate dictionaries and config files
  • The opencc.pc.in pkg-config template

Dead code removal:

  • Removed LIB_SUFFIX / LIB_INSTALL_DIR CACHE logic (superseded by CMAKE_INSTALL_LIBDIR)
  • Removed DIR_PREFIX variable (no remaining consumers after opencc.pc.in switched to CMAKE_INSTALL_PREFIX)

Legacy override consistency — All four legacy override variables are preserved and handled consistently:

  • SHARE_INSTALL_PREFIXDIR_SHARE
  • INCLUDE_INSTALL_DIRDIR_INCLUDE
  • SYSCONF_INSTALL_DIRDIR_ETC
  • LIB_INSTALL_DIRDIR_LIBRARY

opencc.pc.in

  • prefix now uses @CMAKE_INSTALL_PREFIX@ directly (was @DIR_PREFIX@, now removed)
  • libdir / includedir now use @DIR_LIBRARY_FULL@ / @DIR_INCLUDE_FULL@ — these are computed after all legacy overrides are applied, so user-supplied -DINCLUDE_INSTALL_DIR=/custom/path is correctly reflected (was broken in an earlier revision)

Side-effect improvements

  • Relocatable CMake package config: $<INSTALL_INTERFACE> in src/CMakeLists.txt and configure_package_config_file(PATH_VARS DIR_INCLUDE) now receive relative paths, making OpenCCConfig.cmake properly relocatable
  • Debian multiarch support: CMAKE_INSTALL_LIBDIR handles lib/x86_64-linux-gnu etc., which the old LIB_SUFFIX approach could not

Files changed

  • CMakeLists.txt — install directory logic rewrite (+27 lines, −10 lines net)
  • opencc.pc.in — switch to absolute _FULL variables and CMAKE_INSTALL_PREFIX

- Apply PR #1062 changes: DIR_INCLUDE → CMAKE_INSTALL_INCLUDEDIR,
  DIR_ETC → CMAKE_INSTALL_SYSCONFDIR, DIR_LIBRARY → CMAKE_INSTALL_LIBDIR
- Similarly update DIR_SHARE → CMAKE_INSTALL_FULL_DATAROOTDIR (absolute,
  required because it feeds PKGDATADIR/LOCALEDIR compile-time definitions)
- Remove LIB_INSTALL_DIR CACHE variable and LIB_SUFFIX dead code (LIB_SUFFIX
  was only used to compute DIR_LIBRARY which now uses CMAKE_INSTALL_LIBDIR
  directly; LIB_INSTALL_DIR was a CACHE variable always overriding DIR_LIBRARY
  with the same value)
- Remove LIB_INSTALL_DIR override block
- Fix opencc.pc.in: use CMAKE_INSTALL_FULL_LIBDIR and
  CMAKE_INSTALL_FULL_INCLUDEDIR for absolute pkg-config paths (GNUInstallDirs
  relative paths would produce broken -L/-I flags)
- Add comments explaining relative vs absolute path choice

Co-authored-by: BYVoid <245270+BYVoid@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BYVoid/OpenCC/sessions/a2b64015-d200-4d3d-b473-55a9be50c4b6
Copilot AI changed the title [WIP] Update CMakeLists for better configuration Use GNUInstallDirs variables throughout CMakeLists; fix pkg-config and dead code Mar 25, 2026
Copilot AI requested a review from BYVoid March 25, 2026 01:36
@BYVoid BYVoid marked this pull request as ready for review March 25, 2026 04:21
Each new variable (CMAKE_INSTALL_INCLUDEDIR, CMAKE_INSTALL_SYSCONFDIR,
CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_FULL_DATAROOTDIR) now has inline
documentation showing:
- Link to https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
- Default relative/absolute values for common prefixes (/usr/local, /usr)
- The old hardcoded path each variable replaces
- SYSCONFDIR special case: /usr prefix gives /etc (not /usr/etc)

Co-authored-by: BYVoid <245270+BYVoid@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BYVoid/OpenCC/sessions/4d6d1872-e7f6-4eb6-bf48-930c0d22928b
Copilot AI changed the title Use GNUInstallDirs variables throughout CMakeLists; fix pkg-config and dead code Use GNUInstallDirs variables in CMakeLists; fix pkg-config paths and dead code Mar 25, 2026
Copilot AI requested a review from BYVoid March 25, 2026 04:27
Copy link
Copy Markdown
Owner

@BYVoid BYVoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup — using GNUInstallDirs properly is the right direction. The verbose documentation block is a nice touch for future maintainers. A few issues to address before merging:

Summary of concerns:

  1. pkg-config regression: opencc.pc.in now uses CMAKE_INSTALL_FULL_* variables directly, which bypasses the legacy override variables (INCLUDE_INSTALL_DIR, LIB_INSTALL_DIR, etc.) that the CMakeLists.txt still supports. A packager using -DINCLUDE_INSTALL_DIR=/custom/path would get the right install layout but a broken .pc file.

  2. Inconsistent removal of LIB_INSTALL_DIR: The override block for LIB_INSTALL_DIR is removed while SHARE_INSTALL_PREFIX, INCLUDE_INSTALL_DIR, and SYSCONF_INSTALL_DIR are kept. Either remove all legacy overrides (with a migration note) or keep all of them.

  3. Mixed relative/absolute DIR_* variables: DIR_SHARE is absolute (CMAKE_INSTALL_FULL_DATAROOTDIR) while the other DIR_* variables are relative. This works but is confusing. Consider keeping all relative and only using the absolute form in the add_definitions() call where it's actually needed.

  4. Dead variable: DIR_PREFIX is no longer used by anything — can be removed.

The core idea is sound, but the interaction between the new GNUInstallDirs variables and the retained legacy override variables needs to be reconciled to avoid subtle breakage for downstream packagers.

Comment thread CMakeLists.txt Outdated
Comment on lines +104 to +107
set (DIR_PREFIX ${CMAKE_INSTALL_PREFIX})
set (DIR_INCLUDE ${DIR_PREFIX}/include)
set (DIR_SHARE ${DIR_PREFIX}/share)
set (DIR_ETC ${DIR_PREFIX}/etc)
set (DIR_LIBRARY ${DIR_PREFIX}/lib${LIB_SUFFIX})
# Relative paths are used for install() destinations and CMake package config
# so that packages remain relocatable.
set (DIR_INCLUDE ${CMAKE_INSTALL_INCLUDEDIR})
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistency: DIR_SHARE is absolute while DIR_INCLUDE, DIR_ETC, DIR_LIBRARY are relative.

DIR_SHARE is set to CMAKE_INSTALL_FULL_DATAROOTDIR (absolute), while the other three use relative GNUInstallDirs variables. The comment explains this is because DIR_SHARE feeds into PKGDATADIR/LOCALEDIR compile-time macros that need absolute paths — that reasoning is sound.

However, DIR_SHARE_OPENCC (derived from DIR_SHARE) is also used as an install(DESTINATION ...) in data/CMakeLists.txt. While CMake does handle absolute DESTINATION paths correctly (including DESTDIR support), mixing relative and absolute destinations in the same project is unusual and can be confusing for future maintainers.

Consider either:

  1. Making all DIR_* variables relative and only using CMAKE_INSTALL_FULL_DATAROOTDIR specifically in the add_definitions() call for the compile-time macros, or
  2. Making all DIR_* variables absolute (using FULL_ variants) for consistency.

Option 1 is the more idiomatic CMake approach — use relative paths for install() destinations and absolute paths only where truly needed (compile-time defines).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 31771ff. DIR_SHARE is now set to the relative CMAKE_INSTALL_DATAROOTDIR (like all other DIR_* variables). Absolute paths are only computed on-demand via a foreach block that applies an IS_ABSOLUTE check — the result is stored in DIR_SHARE_FULL, DIR_INCLUDE_FULL, and DIR_LIBRARY_FULL, which are used exclusively where absolute paths are required: add_definitions(-DPKGDATADIR=...) and the pkg-config template.

Comment thread opencc.pc.in Outdated
Comment on lines +1 to +4
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=@DIR_LIBRARY@
includedir=@DIR_INCLUDE@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: pkg-config now ignores user-provided override variables.

The old .pc.in used @DIR_LIBRARY@ and @DIR_INCLUDE@, which reflected any user overrides via LIB_INSTALL_DIR, INCLUDE_INSTALL_DIR, etc. The new version uses @CMAKE_INSTALL_FULL_LIBDIR@ and @CMAKE_INSTALL_FULL_INCLUDEDIR@ directly, which bypass those overrides entirely.

For example, if a packager passes -DINCLUDE_INSTALL_DIR=/custom/include, the CMakeLists.txt still updates DIR_INCLUDE accordingly (line 99), but the .pc file now ignores it and uses the GNUInstallDirs default instead. This is a regression for downstream users relying on those override variables.

To fix this, either:

  1. Keep using @DIR_INCLUDE@ and @DIR_LIBRARY@ in the .pc.in, but ensure those variables are set to absolute paths (e.g., prepend ${CMAKE_INSTALL_PREFIX}/ when the GNUInstallDirs value is relative), or
  2. Remove the legacy override variables entirely (see my other comment about LIB_INSTALL_DIR).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 31771ff. opencc.pc.in now uses @DIR_LIBRARY_FULL@ and @DIR_INCLUDE_FULL@. These variables are computed after all legacy overrides (LIB_INSTALL_DIR, INCLUDE_INSTALL_DIR, etc.) have been applied, using an IS_ABSOLUTE check to correctly handle both relative GNUInstallDirs defaults and user-supplied absolute paths.

Comment thread CMakeLists.txt
Comment on lines -105 to -107
if (DEFINED LIB_INSTALL_DIR)
set (DIR_LIBRARY ${LIB_INSTALL_DIR})
endif (DEFINED LIB_INSTALL_DIR)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking change: LIB_INSTALL_DIR override removed but similar overrides kept.

The LIB_INSTALL_DIR override block is removed, but SHARE_INSTALL_PREFIX, INCLUDE_INSTALL_DIR, and SYSCONF_INSTALL_DIR are all kept. This is inconsistent — either all legacy overrides should be removed (with a migration note in the PR description pointing users to -DCMAKE_INSTALL_LIBDIR=... instead), or all should be kept for backward compatibility.

Some Linux distro packaging scripts (e.g., older KDE/ECM-style specs) pass -DLIB_INSTALL_DIR=... explicitly. Removing this silently could break their builds without any error — it would just install to the wrong path.

Suggestion: Either keep the LIB_INSTALL_DIR override for consistency, or remove all legacy overrides and document the migration to standard GNUInstallDirs variables (CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_INCLUDEDIR, CMAKE_INSTALL_SYSCONFDIR, CMAKE_INSTALL_DATAROOTDIR).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 31771ff. The LIB_INSTALL_DIR override block is restored. All four legacy overrides (SHARE_INSTALL_PREFIX, INCLUDE_INSTALL_DIR, SYSCONF_INSTALL_DIR, LIB_INSTALL_DIR) are now treated consistently.

Comment thread CMakeLists.txt Outdated
# Full/absolute form is required here because the value is baked into the
# binary as PKGDATADIR/LOCALEDIR at compile time for runtime data lookup.

set (DIR_PREFIX ${CMAKE_INSTALL_PREFIX})
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: DIR_PREFIX is now unused except as a vestigial variable.

With DIR_INCLUDE, DIR_SHARE, DIR_ETC, and DIR_LIBRARY no longer derived from DIR_PREFIX, this variable has no remaining consumers (it was only referenced in opencc.pc.in which now uses CMAKE_INSTALL_PREFIX directly). Consider removing it to avoid dead code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 31771ff.

…_INSTALL_DIR, fix pc.in

- Make DIR_SHARE relative (CMAKE_INSTALL_DATAROOTDIR) like all other DIR_* variables
- Compute DIR_*_FULL absolute variants (via IS_ABSOLUTE check) for uses that
  require absolute paths: add_definitions(PKGDATADIR/LOCALEDIR) and the pc file
- Restore LIB_INSTALL_DIR override block (removed in previous commit) so all
  four legacy overrides are now treated consistently
- Remove dead DIR_PREFIX variable
- Fix opencc.pc.in: use @DIR_LIBRARY_FULL@ / @DIR_INCLUDE_FULL@ so legacy
  override variables (LIB_INSTALL_DIR, INCLUDE_INSTALL_DIR) are correctly
  reflected in the generated pkg-config file
- Update parity comment: s/CMAKE_INSTALL_FULL_DATAROOTDIR/CMAKE_INSTALL_DATAROOTDIR/

Co-authored-by: BYVoid <245270+BYVoid@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BYVoid/OpenCC/sessions/4215d006-8491-4f30-a125-94c14523e0e3
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 25, 2026

Thanks for the cleanup — using GNUInstallDirs properly is the right direction. The verbose documentation block is a nice touch for future maintainers. A few issues to address before merging:

**Su...

All four points addressed in 31771ff:

  1. pkg-config regressionopencc.pc.in now uses @DIR_LIBRARY_FULL@ / @DIR_INCLUDE_FULL@, computed after all legacy overrides are applied. -DINCLUDE_INSTALL_DIR=/custom/path now correctly produces includedir=/custom/path in the .pc file.
  2. Inconsistent LIB_INSTALL_DIR removal — the override block is restored; all four legacy overrides are now handled identically.
  3. Mixed relative/absolute DIR_*DIR_SHARE now uses the relative CMAKE_INSTALL_DATAROOTDIR. A foreach block with an IS_ABSOLUTE guard computes DIR_*_FULL absolute variants used only where absolute paths are needed (add_definitions, .pc file).
  4. Dead DIR_PREFIX — removed.

Copilot AI requested a review from BYVoid March 25, 2026 04:54
Copy link
Copy Markdown
Owner

@BYVoid BYVoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All previous concerns have been addressed cleanly:

  • Relative/absolute consistency: All DIR_* variables are now relative, with DIR_*_FULL absolute variants computed on-demand via foreach + IS_ABSOLUTE — this is the idiomatic approach.
  • pkg-config override support: opencc.pc.in now uses DIR_LIBRARY_FULL / DIR_INCLUDE_FULL, which correctly reflect legacy overrides.
  • LIB_INSTALL_DIR restored: All four legacy override variables are handled consistently.
  • DIR_PREFIX removed: No dead code.

One minor nit left inline (duplicated /opencc and /locale suffixes in add_definitions), but nothing blocking. LGTM.

Comment thread CMakeLists.txt Outdated
Comment on lines +182 to +183
-DPKGDATADIR="${DIR_SHARE_FULL}/opencc"
-DLOCALEDIR="${DIR_SHARE_FULL}/locale"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: DIR_SHARE_OPENCC and DIR_SHARE_LOCALE are already defined above (lines 125-126) as ${DIR_SHARE}/opencc and ${DIR_SHARE}/locale. Here the /opencc and /locale suffixes are duplicated with DIR_SHARE_FULL.

Not a correctness issue since both produce the same result, but you could consider adding a DIR_SHARE_OPENCC_FULL / DIR_SHARE_LOCALE_FULL alongside the existing derived variables to keep the suffix in one place, or just reference these directly as ${DIR_SHARE_FULL}/opencc. Either way is fine — just flagging the duplication.

Copy link
Copy Markdown
Owner

BYVoid commented Mar 25, 2026

Deeper review — downstream consumer analysis

I traced all consumers of the DIR_* variables across the project to verify correctness of the updated (relative) paths. Summary:

Improved behavior (bonus)

  1. $<INSTALL_INTERFACE:${DIR_INCLUDE}/opencc> in src/CMakeLists.txt:135 — With DIR_INCLUDE now relative (include), this becomes $<INSTALL_INTERFACE:include/opencc>. This is actually better than master, where the absolute path made the installed CMake target non-relocatable. Relative INSTALL_INTERFACE paths are the idiomatic CMake approach.

  2. configure_package_config_file(... PATH_VARS DIR_INCLUDE) in CMakeLists.txt:141 — With a relative DIR_INCLUDE, configure_package_config_file now generates a relocatable OpenCCConfig.cmake (using @PACKAGE_DIR_INCLUDE@). On master, the absolute path defeated relocatability.

  3. Debian multiarch support — Master's LIB_SUFFIX only handled lib64. The new CMAKE_INSTALL_LIBDIR properly handles lib/x86_64-linux-gnu and similar multiarch paths out of the box.

Verified correct — no issues

Consumer File Relative path OK?
install(DESTINATION ${DIR_LIBRARY}/pkgconfig) CMakeLists.txt:128 install() prepends prefix
install(DESTINATION ${DIR_LIBRARY}/cmake/opencc) CMakeLists.txt:140,149 ✅ same
install(DESTINATION ${DIR_SHARE_OPENCC}) data/CMakeLists.txt ✅ same
install(DESTINATION ${DIR_SHARE_OPENCC}/doc) doc/CMakeLists.txt ✅ same
install(DESTINATION ${DIR_LIBRARY}) src/CMakeLists.txt:171-172 ✅ same
install(DESTINATION ${DIR_INCLUDE}/opencc) src/CMakeLists.txt:185 ✅ same
PKGDATADIR / LOCALEDIR compile-time macros CMakeLists.txt:182-183 ✅ uses DIR_SHARE_FULL (absolute)
opencc.pc.in libdir/includedir opencc.pc.in:3-4 ✅ uses DIR_LIBRARY_FULL / DIR_INCLUDE_FULL

Minor observations (non-blocking)

  • DIR_ETC is set but has no consumers anywhere in the project (true on master too). Could be cleaned up in a future PR.
  • _gnu_dir loop variable from the foreach block leaks into the parent scope. A unset(_gnu_dir) after the loop is good CMake hygiene but not required.

CI status

Several checks already passing (sort-check, CodeQL, Analyze, some Node.js and Python builds). Remaining builds still in progress — no failures observed.

…avoid suffix duplication

Introduce DIR_SHARE_OPENCC_FULL and DIR_SHARE_LOCALE_FULL by appending the
/opencc and /locale suffixes to DIR_SHARE_FULL once, keeping the suffix in a
single location. Use these in add_definitions() instead of inline expansion.

Co-authored-by: BYVoid <245270+BYVoid@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BYVoid/OpenCC/sessions/81a83abd-8b46-4cdb-9768-6ccaeeb287e9
Copilot AI changed the title Use GNUInstallDirs variables in CMakeLists; fix pkg-config paths and dead code CMakeLists: consistent GNUInstallDirs usage, fix pkg-config overrides, remove dead code Mar 25, 2026
Copilot AI requested a review from BYVoid March 25, 2026 05:24
DIR_SHARE_LOCALE (relative) was only defined but never consumed.
DIR_SHARE_LOCALE_FULL was only used in add_definitions(), where the
suffix /locale can be inlined directly against DIR_SHARE_FULL.
Keep DIR_SHARE_OPENCC (used by install() in data/ and doc/) and
DIR_SHARE_OPENCC_FULL (used in add_definitions()) as both are needed.

Co-authored-by: BYVoid <245270+BYVoid@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BYVoid/OpenCC/sessions/8bb2a2da-c659-4eaf-bec0-07ee0a2d3eb0
Copilot AI changed the title CMakeLists: consistent GNUInstallDirs usage, fix pkg-config overrides, remove dead code CMake: remove unused DIR_SHARE_LOCALE/_FULL variables Mar 25, 2026
@BYVoid BYVoid changed the title CMake: remove unused DIR_SHARE_LOCALE/_FULL variables Use idiomatic GNUInstallDirs for all install paths; fix pkg-config and relocatability Mar 25, 2026
Copy link
Copy Markdown
Owner

BYVoid commented Mar 25, 2026

Inconsistency: LOCALEDIR still inlines the /locale suffix

After the latest commits, PKGDATADIR correctly uses DIR_SHARE_OPENCC_FULL, but LOCALEDIR still uses ${DIR_SHARE_FULL}/locale:

add_definitions(
  -DPKGDATADIR="${DIR_SHARE_OPENCC_FULL}"
  -DLOCALEDIR="${DIR_SHARE_FULL}/locale"     # ← inconsistent
)

Meanwhile DIR_SHARE_LOCALE was removed in 876c024. Both macros should follow the same pattern.

Fix: restore DIR_SHARE_LOCALE, add DIR_SHARE_LOCALE_FULL, and use it:

set (DIR_SHARE_OPENCC ${DIR_SHARE}/opencc)
set (DIR_SHARE_LOCALE ${DIR_SHARE}/locale)

# ... foreach block ...

set (DIR_SHARE_OPENCC_FULL ${DIR_SHARE_FULL}/opencc)
set (DIR_SHARE_LOCALE_FULL ${DIR_SHARE_FULL}/locale)

# ...

add_definitions(
  -DPKGDATADIR="${DIR_SHARE_OPENCC_FULL}"
  -DLOCALEDIR="${DIR_SHARE_LOCALE_FULL}"
)

I've pushed this fix to claude/review-opencc-pr-1063-yFEz2 (commit 814eee1) if you'd like to cherry-pick it.

BYVoid added 2 commits March 24, 2026 22:52
Restore DIR_SHARE_LOCALE and add DIR_SHARE_LOCALE_FULL so both
compile-time macros (PKGDATADIR, LOCALEDIR) use dedicated _FULL
variables instead of mixing variable and inline suffix styles.
@BYVoid BYVoid merged commit f88449c into master Mar 25, 2026
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants