I am getting the following error with CMake when finding the CMake package for OGRE:
-- Found OGRE CMake module in directory: /usr/share/OGRE/cmake/modules
CMake Error at /usr/share/OGRE/cmake/modules/OgreTargets.cmake:168 (message):
The imported target "OgreGLSupport" references the file
"/usr/lib/x86_64-linux-gnu/libOgreGLSupport.a"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/share/OGRE/cmake/modules/OgreTargets.cmake"
but not all the files it references.
My filesystem contains the following OGRE libraries:
ls /usr/lib/x86_64-linux-gnu/libOgre
libOgreBites.so libOgreMain.so libOgreOverlay.so libOgreProperty.so libOgreTerrain.so
libOgreBites.so.1.12.4 libOgreMain.so.1.12.4 libOgreOverlay.so.1.12.4 libOgreProperty.so.1.12.4 libOgreTerrain.so.1.12.4
libOgreHLMS.so libOgreMeshLodGenerator.so libOgrePaging.so libOgreRTShaderSystem.so libOgreVolume.so
libOgreHLMS.so.1.12.4 libOgreMeshLodGenerator.so.1.12.4 libOgrePaging.so.1.12.4 libOgreRTShaderSystem.so.1.12.4 libOgreVolume.so.1.12.4
Why does it require the static library?
This is my CMake code:
# NOTE search for OGRE before searching for KDE since KDE changes the variable CMAKE_MODULE_PATH
# OGRE does not install the CMake file into the module path. It uses the library path instead.
find_path(OGRE_CMAKE_MODULE_DIR FindOGRE.cmake PATHS ${CMAKE_MODULE_PATH})
message(STATUS "Searching for OGRE in ${CMAKE_MODULE_PATH}")
if (NOT OGRE_CMAKE_MODULE_DIR)
find_path(OGRE_CMAKE_MODULE_DIR FindOGRE.cmake PATHS ${CMAKE_SYSTEM_LIBRARY_PATH} PATH_SUFFIXES OGRE/cmake)
endif ()
if (OGRE_CMAKE_MODULE_DIR)
message(STATUS "Found OGRE CMake module in directory: ${OGRE_CMAKE_MODULE_DIR}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OGRE_CMAKE_MODULE_DIR})
else ()
message(WARNING "Did not find OGRE CMake module.")
endif ()
find_package(OGRE REQUIRED)
# https://ogrecave.github.io/ogre/api/1.10/setup.html
# the search paths
#include_directories(${OGRE_INCLUDE_DIRS})
#link_directories(${OGRE_LIBRARY_DIRS})
# copy essential config files next to our binary where OGRE autodiscovers them
#file(COPY ${OGRE_CONFIG_DIR}/plugins.cfg ${OGRE_CONFIG_DIR}/resources.cfg
#DESTINATION ${CMAKE_BINARY_DIR})
if (${OGRE_FOUND})
# SYSTEM suppresses all the warnings of OGRE
include_directories(SYSTEM ${OGRE_INCLUDE_DIRS})
link_directories(${OGRE_LIBRARY_DIRS})
add_definitions(-DHAS_OGRE=1)
endif ()
I might have messed something up when packaging this and Ubuntu makes it quite hard to fix things once a release (20.04 I assume in your case) has happened.
Please find Ogre 1.12.13 for Ubuntu Focal (20.04) and Ubuntu Jammy (22.04) in my ppa: https://launchpad.net/~s-schmeisser/+archive/ubuntu/ogre-1.12