Skip to content

Commit

Permalink
Fix FindIgnOgre on Windows when not using vcpkg
Browse files Browse the repository at this point in the history
The current version of FindIgnOgre contains a vcpkg-specific workaround on the location of the OgreMain
library, that is fixed to point to the "${OGRE_LIBRARY_DIRS}/manual-link/" directory, that it is its location when
Ogre is installed by vcpkg. However, this creates a problem when installing Ogre with other package managers 
on Windows, for example when using conda-forge or conan. To mitigate this problem, we only set the location of
the OgreMain library to be "${OGRE_LIBRARY_DIRS}/manual-link/" only if this directory exists, that is only true for
vcpkg installations.
  • Loading branch information
traversaro authored Nov 8, 2020
1 parent c8a4718 commit 51a43e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/FindIgnOGRE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ else()
set(prefix "")
# vcpkg uses special directory (lib/manual-link/) to place libraries
# with main sysmbol like OgreMain.
if(ogre_lib MATCHES "OgreMain" AND NOT IS_ABSOLUTE "${ogre_lib}")
if(ogre_lib MATCHES "OgreMain" AND NOT IS_ABSOLUTE "${ogre_lib}" AND EXISTS "${OGRE_LIBRARY_DIRS}/manual-link/")
set(prefix "${OGRE_LIBRARY_DIRS}/manual-link/")
elseif(ogre_lib MATCHES "Ogre" AND NOT IS_ABSOLUTE "${ogre_lib}")
set(prefix "${OGRE_LIBRARY_DIRS}/")
Expand Down

0 comments on commit 51a43e8

Please sign in to comment.