Skip to content

pkgconfig: fix plugindir on macOS where plugins install to lib/ directly#574

Draft
taylorhoward92 wants to merge 1 commit intoOGRECave:masterfrom
taylorhoward92:fix/pkgconfig-plugindir
Draft

pkgconfig: fix plugindir on macOS where plugins install to lib/ directly#574
taylorhoward92 wants to merge 1 commit intoOGRECave:masterfrom
taylorhoward92:fix/pkgconfig-plugindir

Conversation

@taylorhoward92
Copy link
Copy Markdown

Same fix as #571 (targeting v2-3), applied to master.

Summary

OGRE.pc.in defines plugindir=${libdir}/@OGRE_NEXT_PREFIX@.

On Linux with OGRE_USE_NEW_PROJECT_NAME=ON, this expands correctly
to ${libdir}/OgreNext.

On macOS, OGRE_PLUGIN_PATH is "/" (plugins install directly into
lib/), but OGRE_NEXT_PREFIX is "OGRE", producing
plugindir=${libdir}/OGRE — a path that doesn't exist. This causes
downstream consumers using pkg-config (e.g. gz-rendering via
FindGzOGRE2.cmake) to fail at runtime when looking for render-system
plugins.

Changes

Replace @OGRE_NEXT_PREFIX@ with @OGRE_PLUGIN_PATH@ in
OGRE.pc.in. OGRE_PLUGIN_PATH already contains the correct
platform-specific suffix:

  • Linux: /@OGRE_NEXT_PREFIX@ (e.g. /OgreNext) → plugindir unchanged
  • macOS: / → plugindir correctly points to ${libdir}/

OGRE_PLUGIN_PATH is set in CMake/Utils/OgreConfigTargets.cmake
(included early in root CMakeLists.txt) before ConfigureBuild.cmake
runs configure_file, so the variable is in scope.

Test plan

  • Build on macOS, verify pkg-config --variable=plugindir OGRE returns
    <prefix>/lib/ (not <prefix>/lib/OGRE)
  • Build on Linux with OGRE_USE_NEW_PROJECT_NAME=ON, verify plugindir
    returns <prefix>/lib/OgreNext (unchanged)

OGRE.pc.in uses plugindir=${libdir}/@OGRE_NEXT_PREFIX@ which produces
a wrong path on macOS. On macOS, OGRE_PLUGIN_PATH is "/" (plugins
install directly into lib/), but OGRE_NEXT_PREFIX is "OGRE", producing
plugindir=${libdir}/OGRE — a directory that doesn't exist.

Use OGRE_PLUGIN_PATH directly in the template since it already
contains the correct platform-specific subdirectory.

On Linux: OGRE_PLUGIN_PATH="/OgreNext" → plugindir=${libdir}/OgreNext (unchanged)
On macOS: OGRE_PLUGIN_PATH="/" → plugindir=${libdir}/ (correct, was ${libdir}/OGRE)
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.

1 participant