I think there is something wrong with my CMakeLists.txt Topic is solved

Problems building or running the engine, queries about how to use features etc.
Post Reply
CollegeDropout
Gnoblar
Posts: 6
Joined: Sun Feb 03, 2019 6:39 am
x 1

I think there is something wrong with my CMakeLists.txt

Post by CollegeDropout » Sun Feb 03, 2019 7:00 am

Ogre Version: 1.11.5
Operating System: Windows 10
My problem:
I'm trying to do the "Setting up an OGRE project" tutorial, but when Visual Studio detects my CMakeLists.txt, I get this error:

Code: Select all

Error		CMake Error at CMakeLists.txt:9 (find_package):
  By not providing "FindOGRE.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "OGRE", but
  CMake did not find one.

  Could not find a package configuration file provided by "OGRE" (requested
  version 1.11) with any of the following names:

    OGREConfig.cmake
    ogre-config.cmake

  Add the installation prefix of "OGRE" to CMAKE_PREFIX_PATH or set
  "OGRE_DIR" to a directory containing one of the above files.  If "OGRE"
  provides a separate development package or SDK, be sure it has been
  installed.		CMakeLists.txt		
Here is my CMakeLists.txt:

Code: Select all

cmake_minimum_required (VERSION 2.8)
project (ogreproj)

add_executable(ogreproj ogreproj.cpp)

set(${OGRE_DIR} C:/coding/OgrePlayground/deps/ogre3d/builds/ogre-1.11.5/sdk/CMake)

# specify which version and components you need
find_package(OGRE 1.11 REQUIRED COMPONENTS Bites RTShaderSystem)
# copy resource.cfg next to our binaries where OGRE looks for it
file(COPY ${OGRE_CONFIG_DIR}/resources.cfg DESTINATION ${CMAKE_BINARY_DIR})
What I've done:
I have generated a Visual Studio 15 2017 x64 Ogre project with CMake, then I built both ALL_BUILD and INSTALL. I swear I followed the setup tutorial to the letter, but it just doesn't want to work. Is there something that I'm missing here?
0 x

CollegeDropout
Gnoblar
Posts: 6
Joined: Sun Feb 03, 2019 6:39 am
x 1

Re: I think there is something wrong with my CMakeLists.txt

Post by CollegeDropout » Wed Feb 06, 2019 5:10 am

I actually figured out the solution to this one on my own, nevermind. I was writing OGRE_DIR like ${OGRE_DIR} when it really should have just been written like:

Code: Select all

set(OGRE_DIR C:/coding/OgrePlayground/deps/ogre3d/builds/ogre-1.11.5/sdk/CMake)
0 x

Post Reply