pkgconfig: fix plugindir on macOS where plugins install to lib/ directly (v2-3)#571
Draft
taylorhoward92 wants to merge 1 commit intoOGRECave:v2-3from
Draft
pkgconfig: fix plugindir on macOS where plugins install to lib/ directly (v2-3)#571taylorhoward92 wants to merge 1 commit intoOGRECave:v2-3from
taylorhoward92 wants to merge 1 commit intoOGRECave:v2-3from
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OGRE.pc.indefinesplugindir=${libdir}/@OGRE_NEXT_PREFIX@.On Linux with
OGRE_USE_NEW_PROJECT_NAME=ON, this expands correctlyto
${libdir}/OgreNext.On macOS,
OGRE_PLUGIN_PATHis"/"(plugins install directly intolib/), butOGRE_NEXT_PREFIXis"OGRE", producingplugindir=${libdir}/OGRE— a path that doesn't exist. This causesdownstream 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@inOGRE.pc.in.OGRE_PLUGIN_PATHalready contains the correctplatform-specific suffix:
/@OGRE_NEXT_PREFIX@(e.g./OgreNext) → plugindir unchanged/→ plugindir correctly points to${libdir}/OGRE_PLUGIN_PATHis set inCMake/Utils/OgreConfigTargets.cmake(line 83 of root
CMakeLists.txt) beforeConfigureBuild.cmake(line 625) runs
configure_file, so the variable is in scope.Test plan
pkg-config --variable=plugindir OGREreturns<prefix>/lib/(not<prefix>/lib/OGRE)OGRE_USE_NEW_PROJECT_NAME=ON, verify plugindirreturns
<prefix>/lib/OgreNext(unchanged)