Page 1 of 1

Set up ogre project fails on mac os

Posted: Wed Jul 25, 2018 12:12 pm
by pum_purum
Ogre Version:[1.11]
Operating System:[macOS 10.12.6]

I'm trying to build my project with Ogre on macOs and I faced with a problem -- cmake can't find "OgreTargets.cmake".
I've done this steps:
1) I build ogre with generator "Unix Makefiles" (with official ogre instruction -- https://ogrecave.github.io/ogre/api/lat ... -ogre.html . Also with Xcode generator I got some error)
2) I set up project with this instruction: https://ogrecave.github.io/ogre/api/latest/setup.html

The first step was successful.
However when after second step I run "cmake" command I get an error:


Code: Select all

CMake Error at /Users/vlad/Documents/game/ogre_build/cmake/OGREConfig.cmake:91 (include):
  include could not find load file:

    /Users/vlad/Documents/game/ogre_build/cmake/OgreTargets.cmake
Call Stack (most recent call first):
  CMakeLists.txt:8 (find_package)


-- Found OGRE
--   static     : OFF
--   components : Bites;HLMS;MeshLodGenerator;Overlay;Paging;Property;RTShaderSystem;Terrain;Volume
--   plugins    : Plugin_BSPSceneManager;Plugin_OctreeSceneManager;Plugin_PCZSceneManager;Plugin_ParticleFX;RenderSystem_GL;RenderSystem_GL3Plus
--   media      : /Users/vlad/Documents/game/ogre_build/Media
My project CMakeLists.txt looks like this.

Code: Select all

cmake_minimum_required (VERSION 2.6)
project (A)


get_filename_component(MAIN_OGRE_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH)
set(OGRE_DIR ${MAIN_OGRE_DIR}/ogre_build/cmake)

find_package(OGRE 1.11 REQUIRED COMPONENTS Bites RTShaderSystem)

file(COPY ${OGRE_CONFIG_DIR}/resources.cfg DESTINATION ${CMAKE_BINARY_DIR})
add_executable(A main.cxx)
target_link_libraries(A ${OGRE_LIBRARIES})
What have I done wrong?

Re: Set up ogre project fails on mac os

Posted: Wed Jul 25, 2018 1:33 pm
by paroj
you missed the install step. (see first link)

Re: Set up ogre project fails on mac os

Posted: Wed Jul 25, 2018 2:59 pm
by pum_purum
paroj wrote: Wed Jul 25, 2018 1:33 pm you missed the install step. (see first link)
I did all steps in first link - uncluding "make install". The problem was that I used wrong path to the SDK.
However now when I run "make" with my project directory:

Re: Set up ogre project fails on mac os

Posted: Wed Jul 25, 2018 5:15 pm
by paroj
someting is wrong with you toolchain. Make sure that you use xcode (not make) and C++11 support is enabled. Also this code was compiled on your system when you were building the SDK.