Use Ogre as simple dependencie with Cmake and fetch

Problems building or running the engine, queries about how to use features etc.
Post Reply
GRom76
Gnoblar
Posts: 1
Joined: Mon Mar 20, 2023 9:18 am

Use Ogre as simple dependencie with Cmake and fetch

Post by GRom76 »

Hello, I've got a problem , i'm not an expert with Cmake , but i want to embed Ogre3D
has simple dependency of my project, for that's, i want to use Fetch feature to download
Ogre in my ./dependencies folder , the build is inside another directory ./build/dependencies/Ogre3D
All is fine , but when i call find_package(OGRE REQUIRED ) i've got an error message :

CMake Error at build/dependencies/Ogre3D/cmake/OGREConfig.cmake:33 (message):
File or directory E:/DEV/Engine3D/build/dependencies/Ogre3D/Media
referenced by variable OGRE_MEDIA_DIR does not exist !

but the directory exist , what i'm going wrong ?
thanks !

this is a part of my cmakelists.txt :

FetchContent_Declare(
OGRE3D
GIT_REPOSITORY https://github.com/OGRECave/ogre.git
GIT_TAG master
SOURCE_DIR ${DEPENDENCIES_DIR}/Ogre3D
)

FetchContent_GetProperties(OGRE3D)
if(NOT OGRE3D_POPULATED)
FetchContent_Populate(Ogre3D)


set(OGRE_DIR ${CMAKE_BINARY_DIR}/dependencies/Ogre3D/cmake CACHE STRING "" FORCE)
set(OGRE_STATIC ON CACHE BOOL "" FORCE)
set(OGRE_BUILD_SAMPLES OFF CACHE BOOL "" FORCE)


add_subdirectory(${DEPENDENCIES_DIR}/Ogre3D)


endif()

paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Use Ogre as simple dependencie with Cmake and fetch

Post by paroj »

Post Reply