0

I have installed static version of OGRE. I modified the CMakeLists.txt to:

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules
    /usr/lib/OGRE/cmake/lib/OGRE/cmake)

I got the following message while compiling an application using OGRE.

$ cmake ..
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   system
-- Looking for OGRE...
-- checking for module 'OGRE'
--   package 'OGRE' not found
-- Could not locate OGRE
CMake Error at /usr/lib/OGRE/cmake/lib/OGRE/cmake/FindPkgMacros.cmake:117 (message):
  Required library OGRE not found! Install the library (including dev
  packages) and try again.  If the library is already installed, set the
  missing variables manually in cmake.
Call Stack (most recent call first):
  /usr/lib/OGRE/cmake/lib/OGRE/cmake/FindOGRE.cmake:215 (findpkg_finish)
  source/CMakeLists.txt:32 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!

can anybody help?

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
user27665
  • 673
  • 7
  • 27
  • 1
    Path `/usr/lib/OGRE/cmake/lib/OGRE/cmake/FindPkgMacros.cmake` looks suspicious for installed program. Where you have Ogre library files (`.a`, if you have library installed statically) and include files(`.h`)? How about to set appropriate variables, as noted in error message? – Tsyvarev Feb 01 '16 at 21:24
  • my OGRE static libs are at : /usr/lib/OGRE/cmake/lib my OGRE headers are at : /usr/lib/OGRE/cmake/include – user27665 Feb 02 '16 at 05:07
  • 1
    So you need to hint `find_package(OGRE)` where OGRE is installed. E.g., you may set `CMAKE_PREFIX_PATH` to `/usr/lib/OGRE/cmake` (so libraries will be under `lib/` and include directories under `include/`). See also that question: [Hinting Find.cmake Files with a custom directory](http://stackoverflow.com/questions/34795816/hinting-findname-cmake-files-with-a-custom-directory). – Tsyvarev Feb 02 '16 at 06:49
  • i used cmake .. -DCMAKE_PREFIX_PATH=/usr/lib/OGRE/cmake and cmake worked – user27665 Feb 02 '16 at 10:03

0 Answers0