Skip to content

pkgconfig: fix plugindir on macOS where plugins install to lib/ directly (v2-3)#571

Draft
taylorhoward92 wants to merge 1 commit intoOGRECave:v2-3from
taylorhoward92:fix/pkgconfig-plugindir-v2-3
Draft

pkgconfig: fix plugindir on macOS where plugins install to lib/ directly (v2-3)#571
taylorhoward92 wants to merge 1 commit intoOGRECave:v2-3from
taylorhoward92:fix/pkgconfig-plugindir-v2-3

Conversation

@taylorhoward92
Copy link
Copy Markdown

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
(line 83 of root CMakeLists.txt) before ConfigureBuild.cmake
(line 625) 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)
@taylorhoward92 taylorhoward92 changed the title pkgconfig: fix plugindir on macOS where plugins install to lib/ directly pkgconfig: fix plugindir on macOS where plugins install to lib/ directly (v2-3) Apr 10, 2026
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